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

Should we define patterns for some of the primitive types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: V4.01_WD01
    • Component/s: CSDL JSON
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Define and use "pattern" keyword values for the following primitive types:
      -Binary
      "pattern": "^([A-Za-z0-9_-]

      {4})*([A-Za-z0-9_-]{3}[A-Za-z0-9_-]|[A-Za-z0-9_-]{2}[AEIMQUYcgkosw048]=?|[A-Za-z0-9_-][AQgw](==)?)?$"

      -Guid
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}

      -[0-9a-fA-F]

      {4}-[0-9a-fA-F]{4}

      -[0-9a-fA-F]

      {12}

      $"

      -Date
      "pattern": "^[0-9]

      {4,}

      (0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$"

      -TimeOfDay including Precision
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" - for Precision=0
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]

      {1,12})?$" for Precision=12

      -Duration including Precision
      "pattern": "^-?P([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+S)?)?$" - for Precision=0
      "pattern": "^-?P([0-9]D)?(T([0-9]+H)?([0-9]+M)?([0-9]([.][0-9]{1,12}

      )?S)?)?$" - for Precision=12

      Show
      Define and use "pattern" keyword values for the following primitive types: -Binary "pattern": "^( [A-Za-z0-9_-] {4})*( [A-Za-z0-9_-] {3} [A-Za-z0-9_-] | [A-Za-z0-9_-] {2} [AEIMQUYcgkosw048] =?| [A-Za-z0-9_-] [AQgw] (==)?)?$" -Guid "pattern": "^ [0-9a-fA-F] {8}- [0-9a-fA-F] {4} - [0-9a-fA-F] {4}- [0-9a-fA-F] {4} - [0-9a-fA-F] {12} $" -Date "pattern": "^ [0-9] {4,} (0 [1-9] |1 [012] ) (0 [1-9] | [12] [0-9] |3 [01] )$" -TimeOfDay including Precision "pattern": "^( [01] [0-9] |2 [0-3] ): [0-5] [0-9] : [0-5] [0-9] $" - for Precision=0 "pattern": "^( [01] [0-9] |2 [0-3] ): [0-5] [0-9] : [0-5] [0-9] ( [.] [0-9] {1,12})?$" for Precision=12 -Duration including Precision "pattern": "^-?P( [0-9] +D)?(T( [0-9] +H)?( [0-9] +M)?( [0-9] +S)?)?$" - for Precision=0 "pattern": "^-?P( [0-9] D)?(T( [0-9] +H)?( [0-9] +M)?( [0-9] ( [.] [0-9] {1,12} )?S)?)?$" - for Precision=12
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/56653/odata-json-csdl-v4.0-wd01-2015-10-08.docx https://www.oasis-open.org/committees/download.php/56709/odata-json-csdl-v4.0-wd01-2015-10-16.docx Accepted: https://www.oasis-open.org/committees/download.php/56867/odata-meeting-112_on-20151105-minutes.html

      Description

      In ODATA-842 we added format keywords for common primitive types. Do we also want to use the pattern keyword in the JSON CSDL format for some common string types? in particular:
      -Binary
      -Guid
      -Date
      -TimeOfDay
      -Duration

      The Precision facet of TimeOfDay and Duration is already translated into a pattern for the end of the string representation, so for these two types it would just result in a pattern for the complete string representation.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: