You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you think this is a good idea I will take care of implementing it and issuing a pull request, I just wanted to propose it here to make sure it makes sense before starting work.
For the implementation, I would follow the pattern that has been implemented for date-time. I'd add a new config flag for whether or not to use Joda LocalDate and LocalTime (separate from the current flag for whether to use Joda DateTime), defaulting to false.
The text was updated successfully, but these errors were encountered:
Hi Brent. This sounds like a good addition, thanks for raising this. Happy to accept a pull request along the lines you have suggested (useJodaLocalDates).
I assume the Joda serializer for Jackson can support LocalDate and LocalDateTime?
There is a really useful feature currently in place where the generated class property will be LocalDateTime when the JSON schema type is string with format of date-time (implemented in https://github.com/joelittlejohn/jsonschema2pojo/blob/a0797e0878dc46f174b64643bc09655b22983afb/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/FormatRule.java). I'd like to propose generating a LocalDate when the format is date, and LocalTime when the format is time. I see date and time listed in that file explicitly being set to a type of string, so I am guessing that this was thought about at at least some point?
If you think this is a good idea I will take care of implementing it and issuing a pull request, I just wanted to propose it here to make sure it makes sense before starting work.
For the implementation, I would follow the pattern that has been implemented for date-time. I'd add a new config flag for whether or not to use Joda LocalDate and LocalTime (separate from the current flag for whether to use Joda DateTime), defaulting to false.
The text was updated successfully, but these errors were encountered: