Details

    • Proposal:
      Hide

      Start a "Validation" vocabulary with the following:

      <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Validation.1.0.0">

      <Term Name="Pattern" Type="Edm.String">
      <Annotation Term="OData.Description" String="The pattern that a string property or parameter must match."/>
      </Term>
      <Term Name="Minimum" Type="Edm.Decimal">
      <Annotation Term="OData.Description" String="Minimum value that a numeric property or parameter can have."/>
      </Term>
      <Term Name="Maximum" Type="Edm.Decimal">
      <Annotation Term="OData.Description" String="Maximum value that a numeric property or parameter can have."/>
      </Term>

      </Schema>

      plus new term, "Validation.Exclusive", that can be applied to Validation.Minimum and Validataion.Maximum..

      Show
      Start a "Validation" vocabulary with the following: <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Validation.1.0.0"> <Term Name="Pattern" Type="Edm.String"> <Annotation Term="OData.Description" String="The pattern that a string property or parameter must match."/> </Term> <Term Name="Minimum" Type="Edm.Decimal"> <Annotation Term="OData.Description" String="Minimum value that a numeric property or parameter can have."/> </Term> <Term Name="Maximum" Type="Edm.Decimal"> <Annotation Term="OData.Description" String="Maximum value that a numeric property or parameter can have."/> </Term> </Schema> plus new term, "Validation.Exclusive", that can be applied to Validation.Minimum and Validataion.Maximum..
    • Resolution:
      Show
      https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/vocabularies/Org.OData.Validation.V1.xml?rev=744

      Description

      These would map to equivalent concepts in JSON Schema.

        Attachments

          Activity

          Hide
          handl Ralf Handl added a comment -

          JSON Schema "minimum" and "maximum" allow JSON numbers. Shouldn't we rather use Type="Edm.PrimitiveType" to reflect this? Which is of course more generic than "number", but we don't have an abstract type for that yet.

          Also JSON Schema has "exclusiveMinimum" and "exclusiveMaximum" to allow open intervals. We could make Minimum and Maximum structured annotations based on the same complex type

          <ComplexType Name="Limit">
          <Property Name="Value" Type="Edm.PrimitiveType" Nullable="false" /> <!-- or Edm.Number -->
          <Property Name="Exclusive" Type="Edm.Boolean" Nullable="false" DefaultValue="false" />
          </ComplexType>

          Show
          handl Ralf Handl added a comment - JSON Schema "minimum" and "maximum" allow JSON numbers. Shouldn't we rather use Type="Edm.PrimitiveType" to reflect this? Which is of course more generic than "number", but we don't have an abstract type for that yet. Also JSON Schema has "exclusiveMinimum" and "exclusiveMaximum" to allow open intervals. We could make Minimum and Maximum structured annotations based on the same complex type <ComplexType Name="Limit"> <Property Name="Value" Type="Edm.PrimitiveType" Nullable="false" /> <!-- or Edm.Number --> <Property Name="Exclusive" Type="Edm.Boolean" Nullable="false" DefaultValue="false" /> </ComplexType>
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Resolved according to revised proposal:

          Add the pattern term as proposed, along with Validation.Minimum and Validation.Maximum terms of type Edm.Decimal and tagging term "Validation.Exclusive" that can be used to annotate the minimum and maximum terms.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Resolved according to revised proposal: Add the pattern term as proposed, along with Validation.Minimum and Validation.Maximum terms of type Edm.Decimal and tagging term "Validation.Exclusive" that can be used to annotate the minimum and maximum terms.
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          I would like to figure out how we can make this vocabulary more dynamic (i.e., iterate on it in the community).

          Once we have it defined, I would like to reference it from the JSON CSDL document to define that the annotations are translated to the equivalent JSON Schema keywords.

          Show
          mikep Michael Pizzo (Inactive) added a comment - I would like to figure out how we can make this vocabulary more dynamic (i.e., iterate on it in the community). Once we have it defined, I would like to reference it from the JSON CSDL document to define that the annotations are translated to the equivalent JSON Schema keywords.

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: