[JAXRS-CXF] [bug #4422] use java.util.Date when selecting dateLibrary=legacy#4724
[JAXRS-CXF] [bug #4422] use java.util.Date when selecting dateLibrary=legacy#4724wing328 merged 1 commit intoswagger-api:masterfrom
Conversation
…dateLibrary=legacy according to the help message setting dateLibrary to 'legacy' should make the code generator use java.util.Date. before this change, when setting dateLibrary to 'legacy' made the generator use javax.xml.datatype.XMLGregorianCalendar. now, the generator uses java.util.Date such that the documentation and behavior are consistent.
|
@wing328 and @hiveship, I thought this was the only change needed to make codegen work as documented, but now I see other things that I do not understand, maybe you guys could help shed some light... For example, in typeMapping.put("date", "LocalDate");
importMapping.put("LocalDate", "org.joda.time.LocalDate");This forces the user to use joda time without regard to what was set in the I see the same thing in Thanks in advance for your assistance. |
|
I think those datetime option has been added to Java API client but not for all Java server generators. cc @cbornet to see if he's any input on this. |
|
The reason for the usage of javax.xml.datatype.XMLGregorianCalendar is that this is the default for the CXF XML based processing. For CXF I think there should be more flavours:
If there is support for java.util.Date needed, I think this should be done as a fourth library. The current implementation at master though is actually a mixture of joda and XMLGregorianCalendar as @MatanRubin wrote, so a cleanup is a good idea. |
|
@jfiala thanks for reviewing the change @MatanRubin thanks for the PR, which has been merged into master. |
…dateLibrary=legacy (swagger-api#4724) according to the help message setting dateLibrary to 'legacy' should make the code generator use java.util.Date. before this change, when setting dateLibrary to 'legacy' made the generator use javax.xml.datatype.XMLGregorianCalendar. now, the generator uses java.util.Date such that the documentation and behavior are consistent.
according to the help message setting dateLibrary to 'legacy' should
make the code generator use java.util.Date.
before this change, when setting dateLibrary to 'legacy' made the
generator use javax.xml.datatype.XMLGregorianCalendar.
now, the generator uses java.util.Date such that the documentation and
behavior are consistent.