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] Commented: (ODATA-523) How do clients construct links from the context url for complex types?

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

Michael Pizzo commented on ODATA-523:

In applying this proposal, it seems a bit arbitrary and inconsistent to define a rule that applies to a single complex typed property and not to a primitive property or property that represents a collection of primitive or complex values.

We have a separate section for addressing an individual property, so we could define a context url for that pattern as follows:

10.13 Property Reference

Context URL template:
If a response represents an individual property, the context URL specifies the entity set and the name of the property.

Example 24: resource URL and corresponding context URL

The only other way to get a primitive value, or collection of primitive values, is as the result of an operation, and we already have a separate ContextURL section to cover that scenario.

We still need to figure out what to do about collections of entity types with navigation properties. There is simply no way to build links by convention for these, and it's unclear whether a service would be able to create links either. We could:
1) Prohibit collections of complex types that have navigation properties (at least for 4.1) but leave the pattern above as a general representation of single property addressing (since it solves the issue for single complex types with navigation properties).
2) Allow collections of complex types, but services must include a context url in each instance to serve as the base for constructing navigation links
3) Allow collections of complex types, but services must include any navigation links in the payload
4) Leave it up to the service whether they include a context url in each instance or expand all navigation links

If we really think services will be able to define a base URL for individual complex types within a collection we should do 4, otherwise we should probably do 1. In either case, we should probably have the above proposed context url pattern for individual property results to generalize addressing single complex properties with navigation links.

> How do clients construct links from the context url for complex types?
> ----------------------------------------------------------------------
>                 Key: ODATA-523
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-523
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData Protocol 
>    Affects Versions: V4.0_CS01
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>            Assignee: Michael Pizzo
>             Fix For: V4.0_CSD03
> Our current pattern for the context for a single complex types looks like this:
> {context-url}#{type-name}
> And a collection of complex types looks like this:
> {context-url}#Collection({type-name})
> However, in V4 we have add the ability for complex types to have relationships.Since one of the roles of the context is to provide the base for clients to construct links, how does the client compute relationship links using these context urls?
> For example, if I do ~Customers(1)/ns.Address, and Address has navigations to Country, how do represent that?
> Option 1: For complex types/collections of complex types, if there are navigation properties, you have to put the navigation links in the payload.
> Option 2: We modify the context url for single-valued complex properties to include the property path from the entity in the entity set:
> {context-url}/{entity-set}/$entity/{propertyName}
> For collection-valued complex properties and single- or collection-valued primitive properties we keep the current pattern. Collections of complex types MUST include links, as already stated in JSON section 8.1.

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]