[BUG][TypeScript fetch] "oneOf" in query parameter generates wrong code
Created by: targos
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
In version 6.0.0, if oneOf
is used in the schema for a query parameter, the generated code is wrong in a few ways:
- The file which contains the type definition for the parameter also has code referencing functions that do not exist:
- The interface generated for the query parameters uses the type from that file but doesn't import it:
openapi-generator version
6.0.0. This is a regression from version 5.4.0.
OpenAPI declaration file content or url
https://gist.github.com/targos/ce0dcf58be520f94c1bdab868f14e17b
Generation Details
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.0.0",
"generators": {
"typescript-fetch": {
"generatorName": "typescript-fetch",
"glob": "openapi.json",
"output": "test/api",
"additionalProperties": {
"enumPropertyNaming": "UPPERCASE"
}
}
}
}
}
Steps to reproduce
npm install -D @openapitools/openapi-generator-cli
npx openapi-generator-cli generate