From 6d3c6a660d079888e852acd149829baf77a21f68 Mon Sep 17 00:00:00 2001 From: Alexander Adhyatma Date: Fri, 23 Sep 2022 10:05:00 +0700 Subject: [PATCH 1/3] bug(codegen-uninitialized-struct): #2901 issue --- .../proto/examplepb/a_bit_of_everything.pb.go | 702 ++++++++++++------ .../examplepb/a_bit_of_everything.pb.gw.go | 225 +++++- .../proto/examplepb/a_bit_of_everything.proto | 29 + .../a_bit_of_everything.swagger.json | 137 +++- .../examplepb/a_bit_of_everything_grpc.pb.go | 84 +++ 5 files changed, 914 insertions(+), 263 deletions(-) diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.pb.go b/examples/internal/proto/examplepb/a_bit_of_everything.pb.go index e533826ef79..b4540d3acf4 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.pb.go +++ b/examples/internal/proto/examplepb/a_bit_of_everything.pb.go @@ -183,6 +183,55 @@ func (SnakeCase_0Enum) EnumDescriptor() ([]byte, []int) { return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{2} } +type ChildType int32 + +const ( + ChildType_TYPE_UNDEFINED ChildType = 0 + ChildType_TYPE_A ChildType = 1 + ChildType_TYPE_B ChildType = 2 +) + +// Enum value maps for ChildType. +var ( + ChildType_name = map[int32]string{ + 0: "TYPE_UNDEFINED", + 1: "TYPE_A", + 2: "TYPE_B", + } + ChildType_value = map[string]int32{ + "TYPE_UNDEFINED": 0, + "TYPE_A": 1, + "TYPE_B": 2, + } +) + +func (x ChildType) Enum() *ChildType { + p := new(ChildType) + *p = x + return p +} + +func (x ChildType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChildType) Descriptor() protoreflect.EnumDescriptor { + return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[3].Descriptor() +} + +func (ChildType) Type() protoreflect.EnumType { + return &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[3] +} + +func (x ChildType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChildType.Descriptor instead. +func (ChildType) EnumDescriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{3} +} + // DeepEnum is one or zero. type ABitOfEverything_Nested_DeepEnum int32 @@ -216,11 +265,11 @@ func (x ABitOfEverything_Nested_DeepEnum) String() string { } func (ABitOfEverything_Nested_DeepEnum) Descriptor() protoreflect.EnumDescriptor { - return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[3].Descriptor() + return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[4].Descriptor() } func (ABitOfEverything_Nested_DeepEnum) Type() protoreflect.EnumType { - return &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[3] + return &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes[4] } func (x ABitOfEverything_Nested_DeepEnum) Number() protoreflect.EnumNumber { @@ -1478,6 +1527,118 @@ func (*SnakeEnumResponse) Descriptor() ([]byte, []int) { return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{12} } +type UpdateChildRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The parent resource + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The X to set. + Child *Child `protobuf:"bytes,2,opt,name=child,proto3" json:"child,omitempty"` +} + +func (x *UpdateChildRequest) Reset() { + *x = UpdateChildRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateChildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateChildRequest) ProtoMessage() {} + +func (x *UpdateChildRequest) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateChildRequest.ProtoReflect.Descriptor instead. +func (*UpdateChildRequest) Descriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateChildRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *UpdateChildRequest) GetChild() *Child { + if x != nil { + return x.Child + } + return nil +} + +type Child struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ChildType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.gateway.examples.internal.proto.examplepb.ChildType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Child) Reset() { + *x = Child{} + if protoimpl.UnsafeEnabled { + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Child) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Child) ProtoMessage() {} + +func (x *Child) ProtoReflect() protoreflect.Message { + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Child.ProtoReflect.Descriptor instead. +func (*Child) Descriptor() ([]byte, []int) { + return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{14} +} + +func (x *Child) GetType() ChildType { + if x != nil { + return x.Type + } + return ChildType_TYPE_UNDEFINED +} + +func (x *Child) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // Nested is nested type. type ABitOfEverything_Nested struct { state protoimpl.MessageState @@ -1494,7 +1655,7 @@ type ABitOfEverything_Nested struct { func (x *ABitOfEverything_Nested) Reset() { *x = ABitOfEverything_Nested{} if protoimpl.UnsafeEnabled { - mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[13] + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1507,7 +1668,7 @@ func (x *ABitOfEverything_Nested) String() string { func (*ABitOfEverything_Nested) ProtoMessage() {} func (x *ABitOfEverything_Nested) ProtoReflect() protoreflect.Message { - mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[13] + mi := &file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2043,15 +2204,33 @@ var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDesc = [ 0x75, 0x6d, 0x2e, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x20, 0x0a, 0x0b, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, - 0x6e, 0x75, 0x6d, 0x12, 0x08, 0x0a, 0x04, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0f, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x5f, - 0x63, 0x61, 0x73, 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x5f, 0x63, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, - 0x64, 0x10, 0x01, 0x2a, 0x2d, 0x0a, 0x11, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x5f, 0x63, 0x61, 0x73, - 0x65, 0x5f, 0x30, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x5f, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, - 0x10, 0x01, 0x32, 0xea, 0x34, 0x0a, 0x17, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, + 0x6a, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x4d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x20, 0x0a, 0x0b, 0x4e, + 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x08, 0x0a, 0x04, 0x5a, 0x45, + 0x52, 0x4f, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x2a, 0x2b, 0x0a, + 0x0f, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, + 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x10, 0x00, 0x12, 0x0b, 0x0a, + 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x10, 0x01, 0x2a, 0x2d, 0x0a, 0x11, 0x73, 0x6e, + 0x61, 0x6b, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x30, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x12, + 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x10, 0x01, 0x2a, 0x37, 0x0a, 0x09, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, + 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, + 0x10, 0x02, 0x32, 0xea, 0x34, 0x0a, 0x17, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8c, 0x04, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, @@ -2500,105 +2679,119 @@ var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDesc = [ 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x77, 0x68, 0x6f, 0x7d, 0x2f, 0x7b, 0x77, 0x68, 0x61, 0x74, 0x7d, 0x2f, 0x7b, 0x77, 0x68, 0x65, - 0x72, 0x65, 0x7d, 0x42, 0xa1, 0x0c, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, - 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x70, 0x62, 0x92, 0x41, 0xd0, 0x0b, 0x12, 0xf6, 0x01, 0x0a, 0x13, 0x41, 0x20, 0x42, 0x69, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x22, - 0x58, 0x0a, 0x14, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x20, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x10, 0x6e, 0x6f, 0x6e, 0x65, 0x40, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x5e, 0x0a, 0x14, 0x42, 0x53, 0x44, - 0x20, 0x33, 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, - 0x65, 0x12, 0x46, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, - 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, - 0x43, 0x45, 0x4e, 0x53, 0x45, 0x2e, 0x74, 0x78, 0x74, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x3a, 0x20, - 0x0a, 0x15, 0x78, 0x2d, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x6f, - 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x1a, 0x05, 0x79, 0x61, 0x64, 0x64, 0x61, - 0x2a, 0x03, 0x01, 0x02, 0x04, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x3a, - 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, - 0x6e, 0x3a, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, - 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, - 0x12, 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, - 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, - 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, - 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, - 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x52, 0x57, 0x0a, 0x03, 0x34, 0x31, 0x38, 0x12, - 0x50, 0x0a, 0x0d, 0x49, 0x27, 0x6d, 0x20, 0x61, 0x20, 0x74, 0x65, 0x61, 0x70, 0x6f, 0x74, 0x2e, - 0x12, 0x3f, 0x0a, 0x3d, 0x1a, 0x3b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, - 0x6d, 0x52, 0x9b, 0x02, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x93, 0x02, 0x0a, 0x0c, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x3f, 0x1a, 0x3d, + 0x72, 0x65, 0x7d, 0x32, 0xdc, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc5, 0x01, 0x0a, 0x0b, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x42, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0xbf, 0x01, - 0x0a, 0x10, 0x58, 0x2d, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, - 0x49, 0x64, 0x12, 0xaa, 0x01, 0x0a, 0x2b, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x12, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1a, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x32, 0x26, 0x22, 0x32, 0x34, 0x33, 0x38, 0x61, 0x63, 0x33, 0x63, 0x2d, 0x33, 0x37, 0x65, 0x62, - 0x2d, 0x34, 0x39, 0x30, 0x32, 0x2d, 0x61, 0x64, 0x65, 0x66, 0x2d, 0x65, 0x64, 0x31, 0x36, 0x62, - 0x34, 0x34, 0x33, 0x31, 0x30, 0x33, 0x30, 0x22, 0x6a, 0x45, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x41, - 0x2d, 0x46, 0x5d, 0x7b, 0x38, 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, - 0x34, 0x7d, 0x2d, 0x34, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, 0x2d, - 0x5b, 0x38, 0x39, 0x41, 0x42, 0x5d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, - 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x31, 0x32, 0x7d, 0x24, 0x5a, - 0x97, 0x03, 0x0a, 0xaa, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x9b, 0x01, 0x08, 0x02, 0x1a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x65, - 0x79, 0x20, 0x02, 0x4a, 0x60, 0x0a, 0x1e, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x2d, - 0x61, 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x3e, 0x2a, 0x3c, 0x0a, 0x29, 0x0a, 0x1c, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x74, 0x6c, - 0x49, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x09, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x4e, 0x40, 0x0a, 0x0f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x07, 0x1a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4a, 0x28, 0x0a, 0x1c, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, - 0x6e, 0x2d, 0x61, 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, - 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x1a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x0a, - 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, - 0x0a, 0xd6, 0x01, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0xcb, 0x01, 0x08, 0x03, - 0x28, 0x04, 0x32, 0x23, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x3a, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x7f, 0x0a, 0x43, 0x0a, 0x05, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x12, 0x3a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, - 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, - 0x1a, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, - 0x72, 0x65, 0x61, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a, 0x1c, 0x0a, 0x05, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x12, 0x13, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, - 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, - 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x62, 0x29, 0x0a, 0x0e, 0x0a, 0x0a, - 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x17, 0x0a, 0x06, - 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x0d, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x0a, 0x05, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x49, 0x0a, 0x17, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, - 0x6f, 0x75, 0x74, 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x05, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x1a, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x3d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x72, 0x65, 0x6e, 0x2f, 0x7b, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, + 0x2a, 0x7d, 0x42, 0xa1, 0x0c, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x70, 0x62, 0x92, 0x41, 0xd0, 0x0b, 0x12, 0xf6, 0x01, 0x0a, 0x13, 0x41, 0x20, 0x42, 0x69, 0x74, + 0x20, 0x6f, 0x66, 0x20, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x22, 0x58, + 0x0a, 0x14, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x20, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, + 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x10, 0x6e, 0x6f, 0x6e, 0x65, 0x40, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x5e, 0x0a, 0x14, 0x42, 0x53, 0x44, 0x20, + 0x33, 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, + 0x12, 0x46, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x7a, 0x28, 0x0a, 0x17, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2d, 0x62, 0x61, 0x7a, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x0d, 0x32, 0x0b, 0x0a, - 0x05, 0x1a, 0x03, 0x6f, 0x6e, 0x65, 0x0a, 0x02, 0x20, 0x01, 0x7a, 0x1b, 0x0a, 0x12, 0x78, 0x2d, - 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x66, 0x6f, 0x6f, - 0x12, 0x05, 0x1a, 0x03, 0x62, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, + 0x45, 0x4e, 0x53, 0x45, 0x2e, 0x74, 0x78, 0x74, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x3a, 0x20, 0x0a, + 0x15, 0x78, 0x2d, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x6f, 0x6d, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x1a, 0x05, 0x79, 0x61, 0x64, 0x64, 0x61, 0x2a, + 0x03, 0x01, 0x02, 0x04, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x3a, 0x10, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, + 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, + 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, + 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, + 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, + 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x52, 0x57, 0x0a, 0x03, 0x34, 0x31, 0x38, 0x12, 0x50, + 0x0a, 0x0d, 0x49, 0x27, 0x6d, 0x20, 0x61, 0x20, 0x74, 0x65, 0x61, 0x70, 0x6f, 0x74, 0x2e, 0x12, + 0x3f, 0x0a, 0x3d, 0x1a, 0x3b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, 0x6d, + 0x52, 0x9b, 0x02, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x93, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x3f, 0x1a, 0x3d, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0xbf, 0x01, 0x0a, + 0x10, 0x58, 0x2d, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x49, + 0x64, 0x12, 0xaa, 0x01, 0x0a, 0x2b, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x12, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x32, + 0x26, 0x22, 0x32, 0x34, 0x33, 0x38, 0x61, 0x63, 0x33, 0x63, 0x2d, 0x33, 0x37, 0x65, 0x62, 0x2d, + 0x34, 0x39, 0x30, 0x32, 0x2d, 0x61, 0x64, 0x65, 0x66, 0x2d, 0x65, 0x64, 0x31, 0x36, 0x62, 0x34, + 0x34, 0x33, 0x31, 0x30, 0x33, 0x30, 0x22, 0x6a, 0x45, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, + 0x46, 0x5d, 0x7b, 0x38, 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x34, + 0x7d, 0x2d, 0x34, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, 0x2d, 0x5b, + 0x38, 0x39, 0x41, 0x42, 0x5d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, + 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x31, 0x32, 0x7d, 0x24, 0x5a, 0x97, + 0x03, 0x0a, 0xaa, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x9b, 0x01, 0x08, 0x02, 0x1a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x65, 0x79, + 0x20, 0x02, 0x4a, 0x60, 0x0a, 0x1e, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x2d, 0x61, + 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x72, 0x12, 0x3e, 0x2a, 0x3c, 0x0a, 0x29, 0x0a, 0x1c, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x74, 0x6c, 0x49, + 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x09, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x4e, 0x40, 0x0a, 0x0f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x07, 0x1a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x4a, 0x28, 0x0a, 0x1c, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x2d, 0x61, 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x1a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x0a, 0x0f, + 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, + 0xd6, 0x01, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0xcb, 0x01, 0x08, 0x03, 0x28, + 0x04, 0x32, 0x23, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x3a, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x7f, 0x0a, 0x43, 0x0a, 0x05, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x12, 0x3a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x1a, + 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, + 0x65, 0x61, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a, 0x1c, 0x0a, 0x05, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x12, 0x13, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, 0x70, + 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x61, + 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x62, 0x29, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, + 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x17, 0x0a, 0x06, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x0d, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x0a, 0x05, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x72, 0x49, 0x0a, 0x17, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, + 0x75, 0x74, 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, + 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x7a, + 0x28, 0x0a, 0x17, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2d, 0x62, 0x61, 0x7a, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x0d, 0x32, 0x0b, 0x0a, 0x05, + 0x1a, 0x03, 0x6f, 0x6e, 0x65, 0x0a, 0x02, 0x20, 0x01, 0x7a, 0x1b, 0x0a, 0x12, 0x78, 0x2d, 0x67, + 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x66, 0x6f, 0x6f, 0x12, + 0x05, 0x1a, 0x03, 0x62, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2613,148 +2806,155 @@ func file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZI return file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescData } -var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_goTypes = []interface{}{ (NumericEnum)(0), // 0: grpc.gateway.examples.internal.proto.examplepb.NumericEnum (SnakeCaseEnum)(0), // 1: grpc.gateway.examples.internal.proto.examplepb.snake_case_enum (SnakeCase_0Enum)(0), // 2: grpc.gateway.examples.internal.proto.examplepb.snake_case_0_enum - (ABitOfEverything_Nested_DeepEnum)(0), // 3: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.DeepEnum - (*ErrorResponse)(nil), // 4: grpc.gateway.examples.internal.proto.examplepb.ErrorResponse - (*ErrorObject)(nil), // 5: grpc.gateway.examples.internal.proto.examplepb.ErrorObject - (*ABitOfEverything)(nil), // 6: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - (*ABitOfEverythingRepeated)(nil), // 7: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated - (*CheckStatusResponse)(nil), // 8: grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse - (*Body)(nil), // 9: grpc.gateway.examples.internal.proto.examplepb.Body - (*MessageWithBody)(nil), // 10: grpc.gateway.examples.internal.proto.examplepb.MessageWithBody - (*UpdateV2Request)(nil), // 11: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request - (*Book)(nil), // 12: grpc.gateway.examples.internal.proto.examplepb.Book - (*CreateBookRequest)(nil), // 13: grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest - (*UpdateBookRequest)(nil), // 14: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest - (*SnakeEnumRequest)(nil), // 15: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest - (*SnakeEnumResponse)(nil), // 16: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumResponse - (*ABitOfEverything_Nested)(nil), // 17: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested - nil, // 18: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry - nil, // 19: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedStringValueEntry - nil, // 20: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry - (pathenum.PathEnum)(0), // 21: grpc.gateway.examples.internal.pathenum.PathEnum - (pathenum.MessagePathEnum_NestedPathEnum)(0), // 22: grpc.gateway.examples.internal.pathenum.MessagePathEnum.NestedPathEnum - (*emptypb.Empty)(nil), // 23: google.protobuf.Empty - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp - (*status.Status)(nil), // 25: google.rpc.Status - (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask - (pathenum.SnakeCaseForImport)(0), // 27: grpc.gateway.examples.internal.pathenum.snake_case_for_import - (*sub2.IdMessage)(nil), // 28: grpc.gateway.examples.internal.proto.sub2.IdMessage - (*sub.StringMessage)(nil), // 29: grpc.gateway.examples.internal.proto.sub.StringMessage - (*durationpb.Duration)(nil), // 30: google.protobuf.Duration - (*pathenum.MessageWithPathEnum)(nil), // 31: grpc.gateway.examples.internal.pathenum.MessageWithPathEnum - (*pathenum.MessageWithNestedPathEnum)(nil), // 32: grpc.gateway.examples.internal.pathenum.MessageWithNestedPathEnum - (*oneofenum.OneofEnumMessage)(nil), // 33: grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage - (*wrapperspb.StringValue)(nil), // 34: google.protobuf.StringValue + (ChildType)(0), // 3: grpc.gateway.examples.internal.proto.examplepb.ChildType + (ABitOfEverything_Nested_DeepEnum)(0), // 4: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.DeepEnum + (*ErrorResponse)(nil), // 5: grpc.gateway.examples.internal.proto.examplepb.ErrorResponse + (*ErrorObject)(nil), // 6: grpc.gateway.examples.internal.proto.examplepb.ErrorObject + (*ABitOfEverything)(nil), // 7: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + (*ABitOfEverythingRepeated)(nil), // 8: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated + (*CheckStatusResponse)(nil), // 9: grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse + (*Body)(nil), // 10: grpc.gateway.examples.internal.proto.examplepb.Body + (*MessageWithBody)(nil), // 11: grpc.gateway.examples.internal.proto.examplepb.MessageWithBody + (*UpdateV2Request)(nil), // 12: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request + (*Book)(nil), // 13: grpc.gateway.examples.internal.proto.examplepb.Book + (*CreateBookRequest)(nil), // 14: grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest + (*UpdateBookRequest)(nil), // 15: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest + (*SnakeEnumRequest)(nil), // 16: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest + (*SnakeEnumResponse)(nil), // 17: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumResponse + (*UpdateChildRequest)(nil), // 18: grpc.gateway.examples.internal.proto.examplepb.UpdateChildRequest + (*Child)(nil), // 19: grpc.gateway.examples.internal.proto.examplepb.Child + (*ABitOfEverything_Nested)(nil), // 20: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + nil, // 21: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry + nil, // 22: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedStringValueEntry + nil, // 23: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry + (pathenum.PathEnum)(0), // 24: grpc.gateway.examples.internal.pathenum.PathEnum + (pathenum.MessagePathEnum_NestedPathEnum)(0), // 25: grpc.gateway.examples.internal.pathenum.MessagePathEnum.NestedPathEnum + (*emptypb.Empty)(nil), // 26: google.protobuf.Empty + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*status.Status)(nil), // 28: google.rpc.Status + (*fieldmaskpb.FieldMask)(nil), // 29: google.protobuf.FieldMask + (pathenum.SnakeCaseForImport)(0), // 30: grpc.gateway.examples.internal.pathenum.snake_case_for_import + (*sub2.IdMessage)(nil), // 31: grpc.gateway.examples.internal.proto.sub2.IdMessage + (*sub.StringMessage)(nil), // 32: grpc.gateway.examples.internal.proto.sub.StringMessage + (*durationpb.Duration)(nil), // 33: google.protobuf.Duration + (*pathenum.MessageWithPathEnum)(nil), // 34: grpc.gateway.examples.internal.pathenum.MessageWithPathEnum + (*pathenum.MessageWithNestedPathEnum)(nil), // 35: grpc.gateway.examples.internal.pathenum.MessageWithNestedPathEnum + (*oneofenum.OneofEnumMessage)(nil), // 36: grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage + (*wrapperspb.StringValue)(nil), // 37: google.protobuf.StringValue } var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_depIdxs = []int32{ - 5, // 0: grpc.gateway.examples.internal.proto.examplepb.ErrorResponse.error:type_name -> grpc.gateway.examples.internal.proto.examplepb.ErrorObject - 17, // 1: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.single_nested:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested - 17, // 2: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + 6, // 0: grpc.gateway.examples.internal.proto.examplepb.ErrorResponse.error:type_name -> grpc.gateway.examples.internal.proto.examplepb.ErrorObject + 20, // 1: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.single_nested:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + 20, // 2: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested 0, // 3: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.enum_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum - 21, // 4: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.path_enum_value:type_name -> grpc.gateway.examples.internal.pathenum.PathEnum - 22, // 5: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested_path_enum_value:type_name -> grpc.gateway.examples.internal.pathenum.MessagePathEnum.NestedPathEnum - 23, // 6: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.oneof_empty:type_name -> google.protobuf.Empty - 18, // 7: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.map_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry - 19, // 8: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.mapped_string_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedStringValueEntry - 20, // 9: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.mapped_nested_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry - 24, // 10: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.timestamp_value:type_name -> google.protobuf.Timestamp + 24, // 4: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.path_enum_value:type_name -> grpc.gateway.examples.internal.pathenum.PathEnum + 25, // 5: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested_path_enum_value:type_name -> grpc.gateway.examples.internal.pathenum.MessagePathEnum.NestedPathEnum + 26, // 6: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.oneof_empty:type_name -> google.protobuf.Empty + 21, // 7: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.map_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry + 22, // 8: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.mapped_string_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedStringValueEntry + 23, // 9: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.mapped_nested_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry + 27, // 10: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.timestamp_value:type_name -> google.protobuf.Timestamp 0, // 11: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.repeated_enum_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum 0, // 12: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.repeated_enum_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum 0, // 13: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.enum_value_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum - 17, // 14: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.repeated_nested_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested - 17, // 15: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + 20, // 14: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.repeated_nested_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + 20, // 15: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.nested_annotation:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested 0, // 16: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated.path_repeated_enum_value:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum - 25, // 17: grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse.status:type_name -> google.rpc.Status - 9, // 18: grpc.gateway.examples.internal.proto.examplepb.MessageWithBody.data:type_name -> grpc.gateway.examples.internal.proto.examplepb.Body - 6, // 19: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request.abe:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 26, // 20: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request.update_mask:type_name -> google.protobuf.FieldMask - 24, // 21: grpc.gateway.examples.internal.proto.examplepb.Book.create_time:type_name -> google.protobuf.Timestamp - 12, // 22: grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest.book:type_name -> grpc.gateway.examples.internal.proto.examplepb.Book - 12, // 23: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest.book:type_name -> grpc.gateway.examples.internal.proto.examplepb.Book - 26, // 24: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest.update_mask:type_name -> google.protobuf.FieldMask + 28, // 17: grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse.status:type_name -> google.rpc.Status + 10, // 18: grpc.gateway.examples.internal.proto.examplepb.MessageWithBody.data:type_name -> grpc.gateway.examples.internal.proto.examplepb.Body + 7, // 19: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request.abe:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 29, // 20: grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request.update_mask:type_name -> google.protobuf.FieldMask + 27, // 21: grpc.gateway.examples.internal.proto.examplepb.Book.create_time:type_name -> google.protobuf.Timestamp + 13, // 22: grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest.book:type_name -> grpc.gateway.examples.internal.proto.examplepb.Book + 13, // 23: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest.book:type_name -> grpc.gateway.examples.internal.proto.examplepb.Book + 29, // 24: grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest.update_mask:type_name -> google.protobuf.FieldMask 1, // 25: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest.what:type_name -> grpc.gateway.examples.internal.proto.examplepb.snake_case_enum 2, // 26: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest.who:type_name -> grpc.gateway.examples.internal.proto.examplepb.snake_case_0_enum - 27, // 27: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest.where:type_name -> grpc.gateway.examples.internal.pathenum.snake_case_for_import - 3, // 28: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.ok:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.DeepEnum - 0, // 29: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry.value:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum - 17, // 30: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry.value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested - 6, // 31: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Create:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 32: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 13, // 33: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBook:input_type -> grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest - 14, // 34: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateBook:input_type -> grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest - 28, // 35: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Lookup:input_type -> grpc.gateway.examples.internal.proto.sub2.IdMessage - 6, // 36: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Custom:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 37: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DoubleColon:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 38: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Update:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 11, // 39: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateV2:input_type -> grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request - 28, // 40: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Delete:input_type -> grpc.gateway.examples.internal.proto.sub2.IdMessage - 6, // 41: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetQuery:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 7, // 42: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetRepeatedQuery:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated - 29, // 43: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Echo:input_type -> grpc.gateway.examples.internal.proto.sub.StringMessage - 6, // 44: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DeepPathEcho:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 30, // 45: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.NoBindings:input_type -> google.protobuf.Duration - 23, // 46: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Timeout:input_type -> google.protobuf.Empty - 23, // 47: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.ErrorWithDetails:input_type -> google.protobuf.Empty - 10, // 48: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetMessageWithBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.MessageWithBody - 9, // 49: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostWithEmptyBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.Body - 6, // 50: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckGetQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 51: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckNestedEnumGetQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 52: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckPostQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 23, // 53: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.OverwriteResponseContentType:input_type -> google.protobuf.Empty - 31, // 54: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalPathEnum:input_type -> grpc.gateway.examples.internal.pathenum.MessageWithPathEnum - 32, // 55: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalNestedPathEnum:input_type -> grpc.gateway.examples.internal.pathenum.MessageWithNestedPathEnum - 23, // 56: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckStatus:input_type -> google.protobuf.Empty - 6, // 57: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Exists:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 58: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CustomOptionsRequest:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 59: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.TraceRequest:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 33, // 60: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostOneofEnum:input_type -> grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage - 23, // 61: grpc.gateway.examples.internal.proto.examplepb.camelCaseServiceName.Empty:input_type -> google.protobuf.Empty - 23, // 62: grpc.gateway.examples.internal.proto.examplepb.AnotherServiceWithNoBindings.NoBindings:input_type -> google.protobuf.Empty - 15, // 63: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumService.SnakeEnum:input_type -> grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest - 6, // 64: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Create:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 65: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBody:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 12, // 66: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBook:output_type -> grpc.gateway.examples.internal.proto.examplepb.Book - 12, // 67: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateBook:output_type -> grpc.gateway.examples.internal.proto.examplepb.Book - 6, // 68: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Lookup:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 69: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Custom:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 70: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DoubleColon:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 23, // 71: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Update:output_type -> google.protobuf.Empty - 23, // 72: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateV2:output_type -> google.protobuf.Empty - 23, // 73: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Delete:output_type -> google.protobuf.Empty - 23, // 74: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetQuery:output_type -> google.protobuf.Empty - 7, // 75: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetRepeatedQuery:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated - 29, // 76: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Echo:output_type -> grpc.gateway.examples.internal.proto.sub.StringMessage - 6, // 77: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DeepPathEcho:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 23, // 78: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.NoBindings:output_type -> google.protobuf.Empty - 23, // 79: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Timeout:output_type -> google.protobuf.Empty - 23, // 80: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.ErrorWithDetails:output_type -> google.protobuf.Empty - 23, // 81: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetMessageWithBody:output_type -> google.protobuf.Empty - 23, // 82: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostWithEmptyBody:output_type -> google.protobuf.Empty - 6, // 83: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckGetQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 84: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckNestedEnumGetQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 6, // 85: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckPostQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 34, // 86: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.OverwriteResponseContentType:output_type -> google.protobuf.StringValue - 23, // 87: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalPathEnum:output_type -> google.protobuf.Empty - 23, // 88: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalNestedPathEnum:output_type -> google.protobuf.Empty - 8, // 89: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckStatus:output_type -> grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse - 23, // 90: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Exists:output_type -> google.protobuf.Empty - 23, // 91: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CustomOptionsRequest:output_type -> google.protobuf.Empty - 6, // 92: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.TraceRequest:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything - 23, // 93: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostOneofEnum:output_type -> google.protobuf.Empty - 23, // 94: grpc.gateway.examples.internal.proto.examplepb.camelCaseServiceName.Empty:output_type -> google.protobuf.Empty - 23, // 95: grpc.gateway.examples.internal.proto.examplepb.AnotherServiceWithNoBindings.NoBindings:output_type -> google.protobuf.Empty - 16, // 96: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumService.SnakeEnum:output_type -> grpc.gateway.examples.internal.proto.examplepb.SnakeEnumResponse - 64, // [64:97] is the sub-list for method output_type - 31, // [31:64] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 30, // 27: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest.where:type_name -> grpc.gateway.examples.internal.pathenum.snake_case_for_import + 19, // 28: grpc.gateway.examples.internal.proto.examplepb.UpdateChildRequest.child:type_name -> grpc.gateway.examples.internal.proto.examplepb.Child + 3, // 29: grpc.gateway.examples.internal.proto.examplepb.Child.type:type_name -> grpc.gateway.examples.internal.proto.examplepb.ChildType + 4, // 30: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.ok:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested.DeepEnum + 0, // 31: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MapValueEntry.value:type_name -> grpc.gateway.examples.internal.proto.examplepb.NumericEnum + 20, // 32: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.MappedNestedValueEntry.value:type_name -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything.Nested + 7, // 33: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Create:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 34: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 14, // 35: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBook:input_type -> grpc.gateway.examples.internal.proto.examplepb.CreateBookRequest + 15, // 36: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateBook:input_type -> grpc.gateway.examples.internal.proto.examplepb.UpdateBookRequest + 31, // 37: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Lookup:input_type -> grpc.gateway.examples.internal.proto.sub2.IdMessage + 7, // 38: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Custom:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 39: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DoubleColon:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 40: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Update:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 12, // 41: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateV2:input_type -> grpc.gateway.examples.internal.proto.examplepb.UpdateV2Request + 31, // 42: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Delete:input_type -> grpc.gateway.examples.internal.proto.sub2.IdMessage + 7, // 43: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetQuery:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 8, // 44: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetRepeatedQuery:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated + 32, // 45: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Echo:input_type -> grpc.gateway.examples.internal.proto.sub.StringMessage + 7, // 46: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DeepPathEcho:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 33, // 47: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.NoBindings:input_type -> google.protobuf.Duration + 26, // 48: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Timeout:input_type -> google.protobuf.Empty + 26, // 49: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.ErrorWithDetails:input_type -> google.protobuf.Empty + 11, // 50: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetMessageWithBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.MessageWithBody + 10, // 51: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostWithEmptyBody:input_type -> grpc.gateway.examples.internal.proto.examplepb.Body + 7, // 52: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckGetQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 53: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckNestedEnumGetQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 54: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckPostQueryParams:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 26, // 55: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.OverwriteResponseContentType:input_type -> google.protobuf.Empty + 34, // 56: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalPathEnum:input_type -> grpc.gateway.examples.internal.pathenum.MessageWithPathEnum + 35, // 57: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalNestedPathEnum:input_type -> grpc.gateway.examples.internal.pathenum.MessageWithNestedPathEnum + 26, // 58: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckStatus:input_type -> google.protobuf.Empty + 7, // 59: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Exists:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 60: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CustomOptionsRequest:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 61: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.TraceRequest:input_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 36, // 62: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostOneofEnum:input_type -> grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage + 26, // 63: grpc.gateway.examples.internal.proto.examplepb.camelCaseServiceName.Empty:input_type -> google.protobuf.Empty + 26, // 64: grpc.gateway.examples.internal.proto.examplepb.AnotherServiceWithNoBindings.NoBindings:input_type -> google.protobuf.Empty + 16, // 65: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumService.SnakeEnum:input_type -> grpc.gateway.examples.internal.proto.examplepb.SnakeEnumRequest + 18, // 66: grpc.gateway.examples.internal.proto.examplepb.ParentChildService.UpdateChild:input_type -> grpc.gateway.examples.internal.proto.examplepb.UpdateChildRequest + 7, // 67: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Create:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 68: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBody:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 13, // 69: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CreateBook:output_type -> grpc.gateway.examples.internal.proto.examplepb.Book + 13, // 70: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateBook:output_type -> grpc.gateway.examples.internal.proto.examplepb.Book + 7, // 71: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Lookup:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 72: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Custom:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 73: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DoubleColon:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 26, // 74: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Update:output_type -> google.protobuf.Empty + 26, // 75: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.UpdateV2:output_type -> google.protobuf.Empty + 26, // 76: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Delete:output_type -> google.protobuf.Empty + 26, // 77: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetQuery:output_type -> google.protobuf.Empty + 8, // 78: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetRepeatedQuery:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingRepeated + 32, // 79: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Echo:output_type -> grpc.gateway.examples.internal.proto.sub.StringMessage + 7, // 80: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.DeepPathEcho:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 26, // 81: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.NoBindings:output_type -> google.protobuf.Empty + 26, // 82: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Timeout:output_type -> google.protobuf.Empty + 26, // 83: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.ErrorWithDetails:output_type -> google.protobuf.Empty + 26, // 84: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.GetMessageWithBody:output_type -> google.protobuf.Empty + 26, // 85: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostWithEmptyBody:output_type -> google.protobuf.Empty + 7, // 86: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckGetQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 87: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckNestedEnumGetQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 7, // 88: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckPostQueryParams:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 37, // 89: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.OverwriteResponseContentType:output_type -> google.protobuf.StringValue + 26, // 90: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalPathEnum:output_type -> google.protobuf.Empty + 26, // 91: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckExternalNestedPathEnum:output_type -> google.protobuf.Empty + 9, // 92: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CheckStatus:output_type -> grpc.gateway.examples.internal.proto.examplepb.CheckStatusResponse + 26, // 93: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.Exists:output_type -> google.protobuf.Empty + 26, // 94: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.CustomOptionsRequest:output_type -> google.protobuf.Empty + 7, // 95: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.TraceRequest:output_type -> grpc.gateway.examples.internal.proto.examplepb.ABitOfEverything + 26, // 96: grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService.PostOneofEnum:output_type -> google.protobuf.Empty + 26, // 97: grpc.gateway.examples.internal.proto.examplepb.camelCaseServiceName.Empty:output_type -> google.protobuf.Empty + 26, // 98: grpc.gateway.examples.internal.proto.examplepb.AnotherServiceWithNoBindings.NoBindings:output_type -> google.protobuf.Empty + 17, // 99: grpc.gateway.examples.internal.proto.examplepb.SnakeEnumService.SnakeEnum:output_type -> grpc.gateway.examples.internal.proto.examplepb.SnakeEnumResponse + 19, // 100: grpc.gateway.examples.internal.proto.examplepb.ParentChildService.UpdateChild:output_type -> grpc.gateway.examples.internal.proto.examplepb.Child + 67, // [67:101] is the sub-list for method output_type + 33, // [33:67] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name } func init() { file_examples_internal_proto_examplepb_a_bit_of_everything_proto_init() } @@ -2920,6 +3120,30 @@ func file_examples_internal_proto_examplepb_a_bit_of_everything_proto_init() { } } file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateChildRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Child); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_examples_internal_proto_examplepb_a_bit_of_everything_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ABitOfEverything_Nested); i { case 0: return &v.state @@ -2941,10 +3165,10 @@ func file_examples_internal_proto_examplepb_a_bit_of_everything_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDesc, - NumEnums: 4, - NumMessages: 17, + NumEnums: 5, + NumMessages: 19, NumExtensions: 0, - NumServices: 4, + NumServices: 5, }, GoTypes: file_examples_internal_proto_examplepb_a_bit_of_everything_proto_goTypes, DependencyIndexes: file_examples_internal_proto_examplepb_a_bit_of_everything_proto_depIdxs, diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go b/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go index d81c2b123b4..ed975ad7b3a 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/internal/proto/examplepb/a_bit_of_everything.pb.gw.go @@ -2681,11 +2681,11 @@ func request_ABitOfEverythingService_PostOneofEnum_0(ctx context.Context, marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } if protoReq.One == nil { - protoReq.One = &oneofenum.OneofEnumMessage_ExampleEnum{} - } else if _, ok := protoReq.One.(*oneofenum.OneofEnumMessage_ExampleEnum); !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "expect type: *oneofenum.OneofEnumMessage_ExampleEnum, but: %t\n", protoReq.One) + protoReq.One = &OneofEnumMessage_ExampleEnum{} + } else if _, ok := protoReq.One.(*OneofEnumMessage_ExampleEnum); !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "expect type: *OneofEnumMessage_ExampleEnum, but: %t\n", protoReq.One) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.One.(*oneofenum.OneofEnumMessage_ExampleEnum).ExampleEnum); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.One.(*OneofEnumMessage_ExampleEnum).ExampleEnum); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -2703,11 +2703,11 @@ func local_request_ABitOfEverythingService_PostOneofEnum_0(ctx context.Context, return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } if protoReq.One == nil { - protoReq.One = &oneofenum.OneofEnumMessage_ExampleEnum{} - } else if _, ok := protoReq.One.(*oneofenum.OneofEnumMessage_ExampleEnum); !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "expect type: *oneofenum.OneofEnumMessage_ExampleEnum, but: %t\n", protoReq.One) + protoReq.One = &OneofEnumMessage_ExampleEnum{} + } else if _, ok := protoReq.One.(*OneofEnumMessage_ExampleEnum); !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "expect type: *OneofEnumMessage_ExampleEnum, but: %t\n", protoReq.One) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.One.(*oneofenum.OneofEnumMessage_ExampleEnum).ExampleEnum); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.One.(*OneofEnumMessage_ExampleEnum).ExampleEnum); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -2840,6 +2840,110 @@ func local_request_SnakeEnumService_SnakeEnum_0(ctx context.Context, marshaler r } +func request_ParentChildService_UpdateChild_0(ctx context.Context, marshaler runtime.Marshaler, client ParentChildServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateChildRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Child); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + e int32 + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + val, ok = pathParams["child.type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "child.type") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "child.type", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "child.type", err) + } + + e, err = runtime.Enum(val, ChildType_value) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "could not parse path as enum value, parameter: %s, error: %v", "child.type", err) + } + + protoReq.Child.Type = ChildType(e) + + msg, err := client.UpdateChild(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ParentChildService_UpdateChild_0(ctx context.Context, marshaler runtime.Marshaler, server ParentChildServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateChildRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Child); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + e int32 + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + val, ok = pathParams["child.type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "child.type") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "child.type", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "child.type", err) + } + + e, err = runtime.Enum(val, ChildType_value) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "could not parse path as enum value, parameter: %s, error: %v", "child.type", err) + } + + protoReq.Child.Type = ChildType(e) + + msg, err := server.UpdateChild(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterABitOfEverythingServiceHandlerServer registers the http handlers for service ABitOfEverythingService to "mux". // UnaryRPC :call ABitOfEverythingServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -3742,6 +3846,40 @@ func RegisterSnakeEnumServiceHandlerServer(ctx context.Context, mux *runtime.Ser return nil } +// RegisterParentChildServiceHandlerServer registers the http handlers for service ParentChildService to "mux". +// UnaryRPC :call ParentChildServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterParentChildServiceHandlerFromEndpoint instead. +func RegisterParentChildServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ParentChildServiceServer) error { + + mux.Handle("PUT", pattern_ParentChildService_UpdateChild_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.ParentChildService/UpdateChild", runtime.WithHTTPPathPattern("/v1/{parent=child/*}/children/{child.type=*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ParentChildService_UpdateChild_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ParentChildService_UpdateChild_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + // RegisterABitOfEverythingServiceHandlerFromEndpoint is same as RegisterABitOfEverythingServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterABitOfEverythingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -4786,3 +4924,74 @@ var ( var ( forward_SnakeEnumService_SnakeEnum_0 = runtime.ForwardResponseMessage ) + +// RegisterParentChildServiceHandlerFromEndpoint is same as RegisterParentChildServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterParentChildServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterParentChildServiceHandler(ctx, mux, conn) +} + +// RegisterParentChildServiceHandler registers the http handlers for service ParentChildService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterParentChildServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterParentChildServiceHandlerClient(ctx, mux, NewParentChildServiceClient(conn)) +} + +// RegisterParentChildServiceHandlerClient registers the http handlers for service ParentChildService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ParentChildServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ParentChildServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ParentChildServiceClient" to call the correct interceptors. +func RegisterParentChildServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ParentChildServiceClient) error { + + mux.Handle("PUT", pattern_ParentChildService_UpdateChild_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.ParentChildService/UpdateChild", runtime.WithHTTPPathPattern("/v1/{parent=child/*}/children/{child.type=*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ParentChildService_UpdateChild_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ParentChildService_UpdateChild_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ParentChildService_UpdateChild_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "child", "parent", "children", "child.type"}, "")) +) + +var ( + forward_ParentChildService_UpdateChild_0 = runtime.ForwardResponseMessage +) diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.proto b/examples/internal/proto/examplepb/a_bit_of_everything.proto index 2188fb19ba7..63cc3531106 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.proto +++ b/examples/internal/proto/examplepb/a_bit_of_everything.proto @@ -843,3 +843,32 @@ message SnakeEnumRequest { } message SnakeEnumResponse {} + +service ParentChildService { + rpc UpdateChild (UpdateChildRequest) returns (Child) { + option (google.api.http) = { + put: "/v1/{parent=child/*}/children/{child.type=*}" + body: "child" + }; + } +} + +message UpdateChildRequest { + // The parent resource + string parent = 1; + + // The X to set. + Child child = 2; +} + +enum ChildType { + TYPE_UNDEFINED = 0; + TYPE_A = 1; + TYPE_B = 2; +} + +message Child { + ChildType type = 1; + string name = 2; +} + diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json index 76532ad75b2..2d2feb6af42 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json +++ b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json @@ -31,6 +31,9 @@ }, { "name": "SnakeEnumService" + }, + { + "name": "ParentChildService" } ], "schemes": [ @@ -551,7 +554,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -945,7 +948,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -1328,7 +1331,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -1729,7 +1732,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -2134,7 +2137,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -2414,7 +2417,7 @@ "required": [ "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -2797,7 +2800,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -3173,7 +3176,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -3573,7 +3576,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -3973,7 +3976,7 @@ { "name": "required_field_schema_json_name_custom", "in": "query", - "required": true, + "required": false, "type": "string" } ], @@ -4674,7 +4677,7 @@ "uuid", "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -4988,6 +4991,88 @@ ] } }, + "/v1/{parent}/children/{child.type}": { + "put": { + "operationId": "ParentChildService_UpdateChild", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/examplepbChild" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "418": { + "description": "I'm a teapot.", + "schema": { + "$ref": "#/definitions/examplepbNumericEnum" + } + }, + "500": { + "description": "Server error", + "schema": { + "$ref": "#/definitions/examplepbErrorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The parent resource", + "in": "path", + "required": true, + "type": "string", + "pattern": "child/[^/]+" + }, + { + "name": "child.type", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "TYPE_UNDEFINED", + "TYPE_A", + "TYPE_B" + ], + "pattern": "[^/]+" + }, + { + "name": "child", + "description": "The X to set.", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "title": "The X to set." + } + } + ], + "tags": [ + "ParentChildService" + ] + } + }, "/v2/example/a_bit_of_everything/{uuidName}": { "put": { "operationId": "ABitOfEverythingService_UpdateV2", @@ -5260,7 +5345,7 @@ "required": [ "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -5553,7 +5638,7 @@ "required": [ "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -6364,7 +6449,7 @@ "required": [ "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -6702,7 +6787,7 @@ "uuid", "int64Value", "doubleValue", - "required_field_schema_json_name_custom", + "requiredFieldSchemaJsonName", "floatValue", "requiredStringViaFieldBehaviorAnnotation", "requiredStringField1", @@ -6877,6 +6962,26 @@ } } }, + "examplepbChild": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/examplepbChildType" + }, + "name": { + "type": "string" + } + } + }, + "examplepbChildType": { + "type": "string", + "enum": [ + "TYPE_UNDEFINED", + "TYPE_A", + "TYPE_B" + ], + "default": "TYPE_UNDEFINED" + }, "examplepbErrorObject": { "type": "object", "properties": { @@ -6978,7 +7083,7 @@ } }, "additionalProperties": {}, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" + "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "rpcStatus": { "type": "object", diff --git a/examples/internal/proto/examplepb/a_bit_of_everything_grpc.pb.go b/examples/internal/proto/examplepb/a_bit_of_everything_grpc.pb.go index 4227137bd23..380a9cf9859 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything_grpc.pb.go +++ b/examples/internal/proto/examplepb/a_bit_of_everything_grpc.pb.go @@ -1422,3 +1422,87 @@ var SnakeEnumService_ServiceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "examples/internal/proto/examplepb/a_bit_of_everything.proto", } + +// ParentChildServiceClient is the client API for ParentChildService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ParentChildServiceClient interface { + UpdateChild(ctx context.Context, in *UpdateChildRequest, opts ...grpc.CallOption) (*Child, error) +} + +type parentChildServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewParentChildServiceClient(cc grpc.ClientConnInterface) ParentChildServiceClient { + return &parentChildServiceClient{cc} +} + +func (c *parentChildServiceClient) UpdateChild(ctx context.Context, in *UpdateChildRequest, opts ...grpc.CallOption) (*Child, error) { + out := new(Child) + err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.ParentChildService/UpdateChild", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ParentChildServiceServer is the server API for ParentChildService service. +// All implementations should embed UnimplementedParentChildServiceServer +// for forward compatibility +type ParentChildServiceServer interface { + UpdateChild(context.Context, *UpdateChildRequest) (*Child, error) +} + +// UnimplementedParentChildServiceServer should be embedded to have forward compatible implementations. +type UnimplementedParentChildServiceServer struct { +} + +func (UnimplementedParentChildServiceServer) UpdateChild(context.Context, *UpdateChildRequest) (*Child, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChild not implemented") +} + +// UnsafeParentChildServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ParentChildServiceServer will +// result in compilation errors. +type UnsafeParentChildServiceServer interface { + mustEmbedUnimplementedParentChildServiceServer() +} + +func RegisterParentChildServiceServer(s grpc.ServiceRegistrar, srv ParentChildServiceServer) { + s.RegisterService(&ParentChildService_ServiceDesc, srv) +} + +func _ParentChildService_UpdateChild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateChildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ParentChildServiceServer).UpdateChild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.ParentChildService/UpdateChild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ParentChildServiceServer).UpdateChild(ctx, req.(*UpdateChildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ParentChildService_ServiceDesc is the grpc.ServiceDesc for ParentChildService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ParentChildService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.gateway.examples.internal.proto.examplepb.ParentChildService", + HandlerType: (*ParentChildServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateChild", + Handler: _ParentChildService_UpdateChild_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "examples/internal/proto/examplepb/a_bit_of_everything.proto", +} From ffd3b3be54387913e7190d53d2cd130565e6fe26 Mon Sep 17 00:00:00 2001 From: Alexander Adhyatma Date: Mon, 26 Sep 2022 08:20:15 +0700 Subject: [PATCH 2/3] style(codegen-uninitialized-struct): formatting formatting Signed-off-by: Alexander Adhyatma --- .../proto/examplepb/a_bit_of_everything.proto | 874 ------------------ 1 file changed, 874 deletions(-) diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.proto b/examples/internal/proto/examplepb/a_bit_of_everything.proto index 63cc3531106..e69de29bb2d 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.proto +++ b/examples/internal/proto/examplepb/a_bit_of_everything.proto @@ -1,874 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.examples.internal.proto.examplepb; - -import "examples/internal/proto/oneofenum/oneof_enum.proto"; -import "examples/internal/proto/pathenum/path_enum.proto"; -import "examples/internal/proto/sub/message.proto"; -import "examples/internal/proto/sub2/message.proto"; -import "google/api/annotations.proto"; -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb"; -option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { - info: { - title: "A Bit of Everything"; - version: "1.0"; - contact: { - name: "gRPC-Gateway project"; - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - email: "none@example.com"; - }; - license: { - name: "BSD 3-Clause License"; - url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; - }; - extensions: { - key: "x-something-something"; - value { - string_value: "yadda"; - } - } - }; - // Overwriting host entry breaks tests, so this is not done here. - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "More about gRPC-Gateway"; - } - schemes: HTTP; - schemes: HTTPS; - schemes: WSS; - consumes: "application/json"; - consumes: "application/x-foo-mime"; - produces: "application/json"; - produces: "application/x-foo-mime"; - security_definitions: { - security: { - key: "BasicAuth"; - value: { - type: TYPE_BASIC; - } - } - security: { - key: "ApiKeyAuth"; - value: { - type: TYPE_API_KEY; - in: IN_HEADER; - name: "X-API-Key"; - extensions: { - key: "x-amazon-apigateway-authtype"; - value { - string_value: "oauth2"; - } - } - extensions: { - key: "x-amazon-apigateway-authorizer"; - value { - struct_value { - fields { - key: "type"; - value { - string_value: "token"; - } - } - fields { - key: "authorizerResultTtlInSeconds"; - value { - number_value: 60; - } - } - } - } - } - } - } - security: { - key: "OAuth2"; - value: { - type: TYPE_OAUTH2; - flow: FLOW_ACCESS_CODE; - authorization_url: "https://example.com/oauth/authorize"; - token_url: "https://example.com/oauth/token"; - scopes: { - scope: { - key: "read"; - value: "Grants read access"; - } - scope: { - key: "write"; - value: "Grants write access"; - } - scope: { - key: "admin"; - value: "Grants read and write access to administrative information"; - } - } - } - } - } - security: { - security_requirement: { - key: "BasicAuth"; - value: {}; - } - security_requirement: { - key: "ApiKeyAuth"; - value: {}; - } - } - security: { - security_requirement: { - key: "OAuth2"; - value: { - scope: "read"; - scope: "write"; - } - } - security_requirement: { - key: "ApiKeyAuth"; - value: {}; - } - } - responses: { - key: "403"; - value: { - description: "Returned when the user does not have permission to access the resource."; - } - } - responses: { - key: "404"; - value: { - description: "Returned when the resource does not exist."; - schema: { - json_schema: { - type: STRING; - } - } - } - } - responses: { - key: "418"; - value: { - description: "I'm a teapot."; - schema: { - json_schema: { - ref: ".grpc.gateway.examples.internal.proto.examplepb.NumericEnum"; - } - } - } - } - responses: { - key: "500"; - value: { - description: "Server error"; - headers: { - key: "X-Correlation-Id" - value: { - description: "Unique event identifier for server requests" - type: "string" - format: "uuid" - default: "\"2438ac3c-37eb-4902-adef-ed16b4431030\"" - pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" - } - }; - schema: { - json_schema: { - ref: ".grpc.gateway.examples.internal.proto.examplepb.ErrorResponse"; - } - } - } - } - extensions: { - key: "x-grpc-gateway-foo"; - value { - string_value: "bar"; - } - } - extensions: { - key: "x-grpc-gateway-baz-list"; - value { - list_value: { - values: { - string_value: "one"; - } - values: { - bool_value: true; - } - } - } - } -}; - -message ErrorResponse { - string correlationId = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$", - title: "x-correlation-id", - description: "Unique event identifier for server requests", - format: "uuid", - example: "\"2438ac3c-37eb-4902-adef-ed16b4431030\"" - }]; - ErrorObject error = 2; -} - -message ErrorObject { - int32 code = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - pattern: "^[0-9]$", - title: "code", - description: "Response code", - format: "integer" - }]; - string message = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - pattern: "^[a-zA-Z0-9]{1, 32}$", - title: "message", - description: "Response message" - }]; -} - -// Intentionally complicated message type to cover many features of Protobuf. -message ABitOfEverything { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - json_schema: { - title: "A bit of everything" - description: "Intentionally complicated message type to cover many features of Protobuf." - required: [ - "uuid", - "int64_value", - "double_value", - "required_field_schema_json_name" - ] - extensions: { - key: "x-a-bit-of-everything-foo"; - value { - string_value: "bar"; - } - } - } - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "Find out more about ABitOfEverything"; - } - example: "{\"int64_value\": 12, \"double_value\": 12.3}" - }; - - // Nested is nested type. - message Nested { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - example: "{\"ok\": \"TRUE\"}" - }; - // name is nested field. - string name = 1; - uint32 amount = 2; - // DeepEnum is one or zero. - enum DeepEnum { - // FALSE is false. - FALSE = 0; - // TRUE is true. - TRUE = 1; - } - - // DeepEnum comment. - DeepEnum ok = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - description: "DeepEnum description." - }]; - } - Nested single_nested = 25; - - string uuid = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", - min_length: 1, - field_configuration: { - path_param_name: "uuidName" - }, - extensions: { - key: "x-internal"; - value { - bool_value: true - } - } - }]; - repeated Nested nested = 2; - float float_value = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - description: "Float value field", - default: "0.2", - required: [ - "float_value" - ] - }]; - double double_value = 4; - int64 int64_value = 5; - uint64 uint64_value = 6; - int32 int32_value = 7; - fixed64 fixed64_value = 8; - fixed32 fixed32_value = 9; - bool bool_value = 10; - string string_value = 11; - bytes bytes_value = 29; - uint32 uint32_value = 13; - NumericEnum enum_value = 14; - pathenum.PathEnum path_enum_value = 30; - pathenum.MessagePathEnum.NestedPathEnum nested_path_enum_value = 31; - sfixed32 sfixed32_value = 15; - sfixed64 sfixed64_value = 16; - sint32 sint32_value = 17; - sint64 sint64_value = 18; - repeated string repeated_string_value = 19; - oneof oneof_value { - google.protobuf.Empty oneof_empty = 20; - string oneof_string = 21; - } - - map map_value = 22; - map mapped_string_value = 23; - map mapped_nested_value = 24; - - string nonConventionalNameValue = 26; - - google.protobuf.Timestamp timestamp_value = 27; - - // repeated enum value. it is comma-separated in query - repeated NumericEnum repeated_enum_value = 28; - - // repeated numeric enum comment (This comment is overridden by the field annotation) - repeated NumericEnum repeated_enum_annotation = 32 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - title: "Repeated numeric enum title", - description: "Repeated numeric enum description." - }]; - - // numeric enum comment (This comment is overridden by the field annotation) - NumericEnum enum_value_annotation = 33 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - title: "Numeric enum title", - description: "Numeric enum description." - }]; - - // repeated string comment (This comment is overridden by the field annotation) - repeated string repeated_string_annotation = 34 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - title: "Repeated string title", - description: "Repeated string description." - }]; - - // repeated nested object comment (This comment is overridden by the field annotation) - repeated Nested repeated_nested_annotation = 35 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - title: "Repeated nested object title", - description: "Repeated nested object description." - }]; - - // nested object comments (This comment is overridden by the field annotation) - Nested nested_annotation = 36 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - title: "Nested object title", - description: "Nested object description." - }]; - - int64 int64_override_type = 37 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - type: INTEGER - }]; - - // mark a field as required in Open API definition - string required_string_via_field_behavior_annotation = 38 [(google.api.field_behavior) = REQUIRED]; - - // mark a field as readonly in Open API definition - string output_only_string_via_field_behavior_annotation = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; - - optional string optional_string_value = 40; - - // Test openapiv2 generation of repeated fields - repeated string product_id = 41 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { - pattern: "^[0-9]+$" - max_length: 19 - min_length: 1 - description: "Only digits are allowed." - }]; - - // Test openapiv2 generation of required fields with annotation and jsonschema to reproduce - string optional_string_field = 42; - string required_string_field_1 = 43 [(google.api.field_behavior) = REQUIRED]; - string required_string_field_2 = 44 [(google.api.field_behavior) = REQUIRED]; - - // Test openapiv2 handling of required json_name fields - string required_field_behavior_json_name = 45 [ - json_name = "required_field_behavior_json_name_custom", - (google.api.field_behavior) = REQUIRED - ]; - string required_field_schema_json_name = 46 [json_name = "required_field_schema_json_name_custom"]; -} - -// ABitOfEverythingRepeated is used to validate repeated path parameter functionality -message ABitOfEverythingRepeated { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - example: "{\"path_repeated_bool_value\": [true, true, false, true], \"path_repeated_int32_value\": [1, 2, 3]}" - }; - - // repeated values. they are comma-separated in path - repeated float path_repeated_float_value = 1; - repeated double path_repeated_double_value = 2; - repeated int64 path_repeated_int64_value = 3; - repeated uint64 path_repeated_uint64_value = 4; - repeated int32 path_repeated_int32_value = 5; - repeated fixed64 path_repeated_fixed64_value = 6; - repeated fixed32 path_repeated_fixed32_value = 7; - repeated bool path_repeated_bool_value = 8; - repeated string path_repeated_string_value = 9; - repeated bytes path_repeated_bytes_value = 10; - repeated uint32 path_repeated_uint32_value = 11; - repeated NumericEnum path_repeated_enum_value = 12; - repeated sfixed32 path_repeated_sfixed32_value = 13; - repeated sfixed64 path_repeated_sfixed64_value = 14; - repeated sint32 path_repeated_sint32_value = 15; - repeated sint64 path_repeated_sint64_value = 16; -} - -message CheckStatusResponse { - google.rpc.Status status = 1; -} - -message Body { - string name = 1; -} - -message MessageWithBody { - string id = 1; - Body data = 2; -} - -// NumericEnum is one or zero. -enum NumericEnum { - // ZERO means 0 - ZERO = 0; - // ONE means 1 - ONE = 1; -} - -// UpdateV2Request request for update includes the message and the update mask -message UpdateV2Request { - ABitOfEverything abe = 1; - // The paths to update. - google.protobuf.FieldMask update_mask = 2; -} - -// An example resource type from AIP-123 used to test the behavior described in -// the CreateBookRequest message. -// -// See: https://google.aip.dev/123 -message Book { - // The resource name of the book. - // - // Format: `publishers/{publisher}/books/{book}` - // - // Example: `publishers/1257894000000000000/books/my-book` - string name = 1; - - // Output only. The book's ID. - string id = 2; - - // Output only. Creation time of the book. - google.protobuf.Timestamp create_time = 3; -} - -// A standard Create message from AIP-133 with a user-specified ID. -// The user-specified ID (the `book_id` field in this example) must become a -// query parameter in the OpenAPI spec. -// -// See: https://google.aip.dev/133#user-specified-ids -message CreateBookRequest { - // The publisher in which to create the book. - // - // Format: `publishers/{publisher}` - // - // Example: `publishers/1257894000000000000` - string parent = 1; - - // The book to create. - Book book = 2; - - // The ID to use for the book. - // - // This must start with an alphanumeric character. - string book_id = 3; -} - -// A standard Update message from AIP-134 -// -// See: https://google.aip.dev/134#request-message -message UpdateBookRequest { - // The book to update. - // - // The book's `name` field is used to identify the book to be updated. - // Format: publishers/{publisher}/books/{book} - Book book = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; - - // If set to true, and the book is not found, a new book will be created. - // In this situation, `update_mask` is ignored. - bool allow_missing = 3; -} - -// ABitOfEverything service is used to validate that APIs with complicated -// proto messages and URL templates are still processed correctly. -service ABitOfEverythingService { - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = { - description: "ABitOfEverythingService description -- which should not be used in place of the documentation comment!" - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "Find out more about EchoService"; - } - }; - - // Create a new ABitOfEverything - // - // This API creates a new ABitOfEverything - rpc Create(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - 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}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{enum_value_annotation}" - }; - } - rpc CreateBody(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - post: "/v1/example/a_bit_of_everything" - body: "*" - }; - } - // Create a book. - rpc CreateBook(CreateBookRequest) returns (Book) { - option (google.api.http) = { - post: "/v1/{parent=publishers/*}/books" - body: "book" - }; - } - rpc UpdateBook(UpdateBookRequest) returns (Book) { - option (google.api.http) = { - patch: "/v1/{book.name=publishers/*/books/*}" - body: "book" - }; - } - rpc Lookup(grpc.gateway.examples.internal.proto.sub2.IdMessage) returns (ABitOfEverything) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything/{uuid}" - }; - } - rpc Custom(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - post: "/v1/example/a_bit_of_everything/{uuid}:custom" - }; - } - rpc DoubleColon(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - post: "/v1/example/a_bit_of_everything/{uuid}:custom:custom" - }; - } - rpc Update(ABitOfEverything) returns (google.protobuf.Empty) { - option (google.api.http) = { - put: "/v1/example/a_bit_of_everything/{uuid}" - body: "*" - }; - } - rpc UpdateV2(UpdateV2Request) returns (google.protobuf.Empty) { - option (google.api.http) = { - put: "/v2/example/a_bit_of_everything/{abe.uuid}" - body: "abe" - additional_bindings: [ - { - patch: "/v2/example/a_bit_of_everything/{abe.uuid}" - body: "abe" - }, - { - patch: "/v2a/example/a_bit_of_everything/{abe.uuid}" - body: "*" - } - ] - }; - } - - rpc Delete(grpc.gateway.examples.internal.proto.sub2.IdMessage) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/example/a_bit_of_everything/{uuid}" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - security: { - security_requirement: { - key: "ApiKeyAuth"; - value: {} - } - security_requirement: { - key: "OAuth2"; - value: { - scope: "read"; - scope: "write"; - } - } - } - extensions: { - key: "x-irreversible"; - value { - bool_value: true; - } - } - }; - } - rpc GetQuery(ABitOfEverything) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything/query/{uuid}" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - deprecated: true // For testing purposes. - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "Find out more about GetQuery"; - } - security: {} - }; - } - rpc GetRepeatedQuery(ABitOfEverythingRepeated) returns (ABitOfEverythingRepeated) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything_repeated/{path_repeated_float_value}/{path_repeated_double_value}/{path_repeated_int64_value}/{path_repeated_uint64_value}/{path_repeated_int32_value}/{path_repeated_fixed64_value}/{path_repeated_fixed32_value}/{path_repeated_bool_value}/{path_repeated_string_value}/{path_repeated_bytes_value}/{path_repeated_uint32_value}/{path_repeated_enum_value}/{path_repeated_sfixed32_value}/{path_repeated_sfixed64_value}/{path_repeated_sint32_value}/{path_repeated_sint64_value}" - }; - } - // Echo allows posting a StringMessage value. - // - // It also exposes multiple bindings. - // - // This makes it useful when validating that the OpenAPI v2 API - // description exposes documentation correctly on all paths - // defined as additional_bindings in the proto. - rpc Echo(grpc.gateway.examples.internal.proto.sub.StringMessage) returns (grpc.gateway.examples.internal.proto.sub.StringMessage) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything/echo/{value}" - additional_bindings { - post: "/v2/example/echo" - body: "value" - } - additional_bindings { - get: "/v2/example/echo" - } - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - description: "Description Echo"; - summary: "Summary: Echo rpc"; - tags: "echo rpc"; - external_docs: { - url: "https://github.com/grpc-ecosystem/grpc-gateway"; - description: "Find out more Echo"; - } - responses: { - key: "200" - value: { - examples: { - key: "application/json" - value: "{\"value\": \"the input value\"}" - } - } - } - responses: { - key: "503"; - value: { - description: "Returned when the resource is temporarily unavailable."; - extensions: { - key: "x-number"; - value { - number_value: 100; - } - } - } - } - responses: { - // Overwrites global definition. - key: "404"; - value: { - description: "Returned when the resource does not exist."; - schema: { - json_schema: { - type: INTEGER; - } - } - } - } - }; - } - rpc DeepPathEcho(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - post: "/v1/example/deep_path/{single_nested.name}" - body: "*" - }; - } - rpc NoBindings(google.protobuf.Duration) returns (google.protobuf.Empty) {} - rpc Timeout(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v2/example/timeout", - }; - } - rpc ErrorWithDetails(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v2/example/errorwithdetails", - }; - } - rpc GetMessageWithBody(MessageWithBody) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/example/withbody/{id}", - body: "data" - }; - } - rpc PostWithEmptyBody(Body) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/example/postwithemptybody/{name}", - body: "*" - }; - } - rpc CheckGetQueryParams(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything/params/get/{single_nested.name}" - }; - } - rpc CheckNestedEnumGetQueryParams(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - get: "/v1/example/a_bit_of_everything/params/get/nested_enum/{single_nested.ok}" - }; - } - rpc CheckPostQueryParams(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - post: "/v1/example/a_bit_of_everything/params/post/{string_value}" - body: "single_nested" - }; - } - rpc OverwriteResponseContentType(google.protobuf.Empty) returns (google.protobuf.StringValue) { - option (google.api.http) = { - get: "/v2/example/overwriteresponsecontenttype" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - produces: "application/text" - }; - } - rpc CheckExternalPathEnum(pathenum.MessageWithPathEnum) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v2/{value}:check" - }; - } - rpc CheckExternalNestedPathEnum(pathenum.MessageWithNestedPathEnum) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v3/{value}:check" - }; - } - - rpc CheckStatus(google.protobuf.Empty) returns (CheckStatusResponse) { - option (google.api.http) = { - get: "/v1/example/checkStatus" - }; - } - - rpc Exists(ABitOfEverything) returns (google.protobuf.Empty) { - option (google.api.http) = { - custom: { - kind: "HEAD", - path: "/v1/example/a_bit_of_everything/{uuid}" - } - }; - } - - rpc CustomOptionsRequest(ABitOfEverything) returns (google.protobuf.Empty) { - option (google.api.http) = { - custom: { - kind: "OPTIONS", - path: "/v1/example/a_bit_of_everything/{uuid}" - } - }; - } - - rpc TraceRequest(ABitOfEverything) returns (ABitOfEverything) { - option (google.api.http) = { - custom: { - kind: "TRACE", - path: "/v1/example/a_bit_of_everything/{uuid}" - } - }; - } - - rpc PostOneofEnum(grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/example/oneofenum" - body: "example_enum" - }; - } -} - -// camelCase and lowercase service names are valid but not recommended (use TitleCase instead) -service camelCaseServiceName { - rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/v2/example/empty", - }; - } -} -service AnotherServiceWithNoBindings { - rpc NoBindings(google.protobuf.Empty) returns (google.protobuf.Empty) {} -} - -service SnakeEnumService { - rpc SnakeEnum(SnakeEnumRequest) returns (SnakeEnumResponse) { - option (google.api.http) = { - get: "/v1/example/snake/{who}/{what}/{where}" - }; - } -} - -// Ignoring lint warnings as this enum type exist to validate proper functionality -// for projects that don't follow these lint rules. -// buf:lint:ignore ENUM_PASCAL_CASE -enum snake_case_enum { - // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_c = 0; - // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_d = 1; -} - -// Ignoring lint warnings as this enum type exist to validate proper functionality -// for projects that don't follow these lint rules. -// buf:lint:ignore ENUM_PASCAL_CASE -enum snake_case_0_enum { - // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_e = 0; - // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE - value_f = 1; -} - -message SnakeEnumRequest { - snake_case_enum what = 1; - snake_case_0_enum who = 2; - pathenum.snake_case_for_import where = 3; -} - -message SnakeEnumResponse {} - -service ParentChildService { - rpc UpdateChild (UpdateChildRequest) returns (Child) { - option (google.api.http) = { - put: "/v1/{parent=child/*}/children/{child.type=*}" - body: "child" - }; - } -} - -message UpdateChildRequest { - // The parent resource - string parent = 1; - - // The X to set. - Child child = 2; -} - -enum ChildType { - TYPE_UNDEFINED = 0; - TYPE_A = 1; - TYPE_B = 2; -} - -message Child { - ChildType type = 1; - string name = 2; -} - From 39434bff89df209c31ee2bca30c663056e4f56bf Mon Sep 17 00:00:00 2001 From: Alexander Adhyatma Date: Tue, 27 Sep 2022 10:40:34 +0700 Subject: [PATCH 3/3] fix(codegen-uninitialized-struct): accidentally removed a_bit_of_everything accidentally removed a_bit_of_everything Signed-off-by: Alexander Adhyatma --- .../proto/examplepb/a_bit_of_everything.proto | 873 ++++++++++++++++++ 1 file changed, 873 insertions(+) diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.proto b/examples/internal/proto/examplepb/a_bit_of_everything.proto index e69de29bb2d..eeb852f7d0a 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.proto +++ b/examples/internal/proto/examplepb/a_bit_of_everything.proto @@ -0,0 +1,873 @@ +syntax = "proto3"; + +package grpc.gateway.examples.internal.proto.examplepb; + +import "examples/internal/proto/oneofenum/oneof_enum.proto"; +import "examples/internal/proto/pathenum/path_enum.proto"; +import "examples/internal/proto/sub/message.proto"; +import "examples/internal/proto/sub2/message.proto"; +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "A Bit of Everything"; + version: "1.0"; + contact: { + name: "gRPC-Gateway project"; + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + email: "none@example.com"; + }; + license: { + name: "BSD 3-Clause License"; + url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt"; + }; + extensions: { + key: "x-something-something"; + value { + string_value: "yadda"; + } + } + }; + // Overwriting host entry breaks tests, so this is not done here. + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "More about gRPC-Gateway"; + } + schemes: HTTP; + schemes: HTTPS; + schemes: WSS; + consumes: "application/json"; + consumes: "application/x-foo-mime"; + produces: "application/json"; + produces: "application/x-foo-mime"; + security_definitions: { + security: { + key: "BasicAuth"; + value: { + type: TYPE_BASIC; + } + } + security: { + key: "ApiKeyAuth"; + value: { + type: TYPE_API_KEY; + in: IN_HEADER; + name: "X-API-Key"; + extensions: { + key: "x-amazon-apigateway-authtype"; + value { + string_value: "oauth2"; + } + } + extensions: { + key: "x-amazon-apigateway-authorizer"; + value { + struct_value { + fields { + key: "type"; + value { + string_value: "token"; + } + } + fields { + key: "authorizerResultTtlInSeconds"; + value { + number_value: 60; + } + } + } + } + } + } + } + security: { + key: "OAuth2"; + value: { + type: TYPE_OAUTH2; + flow: FLOW_ACCESS_CODE; + authorization_url: "https://example.com/oauth/authorize"; + token_url: "https://example.com/oauth/token"; + scopes: { + scope: { + key: "read"; + value: "Grants read access"; + } + scope: { + key: "write"; + value: "Grants write access"; + } + scope: { + key: "admin"; + value: "Grants read and write access to administrative information"; + } + } + } + } + } + security: { + security_requirement: { + key: "BasicAuth"; + value: {}; + } + security_requirement: { + key: "ApiKeyAuth"; + value: {}; + } + } + security: { + security_requirement: { + key: "OAuth2"; + value: { + scope: "read"; + scope: "write"; + } + } + security_requirement: { + key: "ApiKeyAuth"; + value: {}; + } + } + responses: { + key: "403"; + value: { + description: "Returned when the user does not have permission to access the resource."; + } + } + responses: { + key: "404"; + value: { + description: "Returned when the resource does not exist."; + schema: { + json_schema: { + type: STRING; + } + } + } + } + responses: { + key: "418"; + value: { + description: "I'm a teapot."; + schema: { + json_schema: { + ref: ".grpc.gateway.examples.internal.proto.examplepb.NumericEnum"; + } + } + } + } + responses: { + key: "500"; + value: { + description: "Server error"; + headers: { + key: "X-Correlation-Id" + value: { + description: "Unique event identifier for server requests" + type: "string" + format: "uuid" + default: "\"2438ac3c-37eb-4902-adef-ed16b4431030\"" + pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$" + } + }; + schema: { + json_schema: { + ref: ".grpc.gateway.examples.internal.proto.examplepb.ErrorResponse"; + } + } + } + } + extensions: { + key: "x-grpc-gateway-foo"; + value { + string_value: "bar"; + } + } + extensions: { + key: "x-grpc-gateway-baz-list"; + value { + list_value: { + values: { + string_value: "one"; + } + values: { + bool_value: true; + } + } + } + } +}; + +message ErrorResponse { + string correlationId = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + pattern: "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$", + title: "x-correlation-id", + description: "Unique event identifier for server requests", + format: "uuid", + example: "\"2438ac3c-37eb-4902-adef-ed16b4431030\"" + }]; + ErrorObject error = 2; +} + +message ErrorObject { + int32 code = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + pattern: "^[0-9]$", + title: "code", + description: "Response code", + format: "integer" + }]; + string message = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + pattern: "^[a-zA-Z0-9]{1, 32}$", + title: "message", + description: "Response message" + }]; +} + +// Intentionally complicated message type to cover many features of Protobuf. +message ABitOfEverything { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: { + title: "A bit of everything" + description: "Intentionally complicated message type to cover many features of Protobuf." + required: [ + "uuid", + "int64_value", + "double_value", + "required_field_schema_json_name" + ] + extensions: { + key: "x-a-bit-of-everything-foo"; + value { + string_value: "bar"; + } + } + } + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "Find out more about ABitOfEverything"; + } + example: "{\"int64_value\": 12, \"double_value\": 12.3}" + }; + + // Nested is nested type. + message Nested { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + example: "{\"ok\": \"TRUE\"}" + }; + // name is nested field. + string name = 1; + uint32 amount = 2; + // DeepEnum is one or zero. + enum DeepEnum { + // FALSE is false. + FALSE = 0; + // TRUE is true. + TRUE = 1; + } + + // DeepEnum comment. + DeepEnum ok = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "DeepEnum description." + }]; + } + Nested single_nested = 25; + + string uuid = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + min_length: 1, + field_configuration: { + path_param_name: "uuidName" + }, + extensions: { + key: "x-internal"; + value { + bool_value: true + } + } + }]; + repeated Nested nested = 2; + float float_value = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + description: "Float value field", + default: "0.2", + required: [ + "float_value" + ] + }]; + double double_value = 4; + int64 int64_value = 5; + uint64 uint64_value = 6; + int32 int32_value = 7; + fixed64 fixed64_value = 8; + fixed32 fixed32_value = 9; + bool bool_value = 10; + string string_value = 11; + bytes bytes_value = 29; + uint32 uint32_value = 13; + NumericEnum enum_value = 14; + pathenum.PathEnum path_enum_value = 30; + pathenum.MessagePathEnum.NestedPathEnum nested_path_enum_value = 31; + sfixed32 sfixed32_value = 15; + sfixed64 sfixed64_value = 16; + sint32 sint32_value = 17; + sint64 sint64_value = 18; + repeated string repeated_string_value = 19; + oneof oneof_value { + google.protobuf.Empty oneof_empty = 20; + string oneof_string = 21; + } + + map map_value = 22; + map mapped_string_value = 23; + map mapped_nested_value = 24; + + string nonConventionalNameValue = 26; + + google.protobuf.Timestamp timestamp_value = 27; + + // repeated enum value. it is comma-separated in query + repeated NumericEnum repeated_enum_value = 28; + + // repeated numeric enum comment (This comment is overridden by the field annotation) + repeated NumericEnum repeated_enum_annotation = 32 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title: "Repeated numeric enum title", + description: "Repeated numeric enum description." + }]; + + // numeric enum comment (This comment is overridden by the field annotation) + NumericEnum enum_value_annotation = 33 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title: "Numeric enum title", + description: "Numeric enum description." + }]; + + // repeated string comment (This comment is overridden by the field annotation) + repeated string repeated_string_annotation = 34 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title: "Repeated string title", + description: "Repeated string description." + }]; + + // repeated nested object comment (This comment is overridden by the field annotation) + repeated Nested repeated_nested_annotation = 35 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title: "Repeated nested object title", + description: "Repeated nested object description." + }]; + + // nested object comments (This comment is overridden by the field annotation) + Nested nested_annotation = 36 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title: "Nested object title", + description: "Nested object description." + }]; + + int64 int64_override_type = 37 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + type: INTEGER + }]; + + // mark a field as required in Open API definition + string required_string_via_field_behavior_annotation = 38 [(google.api.field_behavior) = REQUIRED]; + + // mark a field as readonly in Open API definition + string output_only_string_via_field_behavior_annotation = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + + optional string optional_string_value = 40; + + // Test openapiv2 generation of repeated fields + repeated string product_id = 41 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + pattern: "^[0-9]+$" + max_length: 19 + min_length: 1 + description: "Only digits are allowed." + }]; + + // Test openapiv2 generation of required fields with annotation and jsonschema to reproduce + string optional_string_field = 42; + string required_string_field_1 = 43 [(google.api.field_behavior) = REQUIRED]; + string required_string_field_2 = 44 [(google.api.field_behavior) = REQUIRED]; + + // Test openapiv2 handling of required json_name fields + string required_field_behavior_json_name = 45 [ + json_name = "required_field_behavior_json_name_custom", + (google.api.field_behavior) = REQUIRED + ]; + string required_field_schema_json_name = 46 [json_name = "required_field_schema_json_name_custom"]; +} + +// ABitOfEverythingRepeated is used to validate repeated path parameter functionality +message ABitOfEverythingRepeated { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + example: "{\"path_repeated_bool_value\": [true, true, false, true], \"path_repeated_int32_value\": [1, 2, 3]}" + }; + + // repeated values. they are comma-separated in path + repeated float path_repeated_float_value = 1; + repeated double path_repeated_double_value = 2; + repeated int64 path_repeated_int64_value = 3; + repeated uint64 path_repeated_uint64_value = 4; + repeated int32 path_repeated_int32_value = 5; + repeated fixed64 path_repeated_fixed64_value = 6; + repeated fixed32 path_repeated_fixed32_value = 7; + repeated bool path_repeated_bool_value = 8; + repeated string path_repeated_string_value = 9; + repeated bytes path_repeated_bytes_value = 10; + repeated uint32 path_repeated_uint32_value = 11; + repeated NumericEnum path_repeated_enum_value = 12; + repeated sfixed32 path_repeated_sfixed32_value = 13; + repeated sfixed64 path_repeated_sfixed64_value = 14; + repeated sint32 path_repeated_sint32_value = 15; + repeated sint64 path_repeated_sint64_value = 16; +} + +message CheckStatusResponse { + google.rpc.Status status = 1; +} + +message Body { + string name = 1; +} + +message MessageWithBody { + string id = 1; + Body data = 2; +} + +// NumericEnum is one or zero. +enum NumericEnum { + // ZERO means 0 + ZERO = 0; + // ONE means 1 + ONE = 1; +} + +// UpdateV2Request request for update includes the message and the update mask +message UpdateV2Request { + ABitOfEverything abe = 1; + // The paths to update. + google.protobuf.FieldMask update_mask = 2; +} + +// An example resource type from AIP-123 used to test the behavior described in +// the CreateBookRequest message. +// +// See: https://google.aip.dev/123 +message Book { + // The resource name of the book. + // + // Format: `publishers/{publisher}/books/{book}` + // + // Example: `publishers/1257894000000000000/books/my-book` + string name = 1; + + // Output only. The book's ID. + string id = 2; + + // Output only. Creation time of the book. + google.protobuf.Timestamp create_time = 3; +} + +// A standard Create message from AIP-133 with a user-specified ID. +// The user-specified ID (the `book_id` field in this example) must become a +// query parameter in the OpenAPI spec. +// +// See: https://google.aip.dev/133#user-specified-ids +message CreateBookRequest { + // The publisher in which to create the book. + // + // Format: `publishers/{publisher}` + // + // Example: `publishers/1257894000000000000` + string parent = 1; + + // The book to create. + Book book = 2; + + // The ID to use for the book. + // + // This must start with an alphanumeric character. + string book_id = 3; +} + +// A standard Update message from AIP-134 +// +// See: https://google.aip.dev/134#request-message +message UpdateBookRequest { + // The book to update. + // + // The book's `name` field is used to identify the book to be updated. + // Format: publishers/{publisher}/books/{book} + Book book = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the book is not found, a new book will be created. + // In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// ABitOfEverything service is used to validate that APIs with complicated +// proto messages and URL templates are still processed correctly. +service ABitOfEverythingService { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = { + description: "ABitOfEverythingService description -- which should not be used in place of the documentation comment!" + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "Find out more about EchoService"; + } + }; + + // Create a new ABitOfEverything + // + // This API creates a new ABitOfEverything + rpc Create(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + 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}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{enum_value_annotation}" + }; + } + rpc CreateBody(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + post: "/v1/example/a_bit_of_everything" + body: "*" + }; + } + // Create a book. + rpc CreateBook(CreateBookRequest) returns (Book) { + option (google.api.http) = { + post: "/v1/{parent=publishers/*}/books" + body: "book" + }; + } + rpc UpdateBook(UpdateBookRequest) returns (Book) { + option (google.api.http) = { + patch: "/v1/{book.name=publishers/*/books/*}" + body: "book" + }; + } + rpc Lookup(grpc.gateway.examples.internal.proto.sub2.IdMessage) returns (ABitOfEverything) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything/{uuid}" + }; + } + rpc Custom(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + post: "/v1/example/a_bit_of_everything/{uuid}:custom" + }; + } + rpc DoubleColon(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + post: "/v1/example/a_bit_of_everything/{uuid}:custom:custom" + }; + } + rpc Update(ABitOfEverything) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/v1/example/a_bit_of_everything/{uuid}" + body: "*" + }; + } + rpc UpdateV2(UpdateV2Request) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/v2/example/a_bit_of_everything/{abe.uuid}" + body: "abe" + additional_bindings: [ + { + patch: "/v2/example/a_bit_of_everything/{abe.uuid}" + body: "abe" + }, + { + patch: "/v2a/example/a_bit_of_everything/{abe.uuid}" + body: "*" + } + ] + }; + } + + rpc Delete(grpc.gateway.examples.internal.proto.sub2.IdMessage) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/example/a_bit_of_everything/{uuid}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + security: { + security_requirement: { + key: "ApiKeyAuth"; + value: {} + } + security_requirement: { + key: "OAuth2"; + value: { + scope: "read"; + scope: "write"; + } + } + } + extensions: { + key: "x-irreversible"; + value { + bool_value: true; + } + } + }; + } + rpc GetQuery(ABitOfEverything) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything/query/{uuid}" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + deprecated: true // For testing purposes. + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "Find out more about GetQuery"; + } + security: {} + }; + } + rpc GetRepeatedQuery(ABitOfEverythingRepeated) returns (ABitOfEverythingRepeated) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything_repeated/{path_repeated_float_value}/{path_repeated_double_value}/{path_repeated_int64_value}/{path_repeated_uint64_value}/{path_repeated_int32_value}/{path_repeated_fixed64_value}/{path_repeated_fixed32_value}/{path_repeated_bool_value}/{path_repeated_string_value}/{path_repeated_bytes_value}/{path_repeated_uint32_value}/{path_repeated_enum_value}/{path_repeated_sfixed32_value}/{path_repeated_sfixed64_value}/{path_repeated_sint32_value}/{path_repeated_sint64_value}" + }; + } + // Echo allows posting a StringMessage value. + // + // It also exposes multiple bindings. + // + // This makes it useful when validating that the OpenAPI v2 API + // description exposes documentation correctly on all paths + // defined as additional_bindings in the proto. + rpc Echo(grpc.gateway.examples.internal.proto.sub.StringMessage) returns (grpc.gateway.examples.internal.proto.sub.StringMessage) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything/echo/{value}" + additional_bindings { + post: "/v2/example/echo" + body: "value" + } + additional_bindings { + get: "/v2/example/echo" + } + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Description Echo"; + summary: "Summary: Echo rpc"; + tags: "echo rpc"; + external_docs: { + url: "https://github.com/grpc-ecosystem/grpc-gateway"; + description: "Find out more Echo"; + } + responses: { + key: "200" + value: { + examples: { + key: "application/json" + value: "{\"value\": \"the input value\"}" + } + } + } + responses: { + key: "503"; + value: { + description: "Returned when the resource is temporarily unavailable."; + extensions: { + key: "x-number"; + value { + number_value: 100; + } + } + } + } + responses: { + // Overwrites global definition. + key: "404"; + value: { + description: "Returned when the resource does not exist."; + schema: { + json_schema: { + type: INTEGER; + } + } + } + } + }; + } + rpc DeepPathEcho(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + post: "/v1/example/deep_path/{single_nested.name}" + body: "*" + }; + } + rpc NoBindings(google.protobuf.Duration) returns (google.protobuf.Empty) {} + rpc Timeout(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v2/example/timeout", + }; + } + rpc ErrorWithDetails(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v2/example/errorwithdetails", + }; + } + rpc GetMessageWithBody(MessageWithBody) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/example/withbody/{id}", + body: "data" + }; + } + rpc PostWithEmptyBody(Body) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/example/postwithemptybody/{name}", + body: "*" + }; + } + rpc CheckGetQueryParams(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything/params/get/{single_nested.name}" + }; + } + rpc CheckNestedEnumGetQueryParams(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + get: "/v1/example/a_bit_of_everything/params/get/nested_enum/{single_nested.ok}" + }; + } + rpc CheckPostQueryParams(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + post: "/v1/example/a_bit_of_everything/params/post/{string_value}" + body: "single_nested" + }; + } + rpc OverwriteResponseContentType(google.protobuf.Empty) returns (google.protobuf.StringValue) { + option (google.api.http) = { + get: "/v2/example/overwriteresponsecontenttype" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + produces: "application/text" + }; + } + rpc CheckExternalPathEnum(pathenum.MessageWithPathEnum) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v2/{value}:check" + }; + } + rpc CheckExternalNestedPathEnum(pathenum.MessageWithNestedPathEnum) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v3/{value}:check" + }; + } + + rpc CheckStatus(google.protobuf.Empty) returns (CheckStatusResponse) { + option (google.api.http) = { + get: "/v1/example/checkStatus" + }; + } + + rpc Exists(ABitOfEverything) returns (google.protobuf.Empty) { + option (google.api.http) = { + custom: { + kind: "HEAD", + path: "/v1/example/a_bit_of_everything/{uuid}" + } + }; + } + + rpc CustomOptionsRequest(ABitOfEverything) returns (google.protobuf.Empty) { + option (google.api.http) = { + custom: { + kind: "OPTIONS", + path: "/v1/example/a_bit_of_everything/{uuid}" + } + }; + } + + rpc TraceRequest(ABitOfEverything) returns (ABitOfEverything) { + option (google.api.http) = { + custom: { + kind: "TRACE", + path: "/v1/example/a_bit_of_everything/{uuid}" + } + }; + } + + rpc PostOneofEnum(grpc.gateway.examples.internal.proto.oneofenum.OneofEnumMessage) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/example/oneofenum" + body: "example_enum" + }; + } +} + +// camelCase and lowercase service names are valid but not recommended (use TitleCase instead) +service camelCaseServiceName { + rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/v2/example/empty", + }; + } +} +service AnotherServiceWithNoBindings { + rpc NoBindings(google.protobuf.Empty) returns (google.protobuf.Empty) {} +} + +service SnakeEnumService { + rpc SnakeEnum(SnakeEnumRequest) returns (SnakeEnumResponse) { + option (google.api.http) = { + get: "/v1/example/snake/{who}/{what}/{where}" + }; + } +} + +// Ignoring lint warnings as this enum type exist to validate proper functionality +// for projects that don't follow these lint rules. +// buf:lint:ignore ENUM_PASCAL_CASE +enum snake_case_enum { + // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + value_c = 0; + // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + value_d = 1; +} + +// Ignoring lint warnings as this enum type exist to validate proper functionality +// for projects that don't follow these lint rules. +// buf:lint:ignore ENUM_PASCAL_CASE +enum snake_case_0_enum { + // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + value_e = 0; + // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE + value_f = 1; +} + +message SnakeEnumRequest { + snake_case_enum what = 1; + snake_case_0_enum who = 2; + pathenum.snake_case_for_import where = 3; +} + +message SnakeEnumResponse {} + +service ParentChildService { + rpc UpdateChild(UpdateChildRequest) returns (Child) { + option (google.api.http) = { + put: "/v1/{parent=child/*}/children/{child.type=*}" + body: "child" + }; + } +} + +message UpdateChildRequest { + // The parent resource + string parent = 1; + + // The X to set. + Child child = 2; +} + +enum ChildType { + TYPE_UNDEFINED = 0; + TYPE_A = 1; + TYPE_B = 2; +} + +message Child { + ChildType type = 1; + string name = 2; +}