From cb988ec8945cba36969700d73223c790c2dc1255 Mon Sep 17 00:00:00 2001 From: Daniel Pupius Date: Sat, 11 May 2024 17:37:26 -0700 Subject: [PATCH] Support deprecated annotation, closes #3 --- README.md | 9 +- data/message.go | 4 + generator/template.go | 23 +- registry/field.go | 1 + registry/message.go | 1 + test/integration/service.pb.go | 439 ++++++++++++++++++++++++++------- test/integration/service.proto | 20 ++ 7 files changed, 408 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index e973cca..f184895 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,11 @@ 1. [Support for well-known wrapper types](https://github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts/pull/50) 2. Updated to support gRPC gateway v2 and latest protoc-gen-go 3. Support for proto3 optional fields -4. Updated to satisfy strict TS and eslint checks -5. Generator options managed through standard flags -6. Fixes inconsistent field naming when fields contain numbers, e.g. `k8s_field` --> `k8sField` -7. Fixes module names when they contain dots or dashes +4. Support for deprecated message and field annotations +5. Updated to satisfy strict TS and eslint checks +6. Generator options managed through standard flags +7. Fixes inconsistent field naming when fields contain numbers, e.g. `k8s_field` --> `k8sField` +8. Fixes module names when they contain dots or dashes ## Getting Started: diff --git a/data/message.go b/data/message.go index ebb421c..733d6c5 100644 --- a/data/message.go +++ b/data/message.go @@ -6,6 +6,8 @@ type Message struct { Nested bool // Name is the name of the Message Name string + // Message has been marked as deprecated + IsDeprecated bool //FQType is the fully qualified type name for the message itself FQType string // Enums is a list of NestedEnums inside @@ -88,6 +90,8 @@ type Field struct { IsOneOfField bool // IsOptional indicates the field is flagged as optional. IsOptional bool + // IsDeprecated indicates the field is deprecated. + IsDeprecated bool // Message is the reference back to the parent message Message *Message // OneOfIndex is the index in the one of fields diff --git a/generator/template.go b/generator/template.go index 997fdb8..8401bf8 100644 --- a/generator/template.go +++ b/generator/template.go @@ -36,19 +36,37 @@ export enum {{.Name}} { {{- define "messages" -}} {{- range . -}} +{{- if .IsDeprecated -}} +/** + * @deprecated This message has been deprecated. + */ +{{end -}} {{- if .HasOneOfFields -}} type Base{{.Name}} = { {{- range .NonOneOfFields}} + {{if .IsDeprecated -}} + /** @deprecated This field has been deprecated. */ + {{end -}} {{tsTypeKey .}}: {{tsTypeDef .}}; {{- end}} {{- range .OptionalFields -}} + {{if .IsDeprecated -}} + /** @deprecated This field has been deprecated. */ + {{end -}} {{tsTypeKey .}}: {{tsTypeDef .}}; {{- end}} }; export type {{.Name}} = Base{{.Name}} {{- range $groupId, $fields := .OneOfFieldsGroups}} & - OneOf<{ {{range $index, $field := $fields}}{{fieldName $field.Name}}: {{tsType $field}}{{if (lt (add $index 1) (len $fields))}}; {{end}}{{end}} }>; + OneOf<{ +{{- range $index, $field := $fields}} + {{if $field.IsDeprecated -}} + /** @deprecated This field has been deprecated. */ + {{end -}} + {{fieldName $field.Name}}: {{tsType $field}}; +{{- end}} + }>; {{- end -}} {{/* Standard, non oneof messages */}} @@ -59,6 +77,9 @@ export type {{.Name}} = Base{{.Name}} {{- else -}} export type {{.Name}} = { {{- range .Fields}} + {{if .IsDeprecated -}} + /** @deprecated This field has been deprecated. */ + {{end -}} {{tsTypeKey .}}: {{tsTypeDef .}}; {{- end}} }; diff --git a/registry/field.go b/registry/field.go index d84740b..23ce725 100644 --- a/registry/field.go +++ b/registry/field.go @@ -60,6 +60,7 @@ func (r *Registry) analyseField(fileData *data.File, msgData *data.Message, pack IsExternal: isExternal, IsOneOfField: f.OneofIndex != nil, IsOptional: f.GetProto3Optional(), + IsDeprecated: f.GetOptions().GetDeprecated(), Message: msgData, } diff --git a/registry/message.go b/registry/message.go index 7344a06..7688133 100644 --- a/registry/message.go +++ b/registry/message.go @@ -55,6 +55,7 @@ func (r *Registry) analyseMessage(fileData *data.File, packageName, fileName str data := data.NewMessage() data.Name = packageIdentifier data.FQType = fqName + data.IsDeprecated = message.GetOptions().GetDeprecated() newParents := append(parents, message.GetName()) diff --git a/test/integration/service.pb.go b/test/integration/service.pb.go index dfebf7c..965d9e7 100644 --- a/test/integration/service.pb.go +++ b/test/integration/service.pb.go @@ -1390,6 +1390,213 @@ func (x *Names) GetK8SField() string { return "" } +// Deprecated: Marked as deprecated in service.proto. +type DeprecatedMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` +} + +func (x *DeprecatedMessage) Reset() { + *x = DeprecatedMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeprecatedMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeprecatedMessage) ProtoMessage() {} + +func (x *DeprecatedMessage) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[23] + 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 DeprecatedMessage.ProtoReflect.Descriptor instead. +func (*DeprecatedMessage) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{23} +} + +func (x *DeprecatedMessage) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +type MessageWithDeprecatedFields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + // Deprecated: Marked as deprecated in service.proto. + DeprecatedField string `protobuf:"bytes,2,opt,name=deprecated_field,json=deprecatedField,proto3" json:"deprecated_field,omitempty"` +} + +func (x *MessageWithDeprecatedFields) Reset() { + *x = MessageWithDeprecatedFields{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithDeprecatedFields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithDeprecatedFields) ProtoMessage() {} + +func (x *MessageWithDeprecatedFields) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[24] + 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 MessageWithDeprecatedFields.ProtoReflect.Descriptor instead. +func (*MessageWithDeprecatedFields) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{24} +} + +func (x *MessageWithDeprecatedFields) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +// Deprecated: Marked as deprecated in service.proto. +func (x *MessageWithDeprecatedFields) GetDeprecatedField() string { + if x != nil { + return x.DeprecatedField + } + return "" +} + +type OneofMessageWithDeprecatedFields struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + // Deprecated: Marked as deprecated in service.proto. + DeprecatedField string `protobuf:"bytes,2,opt,name=deprecated_field,json=deprecatedField,proto3" json:"deprecated_field,omitempty"` + // Types that are assignable to OneofField: + // + // *OneofMessageWithDeprecatedFields_Oneof + // *OneofMessageWithDeprecatedFields_DeprecatedOneof + OneofField isOneofMessageWithDeprecatedFields_OneofField `protobuf_oneof:"oneof_field"` +} + +func (x *OneofMessageWithDeprecatedFields) Reset() { + *x = OneofMessageWithDeprecatedFields{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OneofMessageWithDeprecatedFields) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OneofMessageWithDeprecatedFields) ProtoMessage() {} + +func (x *OneofMessageWithDeprecatedFields) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[25] + 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 OneofMessageWithDeprecatedFields.ProtoReflect.Descriptor instead. +func (*OneofMessageWithDeprecatedFields) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{25} +} + +func (x *OneofMessageWithDeprecatedFields) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +// Deprecated: Marked as deprecated in service.proto. +func (x *OneofMessageWithDeprecatedFields) GetDeprecatedField() string { + if x != nil { + return x.DeprecatedField + } + return "" +} + +func (m *OneofMessageWithDeprecatedFields) GetOneofField() isOneofMessageWithDeprecatedFields_OneofField { + if m != nil { + return m.OneofField + } + return nil +} + +func (x *OneofMessageWithDeprecatedFields) GetOneof() string { + if x, ok := x.GetOneofField().(*OneofMessageWithDeprecatedFields_Oneof); ok { + return x.Oneof + } + return "" +} + +// Deprecated: Marked as deprecated in service.proto. +func (x *OneofMessageWithDeprecatedFields) GetDeprecatedOneof() string { + if x, ok := x.GetOneofField().(*OneofMessageWithDeprecatedFields_DeprecatedOneof); ok { + return x.DeprecatedOneof + } + return "" +} + +type isOneofMessageWithDeprecatedFields_OneofField interface { + isOneofMessageWithDeprecatedFields_OneofField() +} + +type OneofMessageWithDeprecatedFields_Oneof struct { + Oneof string `protobuf:"bytes,3,opt,name=oneof,proto3,oneof"` +} + +type OneofMessageWithDeprecatedFields_DeprecatedOneof struct { + // Deprecated: Marked as deprecated in service.proto. + DeprecatedOneof string `protobuf:"bytes,4,opt,name=deprecated_oneof,json=deprecatedOneof,proto3,oneof"` +} + +func (*OneofMessageWithDeprecatedFields_Oneof) isOneofMessageWithDeprecatedFields_OneofField() {} + +func (*OneofMessageWithDeprecatedFields_DeprecatedOneof) isOneofMessageWithDeprecatedFields_OneofField() { +} + var File_service_proto protoreflect.FileDescriptor var file_service_proto_rawDesc = []byte{ @@ -1559,82 +1766,103 @@ var file_service_proto_rawDesc = []byte{ 0x6d, 0x5f, 0x33, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x72, 0x69, 0x6d, 0x33, 0x46, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x38, 0x73, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x38, - 0x73, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x32, 0x9c, 0x09, 0x0a, 0x0e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, - 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x61, 0x69, - 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x48, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x63, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, - 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3b, 0x0a, 0x10, 0x46, 0x61, 0x69, - 0x6c, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, - 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x42, 0x69, 0x6e, 0x61, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x56, 0x0a, 0x07, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x61, 0x69, - 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, - 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x7b, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x6f, 0x5f, 0x69, 0x6e, - 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x7d, 0x12, 0x63, 0x0a, 0x1a, 0x48, 0x54, 0x54, 0x50, 0x50, - 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x64, - 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, - 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, - 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x03, 0x72, 0x65, - 0x71, 0x22, 0x09, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x63, 0x0a, 0x18, - 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x53, 0x74, 0x61, 0x72, - 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, - 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, - 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, 0x7d, 0x2f, 0x7b, 0x63, - 0x7d, 0x12, 0x4f, 0x0a, 0x09, 0x48, 0x54, 0x54, 0x50, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, - 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, - 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x32, 0x06, 0x2f, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x52, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x2a, 0x0b, 0x2f, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x36, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, - 0x01, 0x0a, 0x1a, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, - 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, - 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, - 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, - 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x23, 0x48, 0x54, 0x54, + 0x73, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x2d, 0x0a, 0x11, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x62, 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2d, 0x0a, 0x10, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x20, 0x4f, 0x6e, + 0x65, 0x6f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2d, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x12, 0x16, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x2f, 0x0a, 0x10, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x42, 0x0d, 0x0a, 0x0b, + 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x32, 0x9c, 0x09, 0x0a, 0x0e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, + 0x0a, 0x09, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, + 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x6d, 0x61, + 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3b, + 0x0a, 0x10, 0x46, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x55, 0x6e, + 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x45, + 0x63, 0x68, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x6d, 0x61, 0x69, 0x6e, + 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, + 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x12, + 0x14, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, + 0x70, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x7b, 0x6e, 0x75, 0x6d, 0x5f, + 0x74, 0x6f, 0x5f, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x7d, 0x12, 0x63, 0x0a, 0x1a, + 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x6d, 0x61, 0x69, + 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x10, 0x3a, 0x03, 0x72, 0x65, 0x71, 0x22, 0x09, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, 0x61, + 0x7d, 0x12, 0x63, 0x0a, 0x18, 0x48, 0x54, 0x54, 0x50, 0x50, 0x6f, 0x73, 0x74, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x74, 0x61, 0x72, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, + 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, + 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x70, 0x6f, 0x73, 0x74, 0x2f, 0x7b, + 0x61, 0x7d, 0x2f, 0x7b, 0x63, 0x7d, 0x12, 0x4f, 0x0a, 0x09, 0x48, 0x54, 0x54, 0x50, 0x50, 0x61, + 0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x61, + 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x32, + 0x06, 0x2f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x52, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x74, 0x74, + 0x70, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x2a, 0x0b, + 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x36, 0x0a, 0x0f, 0x45, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x11, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x1a, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, + 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, + 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x61, + 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x55, 0x52, + 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x7b, 0x61, 0x7d, 0x12, 0x9f, 0x01, + 0x0a, 0x23, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, + 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x30, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, - 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, - 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x55, 0x52, - 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, - 0x70, 0x61, 0x74, 0x68, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x69, 0x0a, 0x19, 0x48, 0x54, - 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x3b, 0x6d, 0x61, 0x69, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x48, + 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x5a, 0x65, 0x72, 0x6f, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x55, 0x52, 0x4c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x69, 0x0a, 0x19, 0x48, 0x54, 0x54, 0x50, 0x47, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x6d, + 0x61, 0x69, 0x6e, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x61, 0x69, 0x6e, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, + 0x09, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, + 0x3b, 0x6d, 0x61, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1649,7 +1877,7 @@ func file_service_proto_rawDescGZIP() []byte { return file_service_proto_rawDescData } -var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_service_proto_goTypes = []interface{}{ (*UnaryRequest)(nil), // 0: main.UnaryRequest (*UnaryResponse)(nil), // 1: main.UnaryResponse @@ -1674,15 +1902,18 @@ var file_service_proto_goTypes = []interface{}{ (*OptionalFieldsResponse)(nil), // 20: main.OptionalFieldsResponse (*OptionalFieldsSubMsg)(nil), // 21: main.OptionalFieldsSubMsg (*Names)(nil), // 22: main.Names - (*ExternalMessage)(nil), // 23: ExternalMessage - (*ExternalRequest)(nil), // 24: ExternalRequest - (*emptypb.Empty)(nil), // 25: google.protobuf.Empty - (*ExternalResponse)(nil), // 26: ExternalResponse + (*DeprecatedMessage)(nil), // 23: main.DeprecatedMessage + (*MessageWithDeprecatedFields)(nil), // 24: main.MessageWithDeprecatedFields + (*OneofMessageWithDeprecatedFields)(nil), // 25: main.OneofMessageWithDeprecatedFields + (*ExternalMessage)(nil), // 26: ExternalMessage + (*ExternalRequest)(nil), // 27: ExternalRequest + (*emptypb.Empty)(nil), // 28: google.protobuf.Empty + (*ExternalResponse)(nil), // 29: ExternalResponse } var file_service_proto_depIdxs = []int32{ 9, // 0: main.HttpPostRequest.req:type_name -> main.PostRequest 9, // 1: main.HTTPGetWithURLSearchParamsRequest.b:type_name -> main.PostRequest - 23, // 2: main.HTTPGetWithURLSearchParamsRequest.d:type_name -> ExternalMessage + 26, // 2: main.HTTPGetWithURLSearchParamsRequest.d:type_name -> ExternalMessage 16, // 3: main.HTTPGetWithZeroValueURLSearchParamsRequest.c:type_name -> main.ZeroValueMsg 16, // 4: main.HTTPGetWithZeroValueURLSearchParamsResponse.zero_value_msg:type_name -> main.ZeroValueMsg 21, // 5: main.OptionalFieldsResponse.empty_msg:type_name -> main.OptionalFieldsSubMsg @@ -1700,7 +1931,7 @@ var file_service_proto_depIdxs = []int32{ 8, // 17: main.CounterService.HTTPPostWithStarBodyPath:input_type -> main.HttpPostRequest 11, // 18: main.CounterService.HTTPPatch:input_type -> main.HttpPatchRequest 13, // 19: main.CounterService.HTTPDelete:input_type -> main.HttpDeleteRequest - 24, // 20: main.CounterService.ExternalMessage:input_type -> ExternalRequest + 27, // 20: main.CounterService.ExternalMessage:input_type -> ExternalRequest 14, // 21: main.CounterService.HTTPGetWithURLSearchParams:input_type -> main.HTTPGetWithURLSearchParamsRequest 17, // 22: main.CounterService.HTTPGetWithZeroValueURLSearchParams:input_type -> main.HTTPGetWithZeroValueURLSearchParamsRequest 19, // 23: main.CounterService.HTTPGetWithOptionalFields:input_type -> main.OptionalFieldsRequest @@ -1712,8 +1943,8 @@ var file_service_proto_depIdxs = []int32{ 10, // 29: main.CounterService.HTTPPostWithNestedBodyPath:output_type -> main.HttpPostResponse 10, // 30: main.CounterService.HTTPPostWithStarBodyPath:output_type -> main.HttpPostResponse 12, // 31: main.CounterService.HTTPPatch:output_type -> main.HttpPatchResponse - 25, // 32: main.CounterService.HTTPDelete:output_type -> google.protobuf.Empty - 26, // 33: main.CounterService.ExternalMessage:output_type -> ExternalResponse + 28, // 32: main.CounterService.HTTPDelete:output_type -> google.protobuf.Empty + 29, // 33: main.CounterService.ExternalMessage:output_type -> ExternalResponse 15, // 34: main.CounterService.HTTPGetWithURLSearchParams:output_type -> main.HTTPGetWithURLSearchParamsResponse 18, // 35: main.CounterService.HTTPGetWithZeroValueURLSearchParams:output_type -> main.HTTPGetWithZeroValueURLSearchParamsResponse 20, // 36: main.CounterService.HTTPGetWithOptionalFields:output_type -> main.OptionalFieldsResponse @@ -2007,16 +2238,56 @@ func file_service_proto_init() { return nil } } + file_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeprecatedMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithDeprecatedFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OneofMessageWithDeprecatedFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_service_proto_msgTypes[20].OneofWrappers = []interface{}{} file_service_proto_msgTypes[21].OneofWrappers = []interface{}{} + file_service_proto_msgTypes[25].OneofWrappers = []interface{}{ + (*OneofMessageWithDeprecatedFields_Oneof)(nil), + (*OneofMessageWithDeprecatedFields_DeprecatedOneof)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/test/integration/service.proto b/test/integration/service.proto index c5b21e3..246e243 100644 --- a/test/integration/service.proto +++ b/test/integration/service.proto @@ -135,6 +135,26 @@ message Names { string k8s_field = 8; } +message DeprecatedMessage { + option deprecated = true; + string field = 1; +} + +message MessageWithDeprecatedFields { + string field = 1; + string deprecated_field = 2 [deprecated = true]; +} + +message OneofMessageWithDeprecatedFields { + string field = 1; + string deprecated_field = 2 [deprecated = true]; + + oneof oneof_field { + string oneof = 3; + string deprecated_oneof = 4 [deprecated = true]; + } +} + service CounterService { rpc Increment(UnaryRequest) returns (UnaryResponse); rpc StreamingIncrements(StreamingRequest) returns (stream StreamingResponse);