-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_CSD01
-
Fix Version/s: V4.0_CSD02
-
Component/s: ATOM Format, JSON Format, Protocol
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
We currently use different representations for empty values.
The consistent cases are:
- empty collections of primitive values, complex values, and entities are represented with 200 OK and the format-specific representation of an empty collection of the appropriate type (<m:value/>, <atom:feed/>,
{"value":[]}
)
- empty primitive values in Atom and JSON are represented with 200 OK and the format-specific representation of a null value (<m:value m:null="true"/> or
{"value":null}
)
- empty complex values in Atom are represented with 200 OK and the Atom representation of a null value (<m:value m:null="true"/>)
The exceptions are:
- empty single entity is currently represented with 204 No Content
- empty complex property is represented with 200 OK and a special NULL payload in JSON (
{"odata.metadata": "http://host/service/$metadata#Edm.Null"}
)
The first exception is because an atom:entry cannot be empty, the second is because we wanted to represent complex type instances as JSON objects without a
{"value:...}wrapper and thus need a special representation of an "unwrapped null value".
Also when we try to index an entity set by key, as in ~Customers('nonexistentkey') we currently return 404 NOT Found. This is particularly strange when you consider containment, because the canonical URL (which we say returns 404 NOT FOUND if the item doesn't exist) is the navigation link (which we say returns 204 no content if the item doesn't exist).