Skip to content

functions with parameters that are collection are poorly converted #122

Closed
@baywet

Description

@baywet

If a function has a parameter of type Collection(Something), the path will be wrong in the resulting OpenAPI description.

Assemblies affected

latest

Steps to reproduce

<Function Name="getRoleScopeTagsByIds" IsBound="true">
        <Parameter Name="bindingParameter" Type="graph.deviceManagement" />
        <Parameter Name="ids" Type="Collection(Edm.String)" Unicode="false" />
        <ReturnType Type="Collection(graph.roleScopeTag)" />
      </Function>

(taken from latest beta full description)

Expected result

/deviceManagement/microsoft.graph.getRoleScopeTagsByIds(ids='{ids}'):
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getRoleScopeTagsByIds
      operationId: deviceManagement.getRoleScopeTagsByIds
      parameters:
        - name: ids
          in: query
          description: 'Usage: ids={ids}'
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  anyOf:
                    - $ref: '#/components/schemas/microsoft.graph.roleScopeTag'
                  nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

(note the parameter type, and the parameter in the path)

Actual result

/deviceManagement/microsoft.graph.getRoleScopeTagsByIds(ids=@ids):
    get:
      tags:
        - deviceManagement.Functions
      summary: Invoke function getRoleScopeTagsByIds
      operationId: deviceManagement.getRoleScopeTagsByIds
      parameters:
        - name: ids
          in: query
          description: 'Usage: ids={ids}'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  anyOf:
                    - $ref: '#/components/schemas/microsoft.graph.roleScopeTag'
                  nullable: true
        default:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: function

Additional detail

*Optional, details of the root cause if known.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions