Skip to content

Clash if more than one choice type is present in the same complex type #155

Open
@matzipan

Description

@matzipan

In this xsd, the following type is present:

<xsd:complexType name="tleParametersType">
   <xsd:sequence>
      <xsd:element name="COMMENT" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="EPHEMERIS_TYPE" type="xsd:integer" minOccurs="0"/>
      <xsd:element name="CLASSIFICATION_TYPE" type="xsd:string" minOccurs="0"/>
      <xsd:element name="NORAD_CAT_ID" type="xsd:integer" minOccurs="0"/>
      <xsd:element name="ELEMENT_SET_NO" type="ndm:elementSetNoType" minOccurs="0"/>
      <xsd:element name="REV_AT_EPOCH" type="xsd:nonNegativeInteger" minOccurs="0"/>
      <xsd:choice>
         <xsd:element name="BSTAR" type="ndm:bStarType"/>
         <xsd:element name="BTERM" type="ndm:bTermType"/>
      </xsd:choice>
      <xsd:element name="MEAN_MOTION_DOT" type="ndm:dRevType"/>
      <xsd:choice>
         <xsd:element name="MEAN_MOTION_DDOT" type="ndm:ddRevType"/>
         <xsd:element name="AGOM" type="ndm:agomType"/>
      </xsd:choice>
   </xsd:sequence>
</xsd:complexType>

This gets generated as:

pub struct TleParametersType {
    #[yaserde(prefix = "ndm", rename = "COMMENT")]
    pub comment: Vec<String>,

    #[yaserde(prefix = "ndm", rename = "EPHEMERIS_TYPE")]
    pub ephemeris_type: Option<xs::Integer>,

    #[yaserde(prefix = "ndm", rename = "CLASSIFICATION_TYPE")]
    pub classification_type: Option<String>,

    #[yaserde(prefix = "ndm", rename = "NORAD_CAT_ID")]
    pub norad_cat_id: Option<xs::Integer>,

    #[yaserde(prefix = "ndm", rename = "ELEMENT_SET_NO")]
    pub element_set_no: Option<ElementSetNoType>,

    #[yaserde(prefix = "ndm", rename = "REV_AT_EPOCH")]
    pub rev_at_epoch: Option<xs::NonNegativeInteger>,

    #[yaserde(prefix = "ndm", rename = "tleParametersTypeChoice")]
    pub tle_parameters_type_choice: tle_parameters_type::TleParametersTypeChoice,

    #[yaserde(prefix = "ndm", rename = "MEAN_MOTION_DOT")]
    pub mean_motion_dot: DrevType,

    #[yaserde(prefix = "ndm", rename = "tleParametersTypeChoice")]
    pub tle_parameters_type_choice: tle_parameters_type::TleParametersTypeChoice,
}

You can see that the TleParametersTypeChoice name chosen for the type clashes between the two types

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions