Closed
Description
I think I encountered an issue in the schema generation of records that are unions:
Given the following example (using Jakarta annotations and the introspector that follows with it):
@XmlType(name = "Super")
@XmlAccessType(FIELD)
@XmlSeeAlso(Sub.class)
class Super {
@XmlElement(required = true)
String foo; // getter, setter
}
@XmlType(name = "Sub")
@XmlAccessType(FIELD)
class Sub extends Super {
@XmlElement(required = true)
String bar; // getter, setter
}
where the class Sub
is correctly identified, a value of Super
is not allowed in the created union.
To avoid this issue, unionSchemas
should also include type
, if type
is non-abstract.