node-soap-graphql icon indicating copy to clipboard operation
node-soap-graphql copied to clipboard

Add support for xsd:restriction

Open henkesn opened this issue 2 years ago • 1 comments
trafficstars

Creating a schema from WSDL/XSD which have xsd:restriction raised an error. Would be good to have that fixed by simply ignoring the restrictions in a first step. Some cases perhaps could also be mapped to enum later.

Example:

<xs:simpleType>
  <xs:restriction base="xs:string">
   <xs:enumeration value="optional"/>
   <xs:enumeration value="required"/>
   <xs:enumeration value="prohibited"/>
  </xs:restriction>
</xs:simpleType>

henkesn avatar Jan 13 '23 18:01 henkesn

XSD-Doc: https://www.w3schools.com/xml/schema_facets.asp Should use the base as type for the field. Map to enum seems plausible. All other possible restrictions don't have a proper correspondence in GraphQL (AFAIS). But we could put them in the comment for the field.

pso-aeb avatar Mar 14 '23 16:03 pso-aeb