How to serialize a property of POJO as oneOf?

330 views
Skip to first unread message

Vibhor Mahajan

unread,
May 26, 2017, 11:08:31 AM5/26/17
to jackson-user

I have a requirement wherein I want to serialize one of my POJO property as oneOf in generated schema.
I could see the oneOf support added in ContainerTypeSchema but not sure how I can use it in my usecase. Are there any annotations I can put on my property so that the property is serialized as oneOf in the schema or there is some other way? Could you please guide or post some sample code snippet here?

Tatu Saloranta

unread,
Jun 20, 2017, 2:28:06 PM6/20/17
to jackson-user
At this point we must, I think, consider `jackson-module-jsonSchema`
to be unsupported, and probably dropped from Jackson 3.x as core
component.

You may want to look for other JSON Schema generators.

-+ Tatu +-
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jackson-user...@googlegroups.com.
> To post to this group, send email to jackso...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Morten Kjetland

unread,
Jun 21, 2017, 3:14:51 AM6/21/17
to jackson-user
Hi,

You might want to give this project a try:


-Morten

Tatu Saloranta

unread,
Jun 21, 2017, 1:47:03 PM6/21/17
to jackson-user
I think we might want further emphasize that this is the upgrade path:
README does have a link, but just in context of "for JSON Schema v4,
use this".

Jackson 3.x will be a chance to improve introspection API from
databind, too, which I hope could make it easier to support schema
generation better.

-+ Tatu +-
Reply all
Reply to author
Forward
0 new messages