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] Updated: (ODATA-532) Clarify whether collections can contain null values

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

Michael Pizzo updated ODATA-532:

    Environment: [Applied]  (was: [Proposed])

Added verbage to [ATOM], [JSON], and [CSDL]. In [CSDL] called out that services may, but were not required to, support null values in collections, but that clients should always be prepared to deal with them.

Note that we currently disallow the specification of nullable for collection-valued properties (since the collection is never null). We could allow it, and define it to mean that the values within the collection may or may not be null, in order to allow the service to give the client knowledge about whether or not the collection can contain nulls (especially useful for update).

> Clarify whether collections can contain null values
> ---------------------------------------------------
>                 Key: ODATA-532
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-532
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData ATOM Format , OData CSDL, OData JSON Format, OData Protocol 
>    Affects Versions: V4.0_CS01
>         Environment: [Applied]
>            Reporter: Michael Pizzo
>            Assignee: Michael Pizzo
>             Fix For: V4.0_CSD03
> OData V3 clearly prohibited collections from containing null values.
> In OData V4 we are not as clear. The Atom format specifically prohibits the metadata:null attribute on <element> elements, so we have said you can't have null values in Atom. We don't have the similar restriction in JSON.
> There may be scenarios in applying annotations where a collection ends up containing a null value. i.e., 
>                 <Collection>
>                                 <Path>BillingAddress</Path>
>                                 <Path>ShippingAddress</Path>
>                 </Collection>
> Could result in a null value within the collection if BillingAddress is null.. 
> We do not have a way to say whether or not an instance of a collection could contain null values (i.e., collection(Edm.Int32 nullable=true), nor would I propose we add one unless we think it is important for some clients to support nulls in collections but unreasonable for some services to support.
> Option 1: Clarify that an atom/json payload may contain null values, but don't support nulls in collection valued properties until 4.1.
> Option 2: Clarify that an atom/json payload may ALWAYS contain null values, include for collection valued properties.
> Also, while we're at it, there was some confusion as to whether properties in atom whose value is null but whose underlying type was not string still needed the metadata:type attribute. The answer is yes; no-string primitive properties in Atom always need the metadata:type attribute, even if their value is null. The same rule applies to JSON with full metadata.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


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