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

Can Validation.DerivedTypeConstraint specify collection-valued types?

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Vocabularies
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Include two statements in the term definition:

      Allow Validation.DerivedTypeConstraint to specify Collection(...), but only if the declared type is Edm.Untyped, because that is the only case where the property can be collection-valued or not.

      If the declared type of a property is Collection(ns.T1), then "@Validation.DerivedTypeConstaint": ["ns.T2"] means that  instances of ns.T2 are allowed in the collection.

      PROPOSED WORDING:
      If the element being annotated is collection-valued, the DerivedTypeConstraint specifies the types allowed for members of the collection; it does not specify the Collection() wrapper. The QualifiedTypeName may only include the Collection() wrapper if the declared type of the element being annotated is Edm.Untyped.

      Show
      Include two statements in the term definition: Allow Validation.DerivedTypeConstraint  to specify Collection(...) , but only if the declared type is Edm.Untyped , because that is the only case where the property can be collection-valued or not. If the declared type of a property is Collection(ns.T1) , then  "@Validation.DerivedTypeConstaint": ["ns.T2"]  means that  instances of  ns.T2  are allowed in the collection. PROPOSED WORDING: If the element being annotated is collection-valued, the DerivedTypeConstraint specifies the types allowed for members of the collection; it does not specify the Collection() wrapper. The QualifiedTypeName may only include the Collection() wrapper if the declared type of the element being annotated is Edm.Untyped.
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/189

      Description

      The term DerivedTypeConstraint takes a collection of QualifiedTypeNames. Can these also contain collection-valued types, as in

      <Annotation Term="Validation.DerivedTypeConstraint">
       <Collection>
        <String>Edm.PrimitiveType</String>
        <String>Collection(Edm.PrimitiveType)</String>
       </Collection>
       </Annotation>
      

      ?

      If the declared type is single-valued, derivations cannot be collection-valued.

      If the declared type is Collection(ns.T1), which is correct: "@Validation.DerivedTypeConstaint": ["ns.T2"] or "@Validation.DerivedTypeConstaint": ["Collection(ns.T2)"]?

      If the declared type is Edm.Untyped, both single- and collection-valued derived types are possible.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: