From 3141a31763d63074d892886f26cd6dda8422741e Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sat, 7 Dec 2019 16:57:04 -0800 Subject: [PATCH] Add example where generated proto does not work --- examples/proto/examplepb/BUILD.bazel | 8 +++++++ .../proto/examplepb/generated_input.proto | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 examples/proto/examplepb/generated_input.proto diff --git a/examples/proto/examplepb/BUILD.bazel b/examples/proto/examplepb/BUILD.bazel index 1077b5885e7..9928fa47e8e 100644 --- a/examples/proto/examplepb/BUILD.bazel +++ b/examples/proto/examplepb/BUILD.bazel @@ -13,12 +13,20 @@ package(default_visibility = ["//visibility:public"]) # gazelle:exclude wrappers.pb.gw.go # gazelle:exclude response_body_service.pb.gw.go +genrule( + name = "generated_proto", + srcs = ["generated_input.proto"], + outs = ["generated_output.proto"], + cmd = "cp $< $@", # A simple copy simulates a generated proto file. +) + proto_library( name = "examplepb_proto", srcs = [ "a_bit_of_everything.proto", "echo_service.proto", "flow_combination.proto", + "generated_output.proto", "non_standard_names.proto", "response_body_service.proto", "stream.proto", diff --git a/examples/proto/examplepb/generated_input.proto b/examples/proto/examplepb/generated_input.proto new file mode 100644 index 00000000000..8a1b7af3498 --- /dev/null +++ b/examples/proto/examplepb/generated_input.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +option go_package = "examplepb"; +package grpc.gateway.examples.examplepb; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "examples/proto/examplepb/a_bit_of_everything.proto"; +import "examples/proto/sub/message.proto"; + +// This file is run through a genrule. + +// Defines some more operations to be added to ABitOfEverythingService +service GeneratedService { + rpc Create(ABitOfEverything) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/example/a_bit_of_everything/generated_create" + body: "*" + }; + } + +}