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 to create annotations targeting a NavigationPropertyPath #2271

Open
chrisspre opened this issue Dec 7, 2021 · 3 comments
Open

Allow to create annotations targeting a NavigationPropertyPath #2271

chrisspre opened this issue Dec 7, 2021 · 3 comments
Labels

Comments

@chrisspre
Copy link
Contributor

chrisspre commented Dec 7, 2021

As of today, annotations are created by specifying the target in form of a IEdmVocabularyAnnotatable.
The types that implement IEdmVocabularyAnnotatable are all Model elements (e.g. EdmEntityType, EdmNavigationProperty, ... ). But the standard also allows to specify a NavigationPropertyPath (or any model path).
(this is different from specifying a Navigation property since the navigation property can be reached through multiple path).

OData CSDL 5.2 Annotations with External Targeting
OData CSDL 14.2.2
and https://issues.oasis-open.org/projects/ODATA/issues/ODATA-1416
describe the details from the perspective of the standard.

Assemblies affected

All versions of Microsoft.OData.Edm

@chrisspre
Copy link
Contributor Author

chrisspre commented Dec 7, 2021

A first attempt is here #2238 but requires deserialization, testing, and looking into "FindAnnotation"

@elize-vdr
Copy link
Contributor

Hello, we currently have a problem with Navigation Properties and I found this issue and I think it may be related. We run the OData demo contract they give for a tutorial on OData V4 here:
https://www.odata.org/getting-started/basic-tutorial/
and the metadata here:
https://services.odata.org/V4/(S(r1yqhlujv5seqfpwqz25rjjv))/TripPinServiceRW/$metadata

We then parse this with this .net OData library and get validation errors on the NavigationPropertyBinding that specifies a Path to a NavigationProperty in an EntityType, this should be valid according to latest ODATA, for example this is the kind of error we are getting: "(183, 12): A navigation property could not be found for the path 'Microsoft.OData.SampleService.Models.TripPin.Flight/Airline' starting from the type 'Microsoft.OData.SampleService.Models.TripPin.Person'."

This is quite a problem for us at present, we will very much appreciate it to know whether this issue shall address this problem we are facing, and whether we should raise another issue? And if it does address it, when is it planned for release please?

@gathogojr
Copy link
Contributor

Duplicate of #2724?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants