From a2d6e1adc35e8c031ff65151fb79cc0d8b4018c7 Mon Sep 17 00:00:00 2001 From: EranAvidor Date: Thu, 4 Aug 2016 10:14:16 +0300 Subject: [PATCH 1/2] improve(genswagger:template):added support for google.protobuf.Timestamp --- protoc-gen-swagger/genswagger/template.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/protoc-gen-swagger/genswagger/template.go b/protoc-gen-swagger/genswagger/template.go index e2bd125bda7..d33aba5de98 100644 --- a/protoc-gen-swagger/genswagger/template.go +++ b/protoc-gen-swagger/genswagger/template.go @@ -50,7 +50,11 @@ func findNestedMessagesAndEnumerations(message *descriptor.Message, reg *descrip } func renderMessagesAsDefinition(messages messageMap, d swaggerDefinitionsObject, reg *descriptor.Registry) { - for _, msg := range messages { + for name, msg := range messages { + switch name { + case ".google.protobuf.Timestamp": + continue + } if opt := msg.GetOptions(); opt != nil && opt.MapEntry != nil && *opt.MapEntry { continue } @@ -105,8 +109,15 @@ func schemaOfField(f *descriptor.Field, reg *descriptor.Registry) swaggerSchemaO switch ft := fd.GetType(); ft { case pbdescriptor.FieldDescriptorProto_TYPE_ENUM, pbdescriptor.FieldDescriptorProto_TYPE_MESSAGE, pbdescriptor.FieldDescriptorProto_TYPE_GROUP: - core = schemaCore{ - Ref: "#/definitions/" + fullyQualifiedNameToSwaggerName(fd.GetTypeName(), reg), + if fd.GetTypeName() == ".google.protobuf.Timestamp" && pbdescriptor.FieldDescriptorProto_TYPE_MESSAGE == ft { + core = schemaCore{ + Type: "string", + Format: "date-time", + } + } else { + core = schemaCore{ + Ref: "#/definitions/" + fullyQualifiedNameToSwaggerName(fd.GetTypeName(), reg), + } } default: ftype, format, ok := primitiveSchema(ft) From c50ea33f0881c317b4d1bea243a822ca88c84d5c Mon Sep 17 00:00:00 2001 From: EranAvidor Date: Sat, 6 Aug 2016 12:21:23 +0300 Subject: [PATCH 2/2] improve(examplepb):added example for google.protobuf.Timestamp usage --- .../clients/abe/ExamplepbABitOfEverything.go | 2 + examples/examplepb/a_bit_of_everything.pb.go | 155 ++++++++++-------- examples/examplepb/a_bit_of_everything.proto | 3 + .../a_bit_of_everything.swagger.json | 4 + 4 files changed, 92 insertions(+), 72 deletions(-) diff --git a/examples/clients/abe/ExamplepbABitOfEverything.go b/examples/clients/abe/ExamplepbABitOfEverything.go index 25084255678..2ca345dcc08 100644 --- a/examples/clients/abe/ExamplepbABitOfEverything.go +++ b/examples/clients/abe/ExamplepbABitOfEverything.go @@ -1,6 +1,7 @@ package abe import ( + "time" ) type ExamplepbABitOfEverything struct { @@ -26,6 +27,7 @@ type ExamplepbABitOfEverything struct { Sint32Value int32 `json:"sint32_value,omitempty"` Sint64Value string `json:"sint64_value,omitempty"` StringValue string `json:"string_value,omitempty"` + TimestampValue time.Time `json:"timestamp_value,omitempty"` Uint32Value int64 `json:"uint32_value,omitempty"` Uint64Value string `json:"uint64_value,omitempty"` Uuid string `json:"uuid,omitempty"` diff --git a/examples/examplepb/a_bit_of_everything.pb.go b/examples/examplepb/a_bit_of_everything.pb.go index 3b919655a4c..86985a3f5a4 100644 --- a/examples/examplepb/a_bit_of_everything.pb.go +++ b/examples/examplepb/a_bit_of_everything.pb.go @@ -11,6 +11,7 @@ import _ "github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/a import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" import grpc_gateway_examples_sub "github.com/grpc-ecosystem/grpc-gateway/examples/sub" import sub2 "github.com/grpc-ecosystem/grpc-gateway/examples/sub2" +import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" import ( context "golang.org/x/net/context" @@ -103,6 +104,7 @@ type ABitOfEverything struct { MappedStringValue map[string]string `protobuf:"bytes,23,rep,name=mapped_string_value,json=mappedStringValue" json:"mapped_string_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` MappedNestedValue map[string]*ABitOfEverything_Nested `protobuf:"bytes,24,rep,name=mapped_nested_value,json=mappedNestedValue" json:"mapped_nested_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` NonConventionalNameValue string `protobuf:"bytes,26,opt,name=nonConventionalNameValue" json:"nonConventionalNameValue,omitempty"` + TimestampValue *google_protobuf2.Timestamp `protobuf:"bytes,27,opt,name=timestamp_value,json=timestampValue" json:"timestamp_value,omitempty"` } func (m *ABitOfEverything) Reset() { *m = ABitOfEverything{} } @@ -180,6 +182,13 @@ func (m *ABitOfEverything) GetMappedNestedValue() map[string]*ABitOfEverything_N return nil } +func (m *ABitOfEverything) GetTimestampValue() *google_protobuf2.Timestamp { + if m != nil { + return m.TimestampValue + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*ABitOfEverything) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ABitOfEverything_OneofMarshaler, _ABitOfEverything_OneofUnmarshaler, _ABitOfEverything_OneofSizer, []interface{}{ @@ -576,77 +585,79 @@ var _ABitOfEverythingService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("examples/examplepb/a_bit_of_everything.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 1144 bytes of a gzipped FileDescriptorProto + // 1175 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x57, 0x4d, 0x4f, 0x1b, 0x47, - 0x18, 0xce, 0xda, 0x60, 0xf0, 0xbb, 0x18, 0xcc, 0x10, 0x88, 0xe3, 0xb4, 0x82, 0xba, 0x1f, 0x42, - 0x14, 0xed, 0x0a, 0x13, 0x55, 0x09, 0x52, 0x15, 0x41, 0x70, 0x95, 0xaa, 0x09, 0xa4, 0x4b, 0x92, - 0x03, 0x6a, 0x64, 0xad, 0xf1, 0x60, 0x56, 0x78, 0x77, 0x56, 0xfb, 0xe1, 0x62, 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, - 0x83, 0x4c, 0xda, 0x0e, 0xb7, 0x37, 0xa6, 0x04, 0x9d, 0x58, 0x11, 0x02, 0x63, 0x61, 0x68, 0xb5, - 0x2b, 0x0a, 0xb2, 0x16, 0x0d, 0xfe, 0x4c, 0x5e, 0x42, 0x21, 0xd6, 0xca, 0x2d, 0xe5, 0x6f, 0xa5, - 0x15, 0xf3, 0x90, 0x45, 0x50, 0x0f, 0xbb, 0xcc, 0x0c, 0x9a, 0x3d, 0xb3, 0x1b, 0xd2, 0x4a, 0x1e, - 0xc5, 0x72, 0x06, 0xf0, 0xad, 0x37, 0xd1, 0x0e, 0xf9, 0x08, 0xa6, 0xda, 0x2c, 0x6c, 0x61, 0x94, - 0x02, 0x31, 0x86, 0x08, 0xc5, 0x50, 0xc5, 0x9e, 0x80, 0x20, 0x87, 0xe5, 0x04, 0x5f, 0x3c, 0x8c, - 0x11, 0xe3, 0x88, 0xc8, 0x1b, 0xc0, 0xb7, 0x52, 0x8e, 0x50, 0x46, 0x14, 0x10, 0x31, 0x66, 0xa8, - 0xa1, 0x04, 0x11, 0x1c, 0xeb, 0xf5, 0x18, 0x31, 0x81, 0x88, 0x71, 0xce, 0xb1, 0x5e, 0x17, 0x80, - 0x8f, 0xa1, 0x74, 0x68, 0x9d, 0xd0, 0x76, 0x4a, 0x32, 0x89, 0x90, 0x82, 0x31, 0x15, 0x6f, 0x66, - 0x41, 0x29, 0x4f, 0x11, 0x41, 0x13, 0x31, 0x28, 0x61, 0xfa, 0x10, 0xa0, 0xc5, 0x58, 0x37, 0x46, - 0x00, 0x22, 0x26, 0x8d, 0x62, 0xb4, 0x93, 0x3a, 0xeb, 0x07, 0x1e, 0xa6, 0x2a, 0x06, 0xa8, 0x3c, - 0xff, 0xaa, 0xd8, 0xcb, 0xc4, 0x93, 0xaa, 0x94, 0x10, 0x52, 0x12, 0xf1, 0x24, 0x22, 0xdf, 0x00, - 0x50, 0x27, 0xb4, 0x63, 0xc0, 0x34, 0x02, 0xa6, 0xe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0xc8, 0xea, 0x5b, + 0x08, 0xf0, 0xd1, 0x40, 0x00, 0xaa, 0xff, 0x16, 0xa1, 0xb4, 0xb9, 0x65, 0xf9, 0x7b, 0x47, 0xf5, + 0x38, 0x20, 0xf2, 0x16, 0x0a, 0x1e, 0xfe, 0x76, 0x68, 0xc3, 0x46, 0x30, 0x6d, 0x95, 0x1f, 0x2e, + 0xa5, 0x96, 0xf3, 0xb5, 0xc7, 0xda, 0x88, 0x10, 0xb5, 0x41, 0x26, 0x6d, 0x97, 0xdb, 0x1b, 0x53, + 0x82, 0x4e, 0x8c, 0x08, 0x81, 0xb1, 0x20, 0xb0, 0x5a, 0xe5, 0x14, 0xb2, 0xe6, 0x0c, 0xfe, 0x4d, + 0x5e, 0x42, 0x56, 0x6a, 0xa5, 0x97, 0x32, 0x77, 0xd2, 0x92, 0x3c, 0x64, 0x11, 0xf2, 0x47, 0x1d, + 0x66, 0xfa, 0x8d, 0x9e, 0xd9, 0x09, 0x68, 0x39, 0x83, 0x62, 0x69, 0x03, 0xf8, 0xd4, 0x9b, 0x70, + 0x86, 0x7c, 0x04, 0x53, 0x2d, 0x16, 0x34, 0x31, 0x4a, 0x81, 0x18, 0x43, 0x44, 0xca, 0xc8, 0x8b, + 0x39, 0x01, 0x41, 0x0e, 0xcb, 0xf6, 0xbf, 0x78, 0x24, 0x11, 0xe3, 0x88, 0xc8, 0x18, 0xc0, 0xa7, + 0x62, 0x8e, 0x40, 0x45, 0x64, 0x11, 0x31, 0x66, 0xe4, 0x03, 0x05, 0x22, 0x38, 0xd6, 0x6b, 0x12, + 0x31, 0x81, 0x88, 0x71, 0xce, 0xb1, 0x5e, 0x13, 0x80, 0x8f, 0xa1, 0x70, 0x64, 0x9d, 0xd2, 0x56, + 0x4c, 0x32, 0x89, 0x90, 0xac, 0x31, 0x25, 0x27, 0x93, 0xa0, 0x98, 0x27, 0x87, 0xa0, 0x09, 0x09, + 0x8a, 0x98, 0x3e, 0x04, 0x68, 0x32, 0xd6, 0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, + 0xe2, 0x9f, 0x89, 0x16, 0xde, 0x95, 0xbc, 0xb8, 0x6f, 0x60, 0x22, 0xbc, 0x6b, 0x59, 0xe0, 0x93, + 0x21, 0xc5, 0x1c, 0x5a, 0xe4, 0x05, 0xae, 0x3d, 0x47, 0x66, 0xd5, 0x64, 0xf8, 0x82, 0x6c, 0x2b, + 0x7f, 0x90, 0x8b, 0xdd, 0x6e, 0x66, 0xb9, 0xe5, 0xfa, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdb, + 0xf3, 0x9f, 0xf3, 0x1a, 0x0e, 0x00, 0x00, } diff --git a/examples/examplepb/a_bit_of_everything.proto b/examples/examplepb/a_bit_of_everything.proto index 05843baeeef..85b44edfe42 100644 --- a/examples/examplepb/a_bit_of_everything.proto +++ b/examples/examplepb/a_bit_of_everything.proto @@ -6,6 +6,7 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "examples/sub/message.proto"; import "examples/sub2/message.proto"; +import "google/protobuf/timestamp.proto"; // Intentionaly complicated message type to cover much features of Protobuf. // NEXT ID: 27 @@ -55,6 +56,8 @@ message ABitOfEverything { map mapped_nested_value = 24; string nonConventionalNameValue = 26; + + google.protobuf.Timestamp timestamp_value = 27; } // NumericEnum is one or zero. diff --git a/examples/examplepb/a_bit_of_everything.swagger.json b/examples/examplepb/a_bit_of_everything.swagger.json index e52f7c70e8b..840c0ddde03 100644 --- a/examples/examplepb/a_bit_of_everything.swagger.json +++ b/examples/examplepb/a_bit_of_everything.swagger.json @@ -486,6 +486,10 @@ "type": "string", "format": "string" }, + "timestamp_value": { + "type": "string", + "format": "date-time" + }, "uint32_value": { "type": "integer", "format": "int64",