-
Notifications
You must be signed in to change notification settings - Fork 12
@JsonSubTypes
JonathanO edited this page Feb 10, 2013
·
2 revisions
Specify a list of classes which extend this class, and optionally their "names". Used for handling inheritance (see @JsonTypeInfo)
This can also be used on a property/getter/setter to provide information about subtypes of the type of that particular field.
- value (JsonSubTypes\Type[]) The sub types
- value (string) The sub class
- name (string) An optional name for use if names are needed, and JsonTypeName isn't being used.
<?
/**
* @JsonSubTypes({@JsonSubTypes\Type("Foo"), @JsonSubTypes\Type("Bar")})
*/
class Baz {
}
class Foo extends Baz {
}
class Bar extends Baz {
}