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
In a scenario where error response do not have content shapes defined, then the type narrowing behaviour for success responses stops working correctly and can show as undefined.
openapi-fetch version
0.14.0
Description
In a scenario where error response do not have content shapes defined, then the type narrowing behaviour for success responses stops working correctly and can show as undefined.
Reproduction
I have a reproduction for this here:
https://github.com/dwjohnston/openapi-typescript-example/tree/missing-error-data
I have an spec defines the response for
GET /pets/{petId}
that looks like this:Note no content is defined for the error response.
This will generate typings like this:
When I use the typings with OpenPI fetch then :
Expected result
Given the type guard where we have removed the error scenarios, the
result.data
type should definitely exist.Extra
The text was updated successfully, but these errors were encountered: