microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

$count in resource explorer seems to put wrong url

Open ddyett opened this issue 2 years ago • 7 comments

Open Resource Explorer tab Expand the drives path Click $count

Result: url placed is https://graph.microsoft.com/v1.0/drives/$count which doesn't work as it's not a drive id.

Expectation

https://graph.microsoft.com/v1.0/drives?$count

ddyett avatar Mar 29 '23 04:03 ddyett

We use CountRestrictions annotations to determine whether or not to add the $count segments to paths. If this is not specified in the CSDL, it defaults to true --> add the $count segment.

irvinesunday avatar Mar 29 '23 15:03 irvinesunday

Should we add this as a setting when generating the document?

thewahome avatar Mar 29 '23 15:03 thewahome

No, this should be added to the CSDL by the respective workload teams or by us via XSLT. The annotation would look like:

<Annotations Target="microsoft.graph.GraphService/drives">
  <Annotation Term="Org.OData.Capabilities.V1.CountRestrictions">
    <Record>
      <PropertyValue Property="Countable" Bool="false" />
    </Record>
  </Annotation>
</Annotations>

irvinesunday avatar Mar 29 '23 15:03 irvinesunday

@irvinesunday should we close this or move it to another repo?

thewahome avatar Nov 07 '23 09:11 thewahome

<Annotations Target="microsoft.graph.GraphService/drives

@thewahome this was resolved in the metadata. You can close it if you can confirm that it is resolved in GE

image

irvinesunday avatar May 29 '24 11:05 irvinesunday

@irvinesunday is this rolled out for all endpoints that support $count? I can still reproduce it on endpoints like /application, /chats etc

musale avatar May 31 '24 10:05 musale

@irvinesunday is this rolled out for all endpoints that support $count? I can still reproduce it on endpoints like /application, /chats etc

@musale unfortunately this can only be currently addressed on a need basis. It might be hard to anticipate all the resources that don't support /$count. Ideally, workloads need to explicitly annotate their resources in the metadata to indicate support or otherwise for such operations/paths. The conversion library automatically assumes support (and hence generates the paths) unless explicitly annotated otherwise in the metadata. We are are trying to resolve this by getting workload owners to move to using Typespec as their API definition language. Typespec requires explicit annotations definitions.

irvinesunday avatar Jun 03 '24 08:06 irvinesunday