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

Clarify representation of context URLs in JSON payloads #368

Closed
ralfhandl opened this issue Mar 20, 2024 · 0 comments · Fixed by #204 or oasis-tcs/odata-abnf#106
Closed

Clarify representation of context URLs in JSON payloads #368

ralfhandl opened this issue Mar 20, 2024 · 0 comments · Fixed by #204 or oasis-tcs/odata-abnf#106
Assignees
Labels

Comments

@ralfhandl
Copy link
Contributor

Context URLs may include characters outside of the unreserved set, e.g. a '(', ')', '/' like for a collection of entities reached via a path to a containment navigation property: "$metadata#set('<key_value>')/cont_nav_prop"

Some implementations return such a context URL in a JSON payload with percent-encoded '(', ')', '/', e.g. "$metadata#set%28'<key_value>'%29%2Fcont_nav_prop", others return it with plain characters.

Question is if servers are free to choose the representation of context URLs and service consumers must be prepared to do a percent-decoding before interpreting the context URL

References:

  • The JSON Format specification in section 4.3 Relative URLs mention colons inside the path part that must be percent-encoded
  • The ABNF includes a statement for the grammar on the necessity of a percent-decoding a URL before parsing it. Shall this rule also be applied for URLs in JSON payloads?

Proposal

Context URLs for contained entities MUST use parenthesis-style keys.

Context URL fragments MUST NOT be percent-encoded, not even key values for contained entities.

Imported from ODATA-1583

@ralfhandl ralfhandl self-assigned this Mar 20, 2024
@HeikoTheissen HeikoTheissen modified the milestone: 4.02 Mar 22, 2024
@ralfhandl ralfhandl mentioned this issue Apr 23, 2024
1 task
@ralfhandl ralfhandl moved this to Open in OData TC Apr 23, 2024
@HeikoTheissen HeikoTheissen linked a pull request May 15, 2024 that will close this issue
@ralfhandl ralfhandl moved this from Open to Resolved in OData TC May 15, 2024
@ralfhandl ralfhandl moved this from Resolved to Review in OData TC May 16, 2024
ralfhandl added a commit that referenced this issue May 22, 2024
Resolves https://issues.oasis-open.org/browse/ODATA-1583

Fixes #368

- [x] Changes from Earlier Versions
@github-project-automation github-project-automation bot moved this from Review to Closed in OData TC May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants