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-1025) Treatment of same query option in multiple "spellings"


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

Stefan Hagen commented on ODATA-1025:
-------------------------------------

For "What if it contains top=5&TOP=10?" I would rule out any order based resolution, as the "host language of the server processing the query options" may already have scrambled the order in the offered hash/dict/map the parsed query key-value pairs are offered to the application level language. 

I do not think, that we should resolve by enforcing the implementers to reparse the full quer string on the OData implementation level (but be able to choose).

Samples (Misc. Python versions and one JavaScript):

$ python3.6  # preserving insert order
Python 3.6.0 (default, Jan  3 2017, 14:20:13) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> kw = dict(top=5, TOP=10); print(kw)
{'top': 5, 'TOP': 10}
>>> kw = dict(TOP=10, top=5); print(kw)
{'TOP': 10, 'top': 5}
>>> 

$ python2  # mojo mix in first come, first serve if hash would select same slot in dict
Python 2.7.13 (default, Jan  3 2017, 14:24:12) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> kw = dict(top=5, TOP=10); print kw
{'TOP': 10, 'top': 5}
>>> kw = dict(TOP=10, top=5); print kw
{'top': 5, 'TOP': 10}
>>> 

$ python3.5  # not respect insert order, but tries to be more stable than v2
Python 3.5.2 (default, Oct 10 2016, 11:40:35) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> kw = dict(top=5, TOP=10); print(kw)
{'TOP': 10, 'top': 5}
>>> kw = dict(TOP=10, top=5); print(kw)
{'TOP': 10, 'top': 5}
>>> 

$ phantomjs  # no insert order conserved
phantomjs> "use strict"; var kw = { top:5, TOP:10}; kw;
{
   "TOP": 10,
   "top": 5
}
phantomjs> kw = { TOP:10, top:5};
{
   "TOP": 10,
   "top": 5
}


> Treatment of same query option in multiple "spellings"
> ------------------------------------------------------
>
>                 Key: ODATA-1025
>                 URL: https://issues.oasis-open.org/browse/ODATA-1025
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData URL Conventions
>    Affects Versions: V4.01_CSD01
>            Reporter: Ralf Handl
>             Fix For: V4.01_CSD02
>
>
> V4.01 allows to omit the $ prefix for system query options and makes the query option name case-insensitive.
> How should servers react if a request contains e.g. $top=5&Top=10
> Should the request be rejected as the same (logical) query option appears twice, or should it succeed and $top is preferred over Top?
> What if it contains top=5&TOP=10?



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