Skip to content

Commit

Permalink
Omit well-known type definitions from swagger output (grpc-ecosystem#541
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alexleigh authored and achew22 committed Mar 12, 2018
1 parent c0b6140 commit 652a7b7
Show file tree
Hide file tree
Showing 7 changed files with 418 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ ifneq "$(GATEWAY_PLUGIN_FLAGS)" ""
ADDITIONAL_FLAGS=,$(GATEWAY_PLUGIN_FLAGS)
endif
SWAGGER_EXAMPLES=examples/examplepb/echo_service.proto \
examples/examplepb/a_bit_of_everything.proto
examples/examplepb/a_bit_of_everything.proto \
examples/examplepb/wrappers.proto
EXAMPLES=examples/examplepb/echo_service.proto \
examples/examplepb/a_bit_of_everything.proto \
examples/examplepb/stream.proto \
examples/examplepb/flow_combination.proto
examples/examplepb/flow_combination.proto \
examples/examplepb/wrappers.proto
EXAMPLE_SVCSRCS=$(EXAMPLES:.proto=.pb.go)
EXAMPLE_GWSRCS=$(EXAMPLES:.proto=.pb.gw.go)
EXAMPLE_SWAGGERSRCS=$(EXAMPLES:.proto=.swagger.json)
Expand Down
2 changes: 2 additions & 0 deletions examples/examplepb/echo_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

179 changes: 179 additions & 0 deletions examples/examplepb/wrappers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 122 additions & 0 deletions examples/examplepb/wrappers.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions examples/examplepb/wrappers.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";
option go_package = "examplepb";
package grpc.gateway.examples.examplepb;

import "google/api/annotations.proto";
import "google/protobuf/wrappers.proto";

message Wrappers {
google.protobuf.StringValue string_value = 1;
google.protobuf.Int32Value int32_value = 2;
google.protobuf.Int64Value int64_value = 3;
google.protobuf.FloatValue float_value = 4;
google.protobuf.DoubleValue double_value = 5;
google.protobuf.BoolValue bool_value = 6;
}

service WrappersService {
rpc Create(Wrappers) returns (Wrappers) {
option (google.api.http) = {
post: "/v1/example/wrappers"
body: "*"
};
}
}
Loading

0 comments on commit 652a7b7

Please sign in to comment.