Can Validation.DerivedTypeConstraint specify collection-valued types?

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

      Applied

    • 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.
    • Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/189

      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.

            Assignee:
            Unassigned
            Reporter:
            heiko.theissen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: