openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

error types

Open schmitch opened this issue 2 years ago • 1 comments

Describe the solution you'd like A clear and concise description of what you want to happen. Ideally with a small example of the proposed changes.

hello, would it be possible to also have specific types for errors? I mean it can be even a generated throw call that also generates typings for stuff like:

          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          }

could be as "simple" as:

throws ValidationProblemDetailsError
throws ApiError

schmitch avatar Aug 25 '23 19:08 schmitch

I would love to see support for this! It's makes error handling be easier, without it we kinda have to hack around to get those specific error types.

aclowkey avatar Dec 11 '23 12:12 aclowkey