You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey.
I was trying to set up my query client with the auto generator and noticed that the generated ApiArg types are not following the OpenAPI specs for overriding path-level parameters. At least not how I would expect them to.
A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
paths:
/users/{id}:
parameters:
- in: pathname: idtype: integerrequired: truedescription: The user ID.# DELETE /users/{id} - uses a single ID.# Reuses the {id} parameter definition from the path level.delete:
summary: Deletes the user with the specified ID.responses:
'204':
description: User was deleted.# GET /users/id1,id2,id3 - uses one or more user IDs.# Overrides the path-level {id} parameter.get:
summary: Gets one or more users by ID.parameters:
- in: pathname: idrequired: truedescription: A comma-separated list of user IDs.type: arrayitems:
type: integerminItems: 1responses:
'200':
description: OK
Which results in the generated ApiArgs
exporttypeDeleteUsersByIdApiArg={/** The user ID. */id: number;};exporttypeGetUsersByIdApiArg={/** The user ID. */pathId: number;/** A comma-separated list of user IDs. */_pathId: number[];};
It looks good when not overriding the path-level parameter, but overriding the parameter at operation-level, the generated id path-level parameter is now present twice - as both types.
Both of these different parameters then has to be provided in the hooks, which seems odd and makes the querying quite confusing. Is this intended?
I would expect the generated ApiArgs to match those of the OpenAPI specs and only require the overriding parameter. Like we see in the swagger UI, only requiring operation-level parameter.
Any clarification would be appreciated, thanks.
The text was updated successfully, but these errors were encountered:
Hey.
I was trying to set up my query client with the auto generator and noticed that the generated
ApiArg
types are not following the OpenAPI specs for overriding path-level parameters. At least not how I would expect them to.From the OpenAPI specs on operation object parameters: https://spec.openapis.org/oas/latest.html#operation-object
An OpenAPI spec example of this from https://swagger.io/docs/specification/describing-parameters/
Which results in the generated
ApiArgs
It looks good when not overriding the path-level parameter, but overriding the parameter at operation-level, the generated
id
path-level parameter is now present twice - as both types.Both of these different parameters then has to be provided in the hooks, which seems odd and makes the querying quite confusing. Is this intended?
I would expect the generated
ApiArgs
to match those of the OpenAPI specs and only require the overriding parameter. Like we see in the swagger UI, only requiring operation-level parameter.Any clarification would be appreciated, thanks.
The text was updated successfully, but these errors were encountered: