-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
genswagger: don't emit default response if there's no Error definition #1166
genswagger: don't emit default response if there's no Error definition #1166
Conversation
Swagger: do not create default response definitions if we can't find Error/StreamError in Registry, even if `DisableDefaultErrors()` is false. Logs are still emitted if default errors are enabled, but error definition was not found. grep: `.grpc.gateway.runtime.Error`, `.grpc.gateway.runtime.StreamError` Closes grpc-ecosystem#1162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, this will do nicely. Lets double down on the lookup that can fail, we should never render any look ups that fail.
now tests require properly loaded registry to lookup swagger names and stuff. :)
@johanbrandhorst the code looks a bit messier now because of more if branches; however, I don't want to do refactoring in the same PR so the changes would be as small as possible. This calls for a separate PR :) |
Would appreciate a further refactor in a separate PR if you have the time :). |
Swagger: do not create default response definitions if we can't find Error/StreamError in Registry, even if
DisableDefaultErrors()
is false.Logs are still emitted if default errors are enabled, but error definition was not found.
grep:
.grpc.gateway.runtime.Error
,.grpc.gateway.runtime.StreamError
Closes #1162