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] (ODATA-1026) Clarify when $it is required

    [ https://issues.oasis-open.org/browse/ODATA-1026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=64933#comment-64933 ] 

Michael Pizzo commented on ODATA-1026:

$it allows referencing the resource identified by the resource path. unqualified property references reference the current "scope". These may be the same thing in a simple request, but are not the same within a $expand (where an unqualified property reference references a property on the expanded nav prop). So in:
http://host/service/Customers?$expand=Orders($filter=$it/Address/City eq ShipTo/City) 
Address would refer to a property on a Customer and ShipTo would refer to a property on an Order.

$it is also used:
-when referencing the resource itself (not a property of the resource), and
-when invoking a function or action bound to the resource (to distinguish from an unbound action or function)

> Clarify when $it is required
> ----------------------------
>                 Key: ODATA-1026
>                 URL: https://issues.oasis-open.org/browse/ODATA-1026
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData URL Conventions
>    Affects Versions: V4.0_OS
>            Reporter: Matthew Borges
>            Priority: Minor
>             Fix For: V4.01_CSD02, V4.0_ERRATA04
> The description of $it says it CAN be used in a number of cases (see section in the URL conventions document) but it isn't specific about when $it MUST be used.  We should clarify when $it is required.  For example, my understanding is that both of these queries are equivalent (in which case the $it is not required):
> http://host/service/Customers?$filter=Orders/any(d:d/Quantity ge Age)
> vs.
> http://host/service/Customers?$filter=Orders/any(d:d/Quantity ge $it/Age)
> However, my understanding is that in the case below the $it is required:
> http://host/service/Customers?$expand=Orders($filter=$it/Address/City eq ShipTo/City)

This message was sent by Atlassian JIRA

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