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

Support access to MethodOptions fields #192

Closed
sleipnir opened this issue Apr 5, 2021 · 2 comments · Fixed by #351
Closed

Support access to MethodOptions fields #192

sleipnir opened this issue Apr 5, 2021 · 2 comments · Fixed by #351

Comments

@sleipnir
Copy link
Collaborator

sleipnir commented Apr 5, 2021

Is your feature request related to a problem? Please describe.
The option field in methods can be used to access contextual information. an example of this would http transcoding:

service ShoppingCart {
    rpc AddItem(AddLineItem) returns (google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/cart/{user_id}/items/add",
            body: "*",
        };
        option (.cloudstate.eventing).in = "items";
    }

    rpc RemoveItem(RemoveLineItem) returns (google.protobuf.Empty) {
        option (google.api.http).post = "/cart/{user_id}/items/{product_id}/remove";
    }

    rpc GetCart(GetShoppingCart) returns (Cart) {
        option (google.api.http) = {
          get: "/carts/{user_id}",
          additional_bindings: {
            get: "/carts/{user_id}/items",
            response_body: "items"
          }
        };
    }
@polvalente
Copy link
Contributor

@sleipnir do you want to take this on?

@sleipnir
Copy link
Collaborator Author

@sleipnir do you want to take this on?

@polvalente I think we can close this one once the options have been added and that @drowzy is developing #274 via #273

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