-
Notifications
You must be signed in to change notification settings - Fork 351
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
Referenced external permissions annotations don't reflect in main EDM model #1936
Comments
@irvinesunday <edmx:Reference Uri=".../cleanMetadataWithDescriptionsv1.0.xml">
<edmx:Include Namespace="microsoft.graph" />
</edmx:Reference> In this case your Now on to your main request. While working on making the annotations in the referenced model available in the main model's If you want to access elements from a referenced model you'd need to get the referenced model directly from In the case of vocabulary annotations however there still exists a feature gap/bug. The referenced model does not include its own out-of-line annotations. E.g. What do you think @mikepizzo @g2mula ? |
Actually, the microsoft.graph model needs to reference the external document that contains the annotations, specifying the namespaces from which to IncludeAnnotations, as per @irvinesunday's example. And, for those references to be valid, the referenced schema needs to include a reference to the microsoft.graph namespace as per @habbes's example. To @habbes comment on searching across models, the pattern is that the FindDeclaredXYZ() methods search only the current model, while he FindXYZ() methods search across models (and use the FindDeclaredXYZ() for each model). So, myModel.FindDeclaredVocabularyAnnotations(...) should only find annotations on myModel, while myModel.FindVocabularyAnnotations(...) should find annotations in myModel and within the namespaces of referenced models as specified by IncludeAnnotations(). |
@mikepizzo thanks for the clarifications. I have a made a PR that makes the annotations in referenced models accessible via However, it seems the issue with the target type of the annotation not being properly resolved still persists even when you have a reference to the main document from inside the referenced permission document. And out of curiosity, is this kind of cyclic references supported by OData? |
Using this notation in the main XML document to reference an external permissions annotation XML document does not seem to surface the referenced permissions annotations in the main
EdmModel
object.Main XML file: https://raw.githubusercontent.com/irvinesunday/msgraph-metadata/master/clean_v10_metadata/cleanMetadataWithDescriptionsv1.0.xml
Referenced XML file (with permissions annotations): https://raw.githubusercontent.com/irvinesunday/msgraph-metadata/master/scopes_metadata/apiPermissionsAndScopes-v1.0.xml
Assemblies affected
Microsoft.OData.Edm
, Version=7.6.1.0Reproduce steps
Below is the .NET code for parsing an
EdmModel
from a CSDL (including any referenced XML in the referencing XML document)Expected result
The
EdmModel.VocabularyAnnotations
property should contain the collection of vocabulary annotations that are contained in both the referencing and referenced models.Actual result
The
EdmModel.VocabularyAnnotations
property does not contain the collection of vocabulary annotations that are contained in the referenced model.The text was updated successfully, but these errors were encountered: