Skip to content

AvroSchema: Does not include base class for records with subclasses #589

Closed
@raphw

Description

@raphw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions