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
Models generated with openapi-typescript-codegen contain the correctly inferred types from our OpenAPI Spec, but also the structure for the error object.
That should probably not be the case adds unnecessary of guarding code when calling the api functions.
+1 also running into this pattern where I have to type check responses for Error typing even though it never seems to get returned as an error, it's always a thrown error. Is this an issue with the open api definition or something we can configure?
Our response definition looks something like:
"204":
description: Successfully updated status for issue
"422":
description: Invalid Status Transition
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: Unexpected Transition Result
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: Issue not found
"400":
description: Malformed Request
default:
description: Unexpected Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
```
Models generated with
openapi-typescript-codegen
contain the correctly inferred types from our OpenAPI Spec, but also the structure for the error object.That should probably not be the case adds unnecessary of guarding code when calling the api functions.
Example:
It seems like the generated client should throw (and therefore not resolve) in any case when
response.ok
is not true:openapi-typescript-codegen/src/templates/core/functions/catchErrorCodes.hbs
Lines 20 to 33 in 9e475d9
The text was updated successfully, but these errors were encountered: