apicollective/apibuilder-generator

Replace joda-time with java.time

Closed this issue · 4 comments

From http://www.joda.org/joda-time:

Joda-Time is the de facto standard date and time library for Java prior to Java SE 8. Users are now asked to migrate to java.time (JSR-310).

The http4s/circe generators use java.time. We can't just update the play generators though as it would be a breaking change. We'd either need to switch via an attribute in the api.json or create a new set of play generators.

suggest a new generator key - maybe instead of play_2_6_client we do jdk10_play_2_6_client and in that one use joda time

If the intent is to show the minimum JDK version, it should be jdk8_play_2_6_client as java.time was introduced in Java 8

Love the idea of a new generator that replaces joda with java.time, but would suggest we take that opportunity to combine the various permutations of play generators into a single generator, similar to the http4s generators.

Ie. instead of a new jdk8_play_2_6_client, and a jdk8_scala_models and a jdk8_play_2_x_json and a jdk8_play_2_x_standalone_json and a jdk8_play_2_6_mock_client and a jdk8_play_2_x_routes generator, let's generate all these files in one single jdk8_play_2_6 generator, and let the caller choose which of the generated files are actually needed.