OpenAPI.NET.OData
OpenAPI.NET.OData copied to clipboard
New $count endpoints in OpenAPI missing parameters
Short summary (3-5 sentences) describing the issue.
Some endpoint paths e.g. /users require the ConsistencyLevel header defined. This is shown by having the header added in the operation parameters as shown below:
The new $count endpoints e.g. /users/$count don't have the parameters defined in the OpenAPI schema file:

Assemblies affected
Which assemblies and versions are known to be affected? Unknown, but the openapi file generated in commit microsoftgraph/msgraph-metadata@e7568c69 is affected
Steps to reproduce
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Expected result
What would happen if there wasn't a bug.
The $count endpoints should list the required headers like ConsistencyLevel in the schema
Actual result
What is actually happening. There is no header parameter in the schema
Additional detail
*Optional, details of the root cause if known.
considering the entity set has an annotation to indicate the header is present, it should propagate to the raw count endpoint.
now the question is: should it propagate to OData type cast path segments as well? navigation properties? the index endpoint users/id ? If so for which operations? ping @darrelmiller to bring clarity on this.
<Annotations Target="microsoft.graph.GraphService/directoryObjects">
<Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
<Record>
<PropertyValue Property="CustomHeaders">
<Collection>
<Record>
<PropertyValue Property="Name" String="ConsistencyLevel" />
<PropertyValue Property="Description" String="Indicates the requested consistency level." />
<PropertyValue Property="DocumentationURL" String="https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/" />
<PropertyValue Property="Required" Bool="false" />
<PropertyValue Property="ExampleValues">
<Collection>
<Record>
<PropertyValue Property="Value" String="eventual" />
<PropertyValue Property="Description" String="$search and $count queries require the client to set the ConsistencyLevel HTTP header to 'eventual'." />
</Record>
</Collection>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
Currently AGS strips off the ReadRestrictions that are added by the workload team and we add them back manually in the XSLT. The Identity Graph team are currently implementing a mechanism to allow us to access the unfiltered metadata which will give us all of these annotations without us having to manually add them back. We should wait until this work is done, rather than updating the XSLT.
and to clarify, we shouldn't either propagate that information automatically?
Reviving this as it affects https://github.com/microsoftgraph/msgraph-metadata/issues/185.
To @baywet's question, should we propagate the header to OData type cast path segments, navigation properties, and index endpoint? I would say yes since this is how the the header is used. See AAD advanced queries. I have a branch in the metadata repo that adds the header to supported navigation properties via XSLT. The supported navigation properties are extracted from AAD advanced queries.
@darrelmiller, the metadata with ReadRestrictions from AGS does not currently have the header applied to supported navigation properties. This will need to be added by the workload to fix https://github.com/microsoftgraph/msgraph-metadata/issues/185 if we are to use AGS's metadata.
Thanks. But then the propagation should be limited to get opérations, correct?
@peombwa We should go and ask Luca to add the metadata for those navigation properties and we need to update the metadata processing scripts to use the new metadata instead of the $metadata endpoint.
@baywet The new metadata in the schemas folder is unfiltered. I don't know what other capability annotations AGS was previously removing. I only know for sure about ReadRestrictions.
@timayabi2020 what's the rationale behind closing this?
@baywet apologies I might have closed it by mistake from the powershell project board.
Dependent on this issue https://github.com/microsoftgraph/msgraph-metadata/issues/203