Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-119

Allow definition of "simple" types that fix values for facet attributes of primitive types

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Support a new TypeDefinition element for defining new simple types. TypeDefinitions specify a name, underlying types, and zero or more facets applicable to that type.
      -TypeDefinitions cannot derive from base type definitions.
      -TypeDefinitions can be used wherever a simple type is used (other than as the underlying type in a new TypeDefinition), and are type-comparable with their underlying types and any TypeDefinitions defined using the same underlying type.
      -Additional facets appropriate for the underlying type may be specified in the usage, but the facets specified in the typedefinition must not be respecified.
      -Annotations may be applied to a TypeDefinition, and are considered applied wherever the TypeDefinition is used. Applying the same annotation to a property whose TypeDefinition already defines that annotation is an error.
      -Where TypeDefinitions are used, the type definition is returned in place of the primitive type wherever the type is specified in a response.
      Example:
      <TypeDefinition Name="Length" UnderlyingType="Edm.Int32" Nullable=false>
      <Annotation Term="Org.Odata.Measurements.V1.Units" String="Centimeters"/>
      </TypeDefinition>
      <TypeDefinition Name="Weight" UnderlyingType="Edm.Int32" Nullable=false>
      <Annotation Term=" Org.Odata.Measurements.V1.Units" String="Kilograms"/>
      </TypeDefinition>
      <ComplexType Name="Size">
      <Property Name="Height" Type="Self.Length" />
      <Property Name="Weight" Type="Self.Weight" />
      </ComplexType>

      Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47355/latest/odata_meeting-14_on-20121101-minutes.html

      Show
      Support a new TypeDefinition element for defining new simple types. TypeDefinitions specify a name, underlying types, and zero or more facets applicable to that type. -TypeDefinitions cannot derive from base type definitions. -TypeDefinitions can be used wherever a simple type is used (other than as the underlying type in a new TypeDefinition), and are type-comparable with their underlying types and any TypeDefinitions defined using the same underlying type. -Additional facets appropriate for the underlying type may be specified in the usage, but the facets specified in the typedefinition must not be respecified. -Annotations may be applied to a TypeDefinition, and are considered applied wherever the TypeDefinition is used. Applying the same annotation to a property whose TypeDefinition already defines that annotation is an error. -Where TypeDefinitions are used, the type definition is returned in place of the primitive type wherever the type is specified in a response. Example: <TypeDefinition Name="Length" UnderlyingType="Edm.Int32" Nullable=false> <Annotation Term="Org.Odata.Measurements.V1.Units" String="Centimeters"/> </TypeDefinition> <TypeDefinition Name="Weight" UnderlyingType="Edm.Int32" Nullable=false> <Annotation Term=" Org.Odata.Measurements.V1.Units" String="Kilograms"/> </TypeDefinition> <ComplexType Name="Size"> <Property Name="Height" Type="Self.Length" /> <Property Name="Weight" Type="Self.Weight" /> </ComplexType> Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47355/latest/odata_meeting-14_on-20121101-minutes.html
    • Resolution:
      Show
      https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47437/odata-core-v1.0-wd01-part3-csdl-2012-11-12-RH.doc https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/schemas/csdl.xsd?rev=97 https://www.oasis-open.org/apps/org/workgroup/odata/download.php/48216/odata-core-v1.0-wd01-part1-protocol-2013-2-11-MP.docx Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47595/latest/odata-meeting-16_on-20121129-minutes.html https://www.oasis-open.org/apps/org/workgroup/odata/download.php/48216/odata-core-v1.0-wd01-part1-protocol-2013-2-11-MP.docx Accepted: https://www.oasis-open.org/committees/download.php/48269/odata-meeting-25_on-20130214-minutes.html#odata-119

      Description

      It would be helpful if we could define "simple" types that are based on primitive types. This would be useful for providing values for facet attributes in one place:

      <SimpleType Name="Char80" BaseType="Edm.String" MaxLength="80" FixedLength="true" />
      <SimpleType Name="AmountInFInancialReportingCurrency" BaseType="Edm.Decimal" Precision="30" Scale="2" />

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: