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
It seems that the library generated error types and returns only the first error code instead of the union for the other types. When we have declared other error codes for 401 and 404, only 401 is returned.
/** * Return first 5XX or 4XX response (in that order) from a Response Object Map */exporttypeErrorResponse<T,MediaextendsMediaType=MediaType>=FilterKeys<
This also bit me (first time user) when I have 200, 404, 500 responses, each with a different body schema. For unit testing a 404, I was wondering why the error type returned from the function matched the 500 schema.
Surely it would make more sense to union the error schemas (as suggested by this issue)?
Description
It seems that the library generated error types and returns only the first error code instead of the union for the other types. When we have declared other error codes for 401 and 404, only 401 is returned.
Reproduction
Full schema: https://pastebin.com/aBhmzfE2
As far as I can see, the errors are sorted in ascending order and only the first one is taken into account, the others are omitted.

Expected result
Union of all errors 401, 403, 403...
Checklist
The text was updated successfully, but these errors were encountered: