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

Add support for xsd:choice #17

Open
henkesn opened this issue Jan 13, 2023 · 1 comment
Open

Add support for xsd:choice #17

henkesn opened this issue Jan 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@henkesn
Copy link
Collaborator

henkesn commented Jan 13, 2023

Would be great to have support for xsd:choice somehow. This one is not trivial, because there are no union types for graphql inputs. Perhaps we can support a subset though, e. g. for non-list types by having just all options as fields.

Example:

<xs:complexType name="uidEntityPublicSearchRequest">
  <xs:sequence>
    <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element xmlns:q5="http://www.ech.ch/xmlns/eCH-0097/5" minOccurs="0" maxOccurs="1" name="uid" type="q5:uidStructureType"/>
     <xs:element xmlns:q6="http://www.ech.ch/xmlns/eCH-0097/5" minOccurs="0" maxOccurs="1" name="otherOrganisationId" type="q6:namedOrganisationIdType"/>
      <xs:element minOccurs="0" maxOccurs="1" name="uidEntitySearchParameters" type="tns:uidEntityPublicSearchParameters"/>
    </xs:choice>
  </xs:sequence>
</xs:complexType>

taken from https://www.uid-wse.admin.ch/V5.0/PublicServices.svc?WSDL. Could be mapped to something like

input UidEntityPublicSearchRequestInput {
  uid: UidStructureTypeInput
  uidEntitySearchParameters: UidEntityPublicSearchParametersInput
}
@henkesn henkesn added the enhancement New feature or request label Jan 13, 2023
@pso-aeb
Copy link
Collaborator

pso-aeb commented Mar 14, 2023

I think for Output-objects we could map this to GraphQL-Interfaces.

For input I also only see your "best effort" solution. List-Types are problematic. Also fields with the same name but different types would not work.

henkesn added a commit that referenced this issue Jun 28, 2023
- make apis provided by the generated schema as stable as possible (introduce namespaces for types, don't return only the first operation output message part, fallback to GraphQLJSON on generation errors and incompatible xsd to preserve a working (but partly untyped) schema).
- Set a more versatile foundation for additional xsd features which can be implemented later without breaking changes.
- Fix errors around the type resolution in different namespaces.
- Remove the usage of node-soap's service descriptions because they are incomplete. Unfortunately node-soap seems to rely on them too which leads to some bugs.
- Remove specs which don't work anymore because of removed WSDL sources

Fixes #16 and partially #17 and #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants