mbknor / mbknor-jackson-jsonSchema

Generate JSON Schema with Polymorphism using Jackson annotations
MIT License
234 stars 79 forks source link

Proper handling of Polymorphic types when JsonTypeInfo.Id is DEDUCTION #164

Open jcrayner opened 2 years ago

jcrayner commented 2 years ago

Schema generation for polymorphic types where the deserialisation strategy is of JsonTypeInfo.Id.DEDUCTION. Jackson uses a seralization strategy of JsonTypeInfo.Id.EXISTING_PROPERTY with a visibility of false and a null property name when writing polymorphic types such as this. The existing implementation relies on a property name being non-null with it's polymorphic type handling (when writing out the @type or @class enum within the subtype), which is not appropriate for this particular strategy.