-
Notifications
You must be signed in to change notification settings - Fork 62
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
functions with parameters that are collection are poorly converted #122
Comments
@baywet |
OData allows function parameters to be passed directly in the last path segment, or in the query string via an alias. So,
and
are functionally equivalent.
Sadly the example in our case makes it impossible to tell how the list of Ids is expected to be formatted. https://docs.microsoft.com/en-us/graph/api/intune-shared-devicemanagement-getrolescopetagsbyids?view=graph-rest-beta#request This appears to be some mixed hybrid with something inside the string value.
As far as Graph is concerned, the first OpenAPI is how I expected Graph APIs to work. The second one does accurately describe the aliasing, although the parameter should be @ids and having the type as string is not correct. Whether it should be array of string, or object us unknown because the getRoleScopeTagsByIds docs are unclear. We should do a survey of Graph APIs that accept lists of ids and see what syntax is actually being used. |
thanks for the additional information here. This is only used once in beta today. |
According to OData the type should serialized as JSON which we use But what OData says, and what a specific Graph API does are two different things. |
I was wrong about using the deepObject. Instead we use a content property and a media type object to indicate that the ids are serialized as JSON. /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
content:
application/json:
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 |
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
(taken from latest beta full description)
Expected result
(note the parameter type, and the parameter in the path)
Actual result
Additional detail
*Optional, details of the root cause if known.
The text was updated successfully, but these errors were encountered: