microsoftgraph / msgraph-metadata

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

Incorrect Success Response in deviceManagement.Functions #80

Closed georgend closed 1 year ago

georgend commented 3 years ago

The OpenAPI Document Lists the Response for the following endpoint as shown below:-

/deviceManagement/virtualEndpoint/auditEvents/microsoft.graph.getAuditActivityTypes():
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getAuditActivityTypes
      operationId: deviceManagement.virtualEndpoint.auditEvents.getAuditActivityTypes
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

However, the API returns the following format:-

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(Edm.String)",
    "value": [
        "*"
    ]
}

As such the above OpenAPI Doc should be changed to:-

  /deviceManagement/virtualEndpoint/auditEvents/microsoft.graph.getAuditActivityTypes():
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getAuditActivityTypes
      operationId: deviceManagement.virtualEndpoint.auditEvents_getAuditActivityTypes
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                   type: array
                   items:
                     type: string
                     nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

This issue also affects getEffectivePermissions

The associated metadata:- meta

AB#10213

peombwa commented 3 years ago

This issue is already open here https://github.com/microsoftgraph/microsoft-graph-devx-api/issues/307.

peombwa commented 1 year ago

Was fixed by https://github.com/microsoft/OpenAPI.NET.OData/issues/116.