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-843) Nullable as anyOf or as OData-specific keyword


     [ https://issues.oasis-open.org/browse/ODATA-843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralf Handl updated ODATA-843:
-----------------------------

    Environment: Applied  (was: Proposed)

> Nullable as anyOf or as OData-specific keyword
> ----------------------------------------------
>
>                 Key: ODATA-843
>                 URL: https://issues.oasis-open.org/browse/ODATA-843
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData JSON CSDL
>    Affects Versions: V4.0_WD01
>         Environment: Applied
>            Reporter: Ralf Handl
>             Fix For: V4.0_WD01
>
>
> JSON Schema treats null as a separate data type, requiring an "anyOf" construct for nullable properties:
>         "Supplier":{
>           "anyOf":[{
>               "$ref":"#/definitions/ODataDemo.Supplier"
>             }, {
>               "type":"null"
>             }
>           ],
> If we accept that OData-unaware JSON Schema validators will complain wrongly if they encounter a null value, we could shorten this to
>         "Supplier":{
>               "$ref":"#/definitions/ODataDemo.Supplier",
>               "nullable":true
>             }
> This would increase readability for humans and OData-aware machines and significantly reduce the optical size of the JSON CSDL due to the reduced number of line breaks added by pretty printers and JSON Viewers. The actual byte size reduction isn't significant.
> Combined with ODATA-842 this would reduce
>         "Created":{
>           "anyOf":[
>             {
>               "allOf":[
>                 {
>                   "$ref":"http://docs.oasis-open.org/odata/odata-json-csdl/v4.0/edm.json#/definitions/Edm.DateTimeOffset";
>                 }
>               ],
>               "pattern":"(^[^.]*$|[.][0-9]{1,6}$)"
>             },
>             {
>               "type":"null"
>             }
>           ]
>         }
> to just
>         "Created":{
>           "type":"string",
>           "format":"date-time",
>           "precision":6
>           "nullable":true
>         }



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


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