We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
Using $ref in the parameters section does not generate the type correctly
$ref
OpenAPI
{ "openapi": "3.0.3", "info": { "title": "", "version": "" }, "paths": { "/get": { "parameters": [ { "$ref": "#/components/parameters/limit" } ] } }, "components": { "parameters": { "limit": { "required": true, "in": "query", "name": "limit", "schema": { "type": "number" } } } } }
Generated TS
export interface paths { "/get": { }; } export interface components { schemas: never; responses: never; parameters: { limit: number; }; requestBodies: never; headers: never; pathItems: never; }
*Expected TS
export interface paths { "/get": { parameters: { query: { limit: components['parameters']['limit'] } } }; }
Checklist
The text was updated successfully, but these errors were encountered:
I think that the problem could be in this part of the code https://github.com/drwpow/openapi-typescript/blob/main/src/transform/operation-object.ts#L72-L74
This is expecting paramIn to be part of the ref like components["parameters"]["query"]["limit"] but it is actually components["parameters"]["limit"]
paramIn
components["parameters"]["query"]["limit"]
components["parameters"]["limit"]
Sorry, something went wrong.
I actually had opened #984 with this exact problem.
Ops, I didn't realize your issue is the same
No branches or pull requests
Description
Using
$ref
in the parameters section does not generate the type correctlyOpenAPI
Generated TS
*Expected TS
Checklist
The text was updated successfully, but these errors were encountered: