-
Notifications
You must be signed in to change notification settings - Fork 81
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
Non-nullable restrictions on entity sets or navigation property paths #322
Comments
There should be a way to specify that the support of things like top/skip are unspecified at the navigationpropertyrestrictions, in which case the specification on the entity set (if any) applies -- and if not, the default is taken (as specified on the entityset). This could be facilitated by making top/skip (etc.) nullable, and with no default, in the navigation property restrictions. |
In the example, the absence of odata-openapi/tools/tests/annotations.xml Lines 501 to 502 in 0b4afb4
OData services generated by SAP omit SAP has entity set and entity type in 1:1 correspondence and capabilities are maintained per "entity". It is therefore not possible to support |
The current semantics of the vocabulary are well defined, but don't allow specifying navigation property restrictions without saying anything about support of things like top and skip. The openapi generation tool semantics are different -- it assumes absence of top/skip in nav prop restrictions defers to the bound entity set. We could:
Option 1 has potential breaking change side-effects (existing customers not expecting to get back a null value, or understanding how to interpret it). Option 2 has the potential of changing the openapi generated for existing services that had different annotations for the navigation property binding and for entity set. This would not apply to SAP (which uses the same annotation in both places), but could affect other services. Such services (one that specified a navigation property restriction but did not specify top/skip in navigation property restrictions and annotated the table with false) would have to update their navigation property restriction to explicitly specify false for top/skip. Option 3 would be to keep the existing defined semantics, but have the tool continue to generate using the current semantics. |
Plan is to do option 2 (fix the tool to comply with defined vocabulary defaults) and seek community input from the behavior. |
Restrictions for a resource path are
Capabilities.NavigationRestrictions/RestrictedProperties/…Restrictions
if the resource path contains a navigation property pathCapabilities.…Restrictions
of the entity set or target path specified in aNavigationPropertyBinding
for the resource path if no restrictions exist in step 1.But
TopSupported
andSkipSupported
are no…Restrictions
in the sense of this rule because they are not nullable, hence automatically present as soon as there areCapabilities.NavigationRestrictions/RestrictedProperties
for the navigation property path in question.Hence the resource path
/ReadOnlySingleton/ReadOnlyMany
has bothTopSupported
andSkipSupported
by default because the annotation found in step 1 does not contain these properties:odata-openapi/tools/tests/annotations.xml
Lines 307 to 314 in 0b4afb4
But the OpenAPI description lacks the parameters
top
andskip
:odata-openapi/tools/tests/annotations.openapi3.json
Lines 1977 to 1984 in 0b4afb4
The text was updated successfully, but these errors were encountered: