Skip to content

Commit de4687a

Browse files
committed
Merge remote-tracking branch 'origin/master' into swagger_descriptions
2 parents 562956f + ab4f1c2 commit de4687a

30 files changed

+2448
-597
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ OPTIONS_PROTO=$(GOOGLEAPIS_DIR)/google/api/annotations.proto $(GOOGLEAPIS_DIR)/g
4141
OPTIONS_GO=$(OPTIONS_PROTO:.proto=.pb.go)
4242
OUTPUT_DIR=_output
4343

44+
RUNTIME_PROTO=runtime/stream_chunk.proto
45+
RUNTIME_GO=$(RUNTIME_PROTO:.proto=.pb.go)
46+
4447
PKGMAP=Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mgoogle/api/annotations.proto=$(PKG)/$(GOOGLEAPIS_DIR)/google/api,Mexamples/sub/message.proto=$(PKG)/examples/sub
4548
SWAGGER_EXAMPLES=examples/examplepb/echo_service.proto \
4649
examples/examplepb/streamless_everything.proto
@@ -54,7 +57,7 @@ EXAMPLE_DEPS=examples/sub/message.proto examples/sub2/message.proto
5457
EXAMPLE_DEPSRCS=$(EXAMPLE_DEPS:.proto=.pb.go)
5558
PROTOC_INC_PATH=$(dir $(shell which protoc))/../include
5659

57-
generate: $(OPTIONS_GO)
60+
generate: $(OPTIONS_GO) $(RUNTIME_GO)
5861

5962
.SUFFIXES: .go .proto
6063

@@ -63,9 +66,11 @@ $(GO_PLUGIN):
6366
go build -o $@ $(GO_PLUGIN_PKG)
6467

6568
$(OPTIONS_GO): $(OPTIONS_PROTO) $(GO_PLUGIN)
66-
protoc -I $(PROTOC_INC_PATH) -I$(GOOGLEAPIS_DIR) --plugin=$(GO_PLUGIN) --go_out=$(PKGMAP):$(GOOGLEAPIS_DIR) $(OPTIONS_PROTO)
69+
protoc -I $(PROTOC_INC_PATH) -I$(GOOGLEAPIS_DIR) --plugin=$(GO_PLUGIN) --go_out=$(PKGMAP):$(GOOGLEAPIS_DIR) $(OPTIONS_PROTO)
70+
$(RUNTIME_GO): $(RUNTIME_PROTO) $(GO_PLUGIN)
71+
protoc -I $(PROTOC_INC_PATH) --plugin=$(GO_PLUGIN) -I. --go_out=$(PKGMAP):. $(RUNTIME_PROTO)
6772

68-
$(GATEWAY_PLUGIN): $(OPTIONS_GO) $(GATEWAY_PLUGIN_SRC)
73+
$(GATEWAY_PLUGIN): $(OPTIONS_GO) $(RUNTIME_GO) $(GATEWAY_PLUGIN_SRC)
6974
go build -o $@ $(GATEWAY_PLUGIN_PKG)
7075

7176
$(SWAGGER_PLUGIN): $(OPTIONS_GO) $(SWAGGER_PLUGIN_SRC)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,4 @@ But patch is welcome.
213213
214214
# License
215215
grpc-gateway is licensed under the BSD 3-Clause License.
216-
See `LICENSE.txt` for more details.
216+
See [LICENSE.txt](https://github.com/gengo/grpc-gateway/blob/master/LICENSE.txt) for more details.

examples/examplepb/a_bit_of_everything.pb.go

Lines changed: 253 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/examplepb/a_bit_of_everything.pb.gw.go

Lines changed: 132 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/examplepb/a_bit_of_everything.proto

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import "google/api/annotations.proto";
66
import "examples/sub/message.proto";
77
import "examples/sub2/message.proto";
88

9+
// Intentionaly complicated message type to cover much features of Protobuf.
10+
// NEXT ID: 27
911
message ABitOfEverything {
1012
message Nested {
1113
string name = 1;
@@ -16,6 +18,7 @@ message ABitOfEverything {
1618
}
1719
DeepEnum ok = 3;
1820
}
21+
Nested single_nested = 25;
1922

2023
string uuid = 1;
2124
repeated Nested nested = 2;
@@ -36,6 +39,16 @@ message ABitOfEverything {
3639
sint32 sint32_value = 17;
3740
sint64 sint64_value = 18;
3841
repeated string repeated_string_value = 19;
42+
oneof oneof_value {
43+
EmptyMessage oneof_empty = 20;
44+
string oneof_string = 21;
45+
}
46+
47+
map<string, NumericEnum> map_value = 22;
48+
map<string, string> mapped_string_value = 23;
49+
map<string, Nested> mapped_nested_value = 24;
50+
51+
string nonConventionalNameValue = 26;
3952
}
4053

4154
message EmptyMessage {
@@ -50,7 +63,7 @@ service ABitOfEverythingService {
5063
rpc Create(ABitOfEverything) returns (ABitOfEverything) {
5164
// TODO add enum_value
5265
option (google.api.http) = {
53-
post: "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value=strprefix/*}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}"
66+
post: "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value=strprefix/*}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}"
5467
};
5568
}
5669
rpc CreateBody(ABitOfEverything) returns (ABitOfEverything) {
@@ -104,4 +117,10 @@ service ABitOfEverythingService {
104117
body: "*"
105118
};
106119
}
120+
rpc DeepPathEcho(ABitOfEverything) returns (ABitOfEverything) {
121+
option (google.api.http) = {
122+
post: "/v1/example/a_bit_of_everything/{single_nested.name}"
123+
body: "*"
124+
};
125+
}
107126
}

examples/examplepb/echo_service.pb.gw.go

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)