I agree with your concern. There are different audiences.
Resource implementers: They don't need to store a "null" value at all. Interface implementers: They are responsible for mapping a presentation language to an implementation. At that point JSON null becomes important.
The current language is appropriate to #2 for JSON. Maybe not for XML. The proposed language below is appropriate for #1.
Perhaps the proposed language is best left to a future document that is a formal language agnostic metamodel for OData.
George
From: Handl, Ralf <
ralf.handl@sap.com>
Sent: 20 March, 2019 6:43 AM
To: Ericson, George; OASIS Issues Tracker;
odata@lists.oasis-open.org Subject: RE: [odata] [OASIS Issue Tracker] (ODATA-1292) CSDL 7.2.1 Nullable: improve wording
[EXTERNAL EMAIL]
We had a long discussion on whether null is a value back in 2016, see
https://www.oasis-open.org/committees/download.php/58261/NullInOData.html .
In the meantime we seem to have moved more into the programming language camp, treating null as a value.
This is also consistent with the role of null in JSON, our predominant data format. There it definitely is a value.
The Amount property can have the value null clearly expresses that
{
"Amount":null
}
is a valid JSON request/response.
Should support not having a value is not that clear. Does it mean null , or does it mean omitted or undefined ?
We should not underestimate the fact that most readers of our specifications are programmers and use the programming language interpretation of null. The suggested changes below will most likely lead to more confusion.
From:
odata@lists.oasis-open.org <
odata@lists.oasis-open.org >
On Behalf Of Ericson, George
Sent: Dienstag, 19. MÃrz 2019 21:39
To: OASIS Issues Tracker <
workgroup_mailer@lists.oasis-open.org >;
odata@lists.oasis-open.org Subject: RE: [odata] [OASIS Issue Tracker] (ODATA-1292) CSDL 7.2.1 Nullable: improve wording
I wish I was able to attend last week.
I don't agree with asserting that null is a value. Rather null is an indication,
when specified in schema, that a property or parameter supports not having value
when specified in a reply, that the property or parameter does not have a value
when specified in a request, that the property or parameter is to be set to have no value.
I suggest the following changes:
7.2.1 Nullable
A Boolean value specifies, in addition to values consistent with its type, a property or parameter should support not having a value .
specifying whether the property can have the value null.
Attribute Nullable
The value of
Nullable is one of the Boolean literals
true or false .
For single-valued properties the value true means that the property
or parameter supports not having a value . allows the null value.
For collection-valued properties the property
or parameter value
will always be a collection that MAY be empty of values consistent with its type . In this case the
Nullable attribute applies to items of the collection and specifies whether
individual items of the collection MAY
not have a value, as indicated by null .
contain null values.
If no value is specified for a single-valued property or parameter , the
Nullable attribute defaults to true.
In OData 4.01 responses a collection-valued property or parameter MUST either specify a value for the
Nullable
item attribute or MUST specify
null to indicate that the item has no value .
If no value is specified for a collection-valued property or parameter , the client cannot assume any default value. Clients SHOULD be prepared for this situation even in OData
4.01 responses.
George
-----Original Message-----
From:
odata@lists.oasis-open.org <
odata@lists.oasis-open.org > On Behalf Of OASIS Issues Tracker
Sent: 13 March, 2019 5:53 AM
To:
odata@lists.oasis-open.org Subject: [odata] [OASIS Issue Tracker] (ODATA-1292) CSDL 7.2.1 Nullable: improve wording
[EXTERNAL EMAIL]
Ralf Handl created ODATA-1292:
---------------------------------
Summary: CSDL 7.2.1 Nullable: improve wording
Key: ODATA-1292
URL:
https://issues.oasis-open.org/browse/ODATA-1292 Project: OASIS Open Data Protocol (OData) TC
Issue Type: Improvement
Components: CSDL JSON , CSDL XML
Affects Versions: V4.01_CS01
Reporter: Ralf Handl
Fix For: V4.01_CS02
The current text in section 7.2.1 Nullable is {quote}
7.2.1 Nullable
A Boolean value specifying whether a value is required for the property.
{quote}
This is misleading and suggests that the property can be omitted. Actually it only means that the property can be null.
--
This message was sent by Atlassian JIRA
(v7.7.2#77003)
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php