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

Context URL of single-valued containment navigation property #2000

Open
ralfhandl opened this issue Sep 24, 2024 · 5 comments · May be fixed by #2009
Open

Context URL of single-valued containment navigation property #2000

ralfhandl opened this issue Sep 24, 2024 · 5 comments · May be fixed by #2009
Assignees
Labels
Protocol Protocol, URL Conventions

Comments

@ralfhandl
Copy link
Contributor

Section 10.3 Entity states that

Context URL template:
{context-url}#{entity-set}/$entity

and

If the entity is contained, then entity-set is the top-level entity set or singleton followed by the path to the containment navigation property of the containing entity.

Is the suffix /$entity only relevant for collection-valued containment, or also for single-valued containment?

Clarify and add single-valued example.

@ralfhandl ralfhandl added the Protocol Protocol, URL Conventions label Sep 24, 2024
@HeikoTheissen
Copy link
Contributor

Is the suffix /$entity only relevant for collection-valued containment, or also for single-valued containment?

Also for single-valued containment. The suffix is omitted for singletons, but these are always top-level in the container. A single-valued containment navigation property contains a single entity, not a singleton.

(By contrast, a non-containment navigation property can target a singleton through a suitable navigation property binding.)

@ralfhandl
Copy link
Contributor Author

ralfhandl commented Sep 25, 2024

I disagree: a singleton is basically a single-valued containment navigation property of the entity container.

They behave the same in all other aspects, why should their context URL behave differently?

@HeikoTheissen
Copy link
Contributor

HeikoTheissen commented Sep 25, 2024

They behave the same in all other aspects, why should their context URL behave differently?

Because [OData-CSDL, section 13.3] says:

Singletons are top-level single-valued resources.

Perhaps change that?

@ralfhandl
Copy link
Contributor Author

That statement is correct. And single-valued containment navigation properties are nested single-valued resources.

So rather clarify the section on context URL and use the service-relative path of the single-valued resource as its context URL, consistently without the suffix /$entity.

@ralfhandl
Copy link
Contributor Author

@mikepizzo and @Hubert-Heijkers would expect same treatment as singletons, without suffix /$entity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Protocol Protocol, URL Conventions
Projects
Status: Review
Development

Successfully merging a pull request may close this issue.

2 participants