Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Bind Parameters to Request suffix #19

Closed
rverma-jm opened this issue Apr 18, 2020 · 2 comments
Closed

Bind Parameters to Request suffix #19

rverma-jm opened this issue Apr 18, 2020 · 2 comments

Comments

@rverma-jm
Copy link

Currently parameters are converted to an object with suffix Parameters.
Proposing if we can change this behaviour to

  1. If its 1 parameter, pass it directly to rpc method args
  2. Or add a Request suffix. Its seems more natural to understand.
"/pay/v1/transactions/{transactionId}/callback/pgs/payu": {
      "post": {
        "tags": [
          "callback-controller"
        ],
        "operationId": "payU",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "default response"
          }
        }
      }
    }

creates

 rpc PayU ( PayUParameters ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { post:"/pay/v1/transactions/{transactionId}/callback/pgs/payu"  };
  }

Excepcted

 rpc PayU ( string ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { post:"/pay/v1/transactions/{transactionId}/callback/pgs/payu"  };
  }

OR

 rpc PayU ( PayURequest ) returns ( google.protobuf.Empty ) {
    option (google.api.http) = { post:"/pay/v1/transactions/{transactionId}/callback/pgs/payu"  };
  }
@LorenzHW
Copy link
Contributor

@rverma-jm sorry I am a bit confused. Are those issues related to gnostic-go-generator or to gnostic-grpc?

Because your output shows .proto files and not .go files.

@rverma-jm
Copy link
Author

It seems I had created the issues in wrong repository then.

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

No branches or pull requests

2 participants