Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choice becomes list? #906

Closed
skinkie opened this issue Jan 1, 2024 · 1 comment
Closed

Choice becomes list? #906

skinkie opened this issue Jan 1, 2024 · 1 comment

Comments

@skinkie
Copy link
Contributor

skinkie commented Jan 1, 2024

Is this caused by validBetween becoming a list?

@dataclass(kw_only=True)
class EntityInVersionStructure(EntityStructure):
    validity_conditions_or_valid_between: List[
        Union[ValidityConditionsRelStructure, "ValidBetween"]
    ] = field(
        default_factory=list,
        metadata={
            "type": "Elements",
            "choices": (
                {
                    "name": "validityConditions",
                    "type": ValidityConditionsRelStructure,
                    "namespace": "http://www.netex.org.uk/netex",
                },
                {
                    "name": "ValidBetween",
                    "type": Type["ValidBetween"],
                    "namespace": "http://www.netex.org.uk/netex",
                },
            ),
        },
    )
    alternative_texts: Optional[AlternativeTextsRelStructure] = field(
        default=None,
        metadata={
            "name": "alternativeTexts",
            "type": "Element",
            "namespace": "http://www.netex.org.uk/netex",
        },
    )
        <xsd:group name="EntityInVersionGroup">
                <xsd:annotation>
                        <xsd:documentation>Common Properties of an ENTITY IN VERSION.</xsd:documentation>
                </xsd:annotation>
                <xsd:sequence>
                        <xsd:choice minOccurs="0">
                                <xsd:element name="validityConditions" type="validityConditions_RelStructure">
                                        <xsd:annotation>
                                                <xsd:documentation>VALIDITY CONDITIONs conditioning entity.</xsd:documentation>
                                        </xsd:annotation>
                                </xsd:element>
                                <xsd:element ref="ValidBetween" maxOccurs="unbounded"/>
                        </xsd:choice>
                        <xsd:element name="alternativeTexts" type="alternativeTexts_RelStructure" minOccurs="0">
                                <xsd:annotation>
                                        <xsd:documentation>Additional Translations of text  elements.</xsd:documentation>
                                </xsd:annotation>
                        </xsd:element>
                </xsd:sequence>
        </xsd:group>
@tefra
Copy link
Owner

tefra commented Jan 1, 2024

Yes, the validityConditions can occur max once, the other unlimited times, so the compound field has to be a list.

At some point I have to resolve this one, we should have all the data in place, but the verifying is scary.

@skinkie skinkie closed this as completed Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants