-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
document union types support #138
Comments
Thanks for raising this. jsonschema2pojo doesn't actually support draft04 so "time": {
"type": "object"
} which is why you get class with no data elements. You're right about the documentation though, we should add something to explain what partial support actually means. On reflection, I might actually change 'Partial' to 'None' for union types as I think it might be misleading. jsonschema2pojo does not explode when it sees a union type, it simply chooses the first type it finds. If you have a schema that includes union types but you still (for whatever reason) find it useful to generate some Java from it, then jsonschema2pojo won't break when you try. I'm interested to know whether this is a problem for you right now. Are you able to using some other manual workaround here? (e.g. merging the fields or hand-coding this specific type). |
i wound up hand-coding it. and simplifying the data model. there's an android client and a play framework server, so keeping the data model definitions in java isn't so bad (for now) as it's a very small project. also, hand-coding allows for inner public static classes, which is helpful both for uncluttered namespaces and for use with gson. so yeah, just whatever on this issue. #125 is a good idea, though, as is #127. writing Parcelable decorators is getting pretty boring. |
I've updated the docs from 'Partial' to 'No' as I think this expresses the current situation more accurately. |
thanks for this library. i think it has the potential to save a lot of people a lot of time.
this is an issue for the documentation rather than the code. i see there's partial support for union types, but the following snippet
produces a Time class with no data elements.
The text was updated successfully, but these errors were encountered: