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

swagger error #867

Closed
vtolstov opened this issue Feb 12, 2019 · 3 comments
Closed

swagger error #867

vtolstov opened this issue Feb 12, 2019 · 3 comments

Comments

@vtolstov
Copy link

i have proto that contains:

service VolumesService {                                                                            
  rpc VolumesImport(stream Chunk) returns (VolumesImportRsp) {                                      
    option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {                        
      operation_id: "VolumesImport";                                                                
    };                                                                                              
    option (google.api.http) = { put: "/api/v2/volumes/{volume_id}"; body:"*"; };      
  }                                                                                                 
}

when i'm try generate swagger, it oututs:
--swagger_out: cannot use path parameter in client streaming

as i understand in case of stream from client, i can't use path like "/api/v2/volumes/{volume_id}".
How to deal with this? I have method that via post create new volume and returns it uuid, after that i can put to it data via stream.

@johanbrandhorst
Copy link
Collaborator

The gRPC gateway does not support client side streaming at this time. If you want to upload a file you will have to use multi-part uploads on a separate handler.

Closing as this has been covered in other issues. Please let me know if there's anything else you would like to ask.

@vtolstov
Copy link
Author

but why i can't generate swagger? i don't want to use grpc-gateway, i'm use only swagger generator from proto files.

@achew22
Copy link
Collaborator

achew22 commented Feb 12, 2019

The provided gateway doesn't support it, that's why you can't generate swagger for it. if you would like to extend the swagger generator to support this, I would be happy to merge your pull request.

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

3 participants