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
The generated types in a parameters entry which references a nested property from a schemas entry is generating an invalid type.
parameters
schemas
openapi-typescript
7.0.1
18.16.1
Ubuntu 22.04
Reproduction
Generate types for the following OpenAPI schema:
openapi: "3.0" info: title: test version: "1.0" servers: - url: https://example.com security: [] paths: /endpoint: get: description: Test summary: Test parameters: - $ref: "#/components/parameters/direct" - $ref: "#/components/parameters/nested" responses: 200: description: '200' content: application/json: schema: type: string components: parameters: direct: in: query name: direct schema: $ref: "#/components/schemas/aaa" nested: in: query name: nested schema: $ref: "#/components/schemas/bbb/properties/ccc" schemas: aaa: type: string bbb: type: object properties: ccc: type: number
Expected result
export interface components { schemas: { aaa: string; bbb: { ccc?: number; }; }; responses: never; parameters: { direct: components["schemas"]["aaa"]; nested: components["schemas"]["bbb"]["ccc"]; }; requestBodies: never; headers: never; pathItems: never; }
Actual result
export interface components { schemas: { aaa: string; bbb: { ccc?: number; }; }; responses: never; parameters: { direct: components["schemas"]["aaa"]; nested: components["schemas"]["bbb"]["properties"]["ccc"]; }; requestBodies: never; headers: never; pathItems: never; }
Notice the extra ["properties"] here, which makes the type for the nested property invalid.
["properties"]
nested
Checklist
npx @redocly/cli@latest lint
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
The generated types in a
parameters
entry which references a nested property from aschemas
entry is generating an invalid type.openapi-typescript
7.0.1
18.16.1
Ubuntu 22.04
Reproduction
Generate types for the following OpenAPI schema:
Expected result
Actual result
Notice the extra
["properties"]
here, which makes the type for thenested
property invalid.Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: