204 response causes wrong data
to be undefined
#1933
Labels
bug
Something isn't working
good first issue
Straightforward problem, solvable for first-time contributors without deep knowledge of the project
openapi-fetch
Relevant to the openapi-fetch library
PRs welcome
PRs are welcome to solve this issue!
Description
Having a
204
response in combination with a200
response in the generated type causes the returned data to becomeundefined
Generated
openapi.ts
file byopenapi-typescript
:Reproduction
Have an operation as defined above (with a
200
and a204
with no content). Then attempt to use the openapi-fetch client for the operation.Expected result
I expected the type a union of
components["schemas"]["OrderDTO"][] | undefined
and for me to not have to do a manual type assertion.Checklist
The text was updated successfully, but these errors were encountered: