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

TopSupported and SkipSupported non-nullable with DefaultValue="true" #323

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

HeikoTheissen
Copy link
Contributor

@HeikoTheissen HeikoTheissen commented Jan 23, 2025

Fixes #322

Assume an entity set of singleton $S$ with a non-containment navigation property $p$ and a navigation property binding of $S/p$ to the entity set or singleton $T$.

If $S$ is annotated with Capabilities.NavigationRestrictions/RestrictedProperties annotation with NavigationProperty${}=p$ but without TopSupported, the default value TopSupported=true is implied and hence the resource path $S/p$ supports $top, regardless of any annotation Capabilities.TopSupported on $T$. Analogous for SkipSupported.

The V4-CSDL-to-OpenAPI.xsl tool currently behaves differently: In the absence of Capabilities.NavigationRestrictions/RestrictedProperties/TopSupported on $S$ it evaluates Capabilities.TopSupported on $T$, ignoring the default value.

This PR corrects the behavior of the tool. The correction results in additional parameters

{"$ref": "#/parameters/top"},
{"$ref": "#/parameters/skip"}

in some of the examples.

@ralfhandl
Copy link
Contributor

@HeikoTheissen Do you want to make the same change to the JavaScript version of the tool?

@ralfhandl
Copy link
Contributor

One more thing: please bump the package version via command

npm version minor

and add an entry to the changelog.

Co-authored-by: Ralf Handl <[email protected]>
@mikepizzo mikepizzo merged commit 11737b2 into main Jan 29, 2025
2 checks passed
@mikepizzo mikepizzo deleted the 322/top-skip branch January 29, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-nullable restrictions on entity sets or navigation property paths
3 participants