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

Multiple Verbs in OperationIds for OData Cast Paths That Call /$count #382

Closed
peombwa opened this issue May 10, 2023 · 1 comment
Closed
Assignees
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:bug A broken experience
Milestone

Comments

@peombwa
Copy link
Contributor

peombwa commented May 10, 2023

OData cast paths that call /$count have multiple verbs in their OperationIds. This leads to naming inconsistencies when generating SDKs based on OperationIds. For example:

'/servicePrincipals/{servicePrincipal-id}/transitiveMemberOf/graph.administrativeUnit/$count':
  get:
    operationId: servicePrincipals.ListTransitiveMemberOf.GetCount.AsAdministrativeUnit-4450 # List and Get are present.
    parameters:
      - name: ConsistencyLevel
        in: header
    responses:
      2XX:
        $ref: '#/components/responses/ODataCountResponse'

vs

'/servicePrincipals/{servicePrincipal-id}/transitiveMemberOf/$count':
  get:
    operationId: servicePrincipals.transitiveMemberOf.GetCount-4794 # Only Get is present
    parameters:
      - name: ConsistencyLevel
        in: header
    responses:
      2XX:
        $ref: '#/components/responses/ODataCountResponse'

Assemblies affected

Microsoft.OpenApi.OData v1.4.0

Steps to reproduce

Inspect converted OpenAPI document at https://github.com/microsoftgraph/msgraph-metadata/tree/master/openapi/v1.0.

Expected result

'/servicePrincipals/{servicePrincipal-id}/transitiveMemberOf/graph.administrativeUnit/$count':
  get:
    operationId: servicePrincipals.TransitiveMemberOf.GetCount.AsAdministrativeUnit-4450 # Only Get should be present.
    parameters:
      - name: ConsistencyLevel
        in: header
    responses:
      2XX:
        $ref: '#/components/responses/ODataCountResponse'

Additional Notes:

operation.OperationId = $"{EdmModelHelper.GenerateODataTypeCastPathOperationIdPrefix(Path)}.GetCount.As{Utils.UpperFirstChar(targetStructuredType.Name)}-{Path.GetPathHash(Context.Settings)}";

@irvinesunday irvinesunday self-assigned this May 16, 2023
@irvinesunday irvinesunday added the type:bug A broken experience label May 16, 2023
@irvinesunday irvinesunday added this to the OData: 1.5 milestone May 16, 2023
@irvinesunday irvinesunday added the priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days label May 17, 2023
@irvinesunday
Copy link
Collaborator

Resolved by #386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants