Previous Page Arrow Next Page Arrow

4.6 Auxiliary Type Definitions

An SData schema can contain definitions of low level substructures and simple types that are used and shared by resource kind definitions and/or service operation definitions. Here is a typical simple type definition from our example schema:

  <xs:simpleType name="civility--enum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Mr"/>
      <xs:enumeration value="Mrs"/>
      <xs:enumeration value="Ms"/>
    </xs:restriction>
  </xs:simpleType>

In our example schema, this type is used in the contact resource kind definition:

<xs:complexType name="contact--type">
  <xs:sequence>
    <xs:element name="civility" type="tns:civility--enum" sme:label="Civility" />
      <!-- other properties (skipped for clarity) -->
  </xs:sequence>
</xs:complexType>

Enumerated types SHOULD be postfixed by –enum rather than –type.

SData providers MAY define auxiliary types in their schemas. If they do so, they should follow the pattern above.

Previous Page Arrow Next Page Arrow