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

Define errors' model for Swagger docs #83

Open
utrack opened this issue Mar 10, 2020 · 1 comment
Open

Define errors' model for Swagger docs #83

utrack opened this issue Mar 10, 2020 · 1 comment

Comments

@utrack
Copy link
Owner

utrack commented Mar 10, 2020

Since grpc-ecosystem/grpc-gateway#1127 it's possible to define an Error message via registering .grpc.gateway.runtime.Error and .grpc.gateway.runtime.StreamError.

Right now, these definitions are explicitly disabled in clay via SetDisableDefaultErrors(true), but it would be great to reenable them if the user somehow provides an Error when generating Go code.

@utrack utrack changed the title Define errors' model in Swagger docs Define errors' model for Swagger docs Mar 10, 2020
utrack added a commit that referenced this issue Mar 10, 2020
Temporarily force-disabled errors definitions for generated Swagger defs
until we figure out the best approach to set them up and customize them.

Closes #81, refs #83
@zengzhengrong
Copy link

zengzhengrong commented Jun 10, 2020

I define server streaming , but i got the error

E0610 09:58:27.961171   32743 template.go:284] no message found: StreamError

if i define the http rule in yaml , like this

   - selector: user_center.ManageUserCenter.GetSimilarUsers
      get: '/v1/fnuos/userCenter/getSimilarUsers'
    

pb.goclay.go have a error,

unmFunc := unmarshaler_goclay_ManageUserCenter_GetSimilarUsers_0(r)
			rsp, err := _ManageUserCenter_GetSimilarUsers_Handler(d.svc, r.Context(), unmFunc, d.opts.UnaryInterceptor)

_ManageUserCenter_GetSimilarUsers_Handler is a serverstream ,but the parameter is unary implementation,so does http rule support streaming ?

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

No branches or pull requests

2 participants