-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_CSD01
-
Fix Version/s: V4.0_CSD02
-
Component/s: ABNF, Protocol, URL Conventions
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
Ids are the primary way to reference an instance in OData; they are used in relationships, in deltas, and can take the place of instances in payloads. We recommend, but do not require that ids be dereferenceable.
Clients need a dependable way to get from an id to a reference, whether or not the reference is dereferencable. Although they could construct a query if they know the root set the id comes from, it would be useful and more discoverable to introduce a canonical query function, at the service root, for returning an instance given its id.
Note that, since the id is likely to contain illegal characters, we have to pass the id as a query option, and will need to double single quotes in reference
Options:
GET ~myservice/getbyid(@id)?@id='.....'
GET ~myservice/$getbyid?@id='.....'