Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "javaType" for things that are not "type": "object" #223

Closed
dflemstr opened this issue Jul 18, 2014 · 4 comments
Closed

Support "javaType" for things that are not "type": "object" #223

dflemstr opened this issue Jul 18, 2014 · 4 comments
Milestone

Comments

@dflemstr
Copy link

There is nothing that says that only "type": "object" things can have "javaType". For example, I would want a Joda DateTime to be serialized as an integer (letting Jackson handle the actual conversion) but this is not possible to express right now.

@joelittlejohn joelittlejohn added this to the 0.4.5 milestone Jul 20, 2014
@joelittlejohn
Copy link
Owner

Thanks David. This sounds like a perfectly reasonable change so lets include it in the next version.

@dflemstr
Copy link
Author

How easy would this be to add? I would like to do it myself but I would have to spend some time figuring out what the contract of org.jsonschema2pojo.rules.Rule, which is not immediately obvious to me. If it's a small change then maybe it's better if somebody who is more familiar with the code base implements this.

@joelittlejohn joelittlejohn modified the milestones: 0.4.5, 0.4.6 Aug 4, 2014
@joelittlejohn
Copy link
Owner

I plan to release 0.4.5 tonight so I'm going to push this into 0.4.6.

@joelittlejohn
Copy link
Owner

I've generalised the implementation in #287 to allow for any schema type to be overridden using javaType (not just integers and numbers).

@joelittlejohn joelittlejohn added this to the 0.4.10 milestone Mar 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants