Swagger-codegen: Swagger Codegen Java not using java.util.Date when not specifying date library

Created on 25 Feb 2017  路  2Comments  路  Source: swagger-api/swagger-codegen

Description

According to 1784, not specifying the date library should result in using java.util.Date. But, I notice that it ends up using joda DateTime.

Swagger-codegen version

version 2.2.1

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i http://localhost:8080/v1/swagger.json -l java --library feign -o samples/client/my-client

Steps to reproduce

You'll notice the joda library is used in the petstore sample client.

Java Question

Most helpful comment

The default date has been changed to joda. If you want old dates, you need to use -DdateLibrary=legacy.
That said it's not recommended to use java.util.Date and you should always prefer threeten or joda.

All 2 comments

The default date has been changed to joda. If you want old dates, you need to use -DdateLibrary=legacy.
That said it's not recommended to use java.util.Date and you should always prefer threeten or joda.

I believe that there's a bug where the threeten stuff is NOT included in the POM.xml as a dependency.

Was this page helpful?
0 / 5 - 0 ratings