Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello,

I am in the process to evaluating this library to generate client code for my api. I tried generating the client code and its works fine.

Only question/concern I have is with handling response for failed requests. I see that a separate field is getting generated for each response code JSON202, JSON400, JSON404 etc., This way, the code that consumes the client functions, need to handle different error codes, and wrap it in a error to send back to upstream callers.

Is it possible to generate types in such a way that there is only one error field in the response, and different error codes can respond with different custom errors in the error field. This way clients can just handle required errors, and the rest can be returned as errors to upstream callers.

Please share your thoughts on this.

Thanks in advance.

You must be logged in to vote

Replies: 1 comment

Comment options

This is old, but it is not currently possible. See #276

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.