Skip to content

Conversation

adrienthebo
Copy link

The PubChem PUG View schema1 frequently uses the following pattern:

<!-- ... -->
    <xs:complexType>
      <xs:sequence>
        <xs:choice>
          <xs:element name="A" type="xs:string"/>
          <xs:element name="B" type="xs:int"/>
        </xs:choice>
        <xs:element name="..." type="xs:string" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<!-- ... -->

Prior to this change the xs:choice element was being treated as just another xsd element rather than a choice. This commit correctly tags enum struct fields so that they are properly flattened.

The PubChem PUG View schema[1] frequently uses the following pattern:

```xml
<!-- ... -->
    <xs:complexType>
      <xs:sequence>
        <xs:choice>
          <xs:element name="A" type="xs:string"/>
          <xs:element name="B" type="xs:int"/>
        </xs:choice>
        <xs:element name="..." type="xs:string" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<!-- ... -->
```

Prior to this change the `xs:choice` element was being treated as just
another xsd element rather than a choice. This commit correctly tags enum
struct fields so that they are properly flattened.

[1]: https://pubchem.ncbi.nlm.nih.gov/docs/pug-view#section=Formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant