Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to define 4xx, 5xx response codes in openapi spec generate from proto definitions #3404

Open
akoserwal opened this issue Aug 21, 2024 · 1 comment
Labels
question Further information is requested

Comments

@akoserwal
Copy link
Contributor

akoserwal commented Aug 21, 2024

I see a way to definite error codes, but it doesn't update the open API spec generation with HTTP error codes
https://go-kratos.dev/en/docs/component/errors

@akoserwal akoserwal added the question Further information is requested label Aug 21, 2024
@kvii
Copy link
Contributor

kvii commented Sep 11, 2024

If I were you, I would prefer to add a comment to the rpc api, like below:

// GetUser return a user. It will return an error with reason "USER_NOT_FOUND" when user is not found.
rpc GetUser (GetUserRequest) returns (GetUserReply)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants