You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add support for discriminator and discriminatorValue attributes of data types.
Having data types defined like this:
types:
Person:
type: object
discriminator: kind # refers to the `kind` property of object `Person`
properties:
kind: string # contains name of the kind of a `Person` instance
name: string
Employee: # kind can equal `Employee`; default value for `discriminatorValue`
type: Person
discriminatorValue: emp
properties:
employeeId: integer
User: # kind can equal `User`; default value for `discriminatorValue`
type: Person
discriminatorValue: usr
properties:
userId: integer
should generate Person object with following annotations:
@JsonTypeInfo(use = Id.NAME, include = As.EXISTING_PROPERTY, property = "kind", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = User.class, name = "usr"),
@JsonSubTypes.Type(value = Employee.class, name = "emp")
})
public class Person implements Serializable
The text was updated successfully, but these errors were encountered:
I would like to add support for
discriminator
anddiscriminatorValue
attributes of data types.Having data types defined like this:
should generate
Person
object with following annotations:The text was updated successfully, but these errors were encountered: