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
oneOf
When using oneOf to represent a tuple, the process of inserting the value as a query is incorrect.
Please see this repository: https://github.com/turtton/openapi-generator-bug-reproduction
7.6.0
components: schemas: Id: type: integer format: int32 CreatedAt: type: string format: date-time Cursor: oneOf: - $ref: '#/components/schemas/Id' - $ref: '#/components/schemas/CreatedAt'
Full code https://github.com/turtton/openapi-generator-bug-reproduction/blob/main/api.yaml
Type
export type Cursor = number | string;
if (cursor !== undefined) { for (const [key, value] of Object.entries(cursor)) { // Object.entries always returns empty array localVarQueryParameter[key] = value; } }
expected(~7.0.0):
if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; }
./gen-latest
generated-latest/api.ts
corepack enable && pnpm i && pnpm openapi-generator-cli generate
generated76/api.ts
#17335
#16898
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report Checklist
Description
When using
oneOf
to represent a tuple, the process of inserting the value as a query is incorrect.Please see this repository:
https://github.com/turtton/openapi-generator-bug-reproduction
openapi-generator version
7.6.0
OpenAPI declaration file content or url
Full code
https://github.com/turtton/openapi-generator-bug-reproduction/blob/main/api.yaml
Generation Details
Type
expected(~7.0.0):
Steps to reproduce
./gen-latest
and seegenerated-latest/api.ts
or
corepack enable && pnpm i && pnpm openapi-generator-cli generate
and seegenerated76/api.ts
Related issues/PRs
#17335
#16898
Suggest a fix
The text was updated successfully, but these errors were encountered: