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 for JsonTypeInfo to add type information for Jackson1/Jackson2 #958

Closed
ddcruver opened this issue Feb 22, 2019 · 3 comments
Closed

Comments

@ddcruver
Copy link
Contributor

ddcruver commented Feb 22, 2019

I would like to create json-schema generated classes where type information added to the class. This is useful in cases when you want to enable polymorphism.

My primary use case is to add this to the top of generated classes:
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")

Also my primary use case is Jackson 2 but Jackson 1 has similar classes and functionality.

ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Apr 4, 2019
@ddcruver
Copy link
Contributor Author

ddcruver commented Apr 5, 2019

@joelittlejohn Do you think you could look over this and merge it in if you like it?

joelittlejohn pushed a commit that referenced this issue Apr 23, 2019
Squashed commits:

* This will add support for including the Jackson1/2 JsonTypeInfo annotation onto all generated classes as described in #958
* #967 Remove unnecessary constructor.
* #967 Move type info related code into annotator implementations.
* #967 Improve documentation to include references to deserializationClassProperty.
* #967 make type info more generic as future annotators may not always implement through annotations.
* #967 Move use plymorphic deserialization related code into annotator implementations.
* #967 Move use plymorphic deserialization related code into annotator implementations. Updated composite annotator and tests instances.
* #967 Improve documentation to include references to deserializationClassProperty in ant plugin.
* #967 Update property in maven plugin and update tests.
@dsegoviat
Copy link

This feature would be very useful! I would like to benefit from that too.

@ddcruver
Copy link
Contributor Author

@dsegoviat This feature is already implemented. Make sure you update to version 1.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants