Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow index segments in path expressions #342

Open
ralfhandl opened this issue Mar 20, 2024 · 0 comments · May be fixed by oasis-tcs/odata-abnf#61 or oasis-tcs/odata-abnf#59
Open

Allow index segments in path expressions #342

ralfhandl opened this issue Mar 20, 2024 · 0 comments · May be fixed by oasis-tcs/odata-abnf#61 or oasis-tcs/odata-abnf#59
Assignees
Labels
ABNF URL Conventions URL Conventions V4.03 Too vague or controversial for 4.02

Comments

@ralfhandl
Copy link
Contributor

ralfhandl commented Mar 20, 2024

OData already allows numeric index segments for ordered collections in the path part of the URL, see ODATA-820.

Allow this also in Path Expressions:

GET Entries?$expand=components($orderby=name))&$orderby=components/0/name

Note: the index in $orderby is evaluated on the implicit server-defined order of the components as $orderby has to be evaluated before $expand. This is somewhat counter-intuitive and could be remedied by further extending the path syntax to e.g.

$orderby=components($orderby=name)/0/name

With that however it would be more "natural" to use a nested $index option instead of an index segment:

$orderby=components($orderby=name;$index=0)/name

Proposal

Two alternatives:

Imported from ODATA-1506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABNF URL Conventions URL Conventions V4.03 Too vague or controversial for 4.02
Projects
Status: No status
1 participant