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-1109) Clarify that 'parameter' aliases can also be used to substitute expressions


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

Mark Biamonte commented on ODATA-1109:
--------------------------------------


Here is a contrived example of what I am thinking the issue with allowing expressions for parameters is.  Say I have a function that does the following

{code}
getCustomer(customerId) {

	var baseQuery = "myservice/customers?$filter=customer_id eq @p1"
	
	return doGet(baseQuery + "&@p1=" + customerId)
}
{code}

If I were to call this as

	getCustomer(123)

then the query executed would effectively be

	myservice/customers?$filter=customer_id eq 123

However what if this funtion where called as

	getCustomer("123 or 1 eq 1") 

in this case the query executed would effectively be

	myservice/customers?$filter=customer_id eq 123 or 1 eq 1

now the function is returning returning a list of all customers instead returning a single user.

Another example

	getCustomer("123&$expand='Contacts'")
	
here the effective query is

	myservice/customers?$filter=customer_id eq 123&$expand=Contacts
	
again the function is returning more than is expected.  In this case it is returning not only the customer info, but all of the info for all of the customer contacts.

if the parameter value was always interprated as a literal then the effective query for the second and third examples return an error because the values specified for the parameter were not literals.

> Clarify that 'parameter' aliases can also be used to substitute expressions
> ---------------------------------------------------------------------------
>
>                 Key: ODATA-1109
>                 URL: https://issues.oasis-open.org/browse/ODATA-1109
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: Protocol
>    Affects Versions: V4.01_CSD02
>            Reporter: Hubert Heijkers
>             Fix For: V4.01_CS01
>
>
> 11.2.6.1.3 Parameter Aliases specifies that "Parameter aliases allow the same value to be used multiple times in a request and may be used to reference primitive values, complex, or collection values" yet in both Example 67 and Example 79 we ourselves show that aliases can also be used to substitute expressions, something which my developers deem is against what's been specified in 11.2.6.1.3, hence the ask for clarification.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


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