You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When having a definition for an endpoint that return different schemas, depending on the accept header, the typescript-angular generator library generates a method that does take either one of the accept headers but only return one type.
HerrDerb
changed the title
[BUG] [Typescript-angular]
[BUG] [Typescript-angular] Loses type information when having method that returns different schemas depending on accept-type
Nov 22, 2024
Bug Report Checklist
Description
When having a definition for an endpoint that return different schemas, depending on the accept header, the typescript-angular generator library generates a method that does take either one of the accept headers but only return one type.
If
application/json
is defined as accept header, the method should return aTenantHealth
openapi-generator version
"@openapitools/openapi-generator-cli": "2.15.3"
OpenAPI declaration file content or url
Generation Details
openapi-generator-cli generate -i openapi/api.yaml -g typescript-angular -o generated-sources/openapi/api
Steps to reproduce
Simply generate
Suggest a fix
Generate a typescript method, for each acceptType/schema if there are multiple
E.g. for given spec:
The text was updated successfully, but these errors were encountered: