OpenAPITools / OpenAPITools/openapi-generator

[REQ] Support for google.api.http in protobuf-schema generator

Open
#17,391 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

When I generate protobuf-schema schema for gRPC I want also to be able to generate for REST also.
Here is explanation https://cloud.google.com/endpoints/docs/grpc/transcoding

For example like this:

// 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}" };
}

Describe the solution you'd like

To provide a parameter to turn on/off the feature.

Additional context

I wanted to do by myself and I think is here (line 19)
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache
but I don't know parameters.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache, especially the referenced area around line 19, and review the linked gRPC transcoding explanation. Determine how a parameter could enable or disable google.api.http handling. Done means protobuf-schema generation supports the REST mapping example when enabled while preserving the existing gRPC output when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.