hnlq715 opened a new issue #3406:
URL: https://github.com/apache/apisix/issues/3406


   We can use `gRPC HTTP mapping annotation` to specifies the HTTP mapping for 
methods in protobuf as well, like this:
   
   ```protobuf
   // Returns a specific bookstore shelf.
   rpc GetShelf(GetShelfRequest) returns (Shelf) {
     // Client example - returns the first shelf:
     //   curl http://DOMAIN_NAME/v1/shelves/1
     option (google.api.http) = { get: "/v1/shelves/{shelf}" };
   }
   
   ...
   // Request message for GetShelf method.
   message GetShelfRequest {
     // The ID of the shelf resource to retrieve.
     int64 shelf = 1;
   }
   ```
   * option (google.api.http) specifies that this method is a gRPC HTTP mapping 
annotation.
   * get specifies that this method is mapped to an HTTP GET request.
   * "/v1/shelves" is the URL path template (appended to your service's domain) 
that the GET request uses to call this method. The URL path is also known as 
the resource path because it typically specifies the "thing" or resource you 
want to use. In this case, all our Bookstore's shelf resources.
   
   details can be found in 
https://cloud.google.com/endpoints/docs/grpc/transcoding


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to