microsoftgraph / msgraph-metadata

Microsoft Graph metadata captured and used for generating client library code files.
https://graph.microsoft.com
MIT License
101 stars 29 forks source link

what is authoritative URL with annotations for graph v1.0 metadata? #609

Open davidmoten opened 5 months ago

davidmoten commented 5 months ago

I'd like to use the annotated form of the official msgraph v1.0 metadata so that it contains property annotations like

<NavigationProperty Name="singleValueExtendedProperties" Type="Collection(graph.singleValueLegacyExtendedProperty)" ContainsTarget="true">
  <Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
    <Record>
      <PropertyValue Property="Navigability">
        <EnumMember>Org.OData.Capabilities.V1.NavigationType/None</EnumMember>
      </PropertyValue>
    </Record>
  </Annotation>
</NavigationProperty>

I currently use https://graph.microsoft.com/v1.0/$metadata?$format=xml. Why does it not contain these property annotations (present in transformed_v1.0_metadata.xml)? Is there another URL I should be using to get this information with production status?

andrueastman commented 5 months ago

Thank for raising this @davidmoten

For context, The API owners at the moment push this file to this repo that is annotated (which should be similar to the https://graph.microsoft.com/v1.0/$metadata?$format=xml endpoint)

https://github.com/microsoftgraph/msgraph-metadata/blob/master/schemas/annotated-v1.0-Prod.csdl

However, for client SDK generation scenarios, we have issues reported such as

So, we use the transform located below to unlock these client scenarios as the API owners work to improve their metadata. https://github.com/microsoftgraph/msgraph-metadata/blob/master/transforms/csdl/preprocess_csdl.xsl

This in turn generates the metadata at the link below used for SDK generation.

https://github.com/microsoftgraph/msgraph-metadata/blob/master/clean_v10_metadata/cleanMetadataWithDescriptionsAndAnnotationsv1.0.xml

Hope this is helpful.

davidmoten commented 5 months ago

Thanks @andrueastman, that is helpful. I'll probably try the last url you gave for my code generation purposes too.

One question still stands though, which is what is the status of that file at any one time? I wouldn't normally assume that a file on master branch is production ready and I see no use of releases/tags.