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] Issue Comment Edited: (ODATA-398) Define "GetByID" canonical function as a path segment


    [ http://tools.oasis-open.org/issues/browse/ODATA-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33502#action_33502 ] 

Ralf Handl edited comment on ODATA-398 at 5/21/13 3:52 AM:
-----------------------------------------------------------

ODATA-394 already proposes a path segment /$all that addresses all entities in a service. 

Using this new resource path the query in this proposal can be expressed as

GET ~/$all/Northwind.Customer?$filter=$it eq {"odata.id":"http://myservice/Customers('ALFKI')"}&$select=CompanyName,ContactName&$expand=Orders

If we want to provide a convenience shortcut, we should introduce a special query option $id= which takes a plain id value without requiring any encoding beyond HTTP, so no redundant single quotes, and no OData-String encoding:

GET ~/$all/Northwind.Customer?$id=http://myservice/Customers('ALFKI')&$select=CompanyName,ContactName&$expand=Orders

We might want to replace /$all with the more specific /$entities.

      was (Author: ralfhandl):
    ODATA-394 already proposes a path segment /$all that addresses all entities in a service. 

Using this new resource path the query in this proposal can be expressed as

GET ~/$all/Northwind.Customer?$filter=$it eq {"odata.id":"http://myservice/Customers('ALFKI')"}&$select=CompanyName,ContactName&$expand=Orders

If we want to provide a convenience shortcut, we should introduce a special query option $id= which takes a plain id value without requiring any encoding beyond HTTP, so no redundant single quotes, and no OData-String encoding.

We might want to replace /$all with the more specific /$entities.
  
> Define "GetByID" canonical function as a path segment
> -----------------------------------------------------
>
>                 Key: ODATA-398
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-398
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData ABNF Construction Rules, OData Protocol , OData URL Conventions 
>    Affects Versions: V4.0_CSD01
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>             Fix For: V4.0_CSD02
>
>
> 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='.....'

-- 
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]