Skip to content

[xsd support] wrong field identify as a list within a choice #1215

Description

@Thomasb81

Hello

Regarding this sample:
https://github.com/tefra/xsdata-samples/tree/main/ipxact

https://github.com/tefra/xsdata-samples/blob/main/ipxact/models/abstraction_def_port_constraints_type.py

According to relevant schema definition:

The produce dataclass should be:

@dataclass(kw_only=True)
class AbstractionDefPortConstraintsType:
    """
    Defines constraints that apply to a wire type port in an abstraction
    definition.
    """

    class Meta:
        name = "abstractionDefPortConstraintsType"

    timing_constraint: list[TimingConstraint] = field(
        default_factory=list,
        metadata={
            "name": "timingConstraint",
            "type": "Element",
            "namespace": "http://www.accellera.org/XMLSchema/IPXACT/1685-2022",
        },
    )
    drive_constraint: None | DriveConstraint = field(
        default=None,
        metadata={
            "name": "driveConstraint",
            "type": "Element",
            "namespace": "http://www.accellera.org/XMLSchema/IPXACT/1685-2022"
        },
    )
    load_constraint: None | LoadConstraint = field(
        default=None,
        metadata={
            "name": "loadConstraint",
            "type": "Element",
            "namespace": "http://www.accellera.org/XMLSchema/IPXACT/1685-2022
        },
    )

drive_constraint and load_constraint should note a list.
abstractionDefPortConstraintsType is choice; each exclusive possibility allow only a single time a field drive_constraint and load_constraint
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions