OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: [OASIS Issue Tracker] (ODATA-842) Represent primitive types as JSON Schema formats

    [ https://issues.oasis-open.org/browse/ODATA-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60720#comment-60720 ] 

Michael Pizzo commented on ODATA-842:

-Should we name the formats with an edm prefix (i.e., Edm.Guid) or not?
==>Since Swagger already defined guid, int64, etc., we should just add what is missing (w/o extensions)
-If we specify a format, do we (for some types) also specify pattern (i.e., guid/uuid, time, datetimeoffset)?
==>open new issue

> Represent primitive types as JSON Schema formats
> ------------------------------------------------
>                 Key: ODATA-842
>                 URL: https://issues.oasis-open.org/browse/ODATA-842
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData JSON CSDL
>    Affects Versions: V4.0_WD01
>         Environment: Proposed
>            Reporter: Ralf Handl
>             Fix For: V4.0_WD01
> Many OData primitive types are JSON Schema primitive types combined with a set of restrictions, e.g. Edm.Int64 is
> - "type":"integer",
> - "minimum":-9223372036854775808,
> - "maximum":9223372036854775807
> or Edm.Guid is
> - "type":"string",
> - "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}$"
> There are basically three options:
> 1) place these in definitions in edm.json and reference them there
> 2) inline these definitions at each occurrence of the OData primitive type
> 3) just combine the JSON Schema primitive type with an OData-specific format, e.g.
> - type: string
> - format: guid
> or
> - type: integer
> - format: int64
> The third approach is the most readable and in sync with what Swagger does, see http://swagger.io/specification, section Data Types, and we can try to get these formats into the next version of JSON Schema, see https://github.com/json-schema/json-schema/wiki/%22format%22-suggestions

This message was sent by Atlassian JIRA

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]