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
When using openapi-generator on an openapi.json that inluced anyOf with number and string, the resulting typescript schema is incorrect.
anyOf
number
string
"PostsSchema": { "properties": { "content": { "anyOf": [ { "type": "number" }, { "type": "string" } ], "title": "Content" } }, "title": "PostsSchema", "type": "object" }
leads to
export interface Content { } export interface PostsSchema { /** * * @type {Content} * @memberof PostsSchema */ content?: Content; }
but it should be content?: number | string; Content should not be an interface I think?.
content?: number | string;
v7.7.0 (https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.7.0)
openapi.json
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v7.7.0 generate -i /local/openapi.json -g typescript-fetch -o /local/out/ts
./out/ts/models/PostsSchema.ts
Content.ts
for reference here are the files I get: PostsSchema.ts Content.ts
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report Checklist
Description
When using openapi-generator on an openapi.json that inluced
anyOf
withnumber
andstring
, the resulting typescript schema is incorrect.leads to
but it should be
content?: number | string;
Content should not be an interface I think?.openapi-generator version
v7.7.0
(https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.7.0)
OpenAPI declaration file content or url
openapi.json
Generation Details
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v7.7.0 generate -i /local/openapi.json -g typescript-fetch -o /local/out/ts
Steps to reproduce
./out/ts/models/PostsSchema.ts
andContent.ts
for reference here are the files I get:
PostsSchema.ts
Content.ts
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: