From 6ed1bd0ab992d58c1a949d3f7660514b2cac901a Mon Sep 17 00:00:00 2001 From: felipe stival <14948182+v0idpwn@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:30:58 -0300 Subject: [PATCH] Update protobuf to v29.3 (#395) * Update google-protobuf to v29.3 * Add exceptions for new failing tests They are all recommended, not required. --- conformance/exemptions.txt | 7 + lib/elixirpb.pb.ex | 2 +- lib/elixirpb/pb_extension.pb.ex | 1 + lib/google/protobuf/compiler/plugin.pb.ex | 40 +- lib/google/protobuf/descriptor.pb.ex | 673 ++++++++++++++++++---- mix.exs | 2 +- mix.lock | 2 +- test/protobuf/protobuf_test.exs | 4 +- 8 files changed, 611 insertions(+), 120 deletions(-) diff --git a/conformance/exemptions.txt b/conformance/exemptions.txt index 7c29239c..adc2e572 100644 --- a/conformance/exemptions.txt +++ b/conformance/exemptions.txt @@ -2,3 +2,10 @@ Recommended.Proto2.JsonInput.FieldNameExtension.Validator Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInOptionalField.ProtobufOutput Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInRepeatedField.ProtobufOutput +Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput +Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput +Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInOptionalField.ProtobufOutput +Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInRepeatedField.ProtobufOutput +Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInRepeatedPart.ProtobufOutput +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInRepeatedPart.ProtobufOutput diff --git a/lib/elixirpb.pb.ex b/lib/elixirpb.pb.ex index 87b8abf0..892a5c60 100644 --- a/lib/elixirpb.pb.ex +++ b/lib/elixirpb.pb.ex @@ -3,5 +3,5 @@ defmodule Elixirpb.FileOptions do use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 - field :module_prefix, 1, optional: true, type: :string + field :module_prefix, 1, optional: true, type: :string, json_name: "modulePrefix" end diff --git a/lib/elixirpb/pb_extension.pb.ex b/lib/elixirpb/pb_extension.pb.ex index 322ebefc..11f43e07 100644 --- a/lib/elixirpb/pb_extension.pb.ex +++ b/lib/elixirpb/pb_extension.pb.ex @@ -1,5 +1,6 @@ defmodule Elixirpb.PbExtension do @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.13.0" extend Google.Protobuf.FileOptions, :file, 1047, optional: true, type: Elixirpb.FileOptions diff --git a/lib/google/protobuf/compiler/plugin.pb.ex b/lib/google/protobuf/compiler/plugin.pb.ex index 3cf84bad..c03caa6d 100644 --- a/lib/google/protobuf/compiler/plugin.pb.ex +++ b/lib/google/protobuf/compiler/plugin.pb.ex @@ -5,12 +5,13 @@ defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.Feature do field :FEATURE_NONE, 0 field :FEATURE_PROTO3_OPTIONAL, 1 + field :FEATURE_SUPPORTS_EDITIONS, 2 end defmodule Google.Protobuf.Compiler.Version do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :major, 1, optional: true, type: :int32 field :minor, 2, optional: true, type: :int32 @@ -21,31 +22,50 @@ end defmodule Google.Protobuf.Compiler.CodeGeneratorRequest do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 - field :file_to_generate, 1, repeated: true, type: :string + field :file_to_generate, 1, repeated: true, type: :string, json_name: "fileToGenerate" field :parameter, 2, optional: true, type: :string - field :proto_file, 15, repeated: true, type: Google.Protobuf.FileDescriptorProto - field :compiler_version, 3, optional: true, type: Google.Protobuf.Compiler.Version + + field :proto_file, 15, + repeated: true, + type: Google.Protobuf.FileDescriptorProto, + json_name: "protoFile" + + field :source_file_descriptors, 17, + repeated: true, + type: Google.Protobuf.FileDescriptorProto, + json_name: "sourceFileDescriptors" + + field :compiler_version, 3, + optional: true, + type: Google.Protobuf.Compiler.Version, + json_name: "compilerVersion" end defmodule Google.Protobuf.Compiler.CodeGeneratorResponse.File do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string - field :insertion_point, 2, optional: true, type: :string + field :insertion_point, 2, optional: true, type: :string, json_name: "insertionPoint" field :content, 15, optional: true, type: :string - field :generated_code_info, 16, optional: true, type: Google.Protobuf.GeneratedCodeInfo + + field :generated_code_info, 16, + optional: true, + type: Google.Protobuf.GeneratedCodeInfo, + json_name: "generatedCodeInfo" end defmodule Google.Protobuf.Compiler.CodeGeneratorResponse do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :error, 1, optional: true, type: :string - field :supported_features, 2, optional: true, type: :uint64 + field :supported_features, 2, optional: true, type: :uint64, json_name: "supportedFeatures" + field :minimum_edition, 3, optional: true, type: :int32, json_name: "minimumEdition" + field :maximum_edition, 4, optional: true, type: :int32, json_name: "maximumEdition" field :file, 15, repeated: true, type: Google.Protobuf.Compiler.CodeGeneratorResponse.File end diff --git a/lib/google/protobuf/descriptor.pb.ex b/lib/google/protobuf/descriptor.pb.ex index d08d3e2a..e0472d85 100644 --- a/lib/google/protobuf/descriptor.pb.ex +++ b/lib/google/protobuf/descriptor.pb.ex @@ -1,7 +1,35 @@ +defmodule Google.Protobuf.Edition do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :EDITION_UNKNOWN, 0 + field :EDITION_LEGACY, 900 + field :EDITION_PROTO2, 998 + field :EDITION_PROTO3, 999 + field :EDITION_2023, 1000 + field :EDITION_2024, 1001 + field :EDITION_1_TEST_ONLY, 1 + field :EDITION_2_TEST_ONLY, 2 + field :EDITION_99997_TEST_ONLY, 99997 + field :EDITION_99998_TEST_ONLY, 99998 + field :EDITION_99999_TEST_ONLY, 99999 + field :EDITION_MAX, 2_147_483_647 +end + +defmodule Google.Protobuf.ExtensionRangeOptions.VerificationState do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :DECLARATION, 0 + field :UNVERIFIED, 1 +end + defmodule Google.Protobuf.FieldDescriptorProto.Type do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :TYPE_DOUBLE, 1 field :TYPE_FLOAT, 2 @@ -26,17 +54,17 @@ end defmodule Google.Protobuf.FieldDescriptorProto.Label do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :LABEL_OPTIONAL, 1 - field :LABEL_REQUIRED, 2 field :LABEL_REPEATED, 3 + field :LABEL_REQUIRED, 2 end defmodule Google.Protobuf.FileOptions.OptimizeMode do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :SPEED, 1 field :CODE_SIZE, 2 @@ -46,7 +74,7 @@ end defmodule Google.Protobuf.FieldOptions.CType do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :STRING, 0 field :CORD, 1 @@ -56,27 +84,115 @@ end defmodule Google.Protobuf.FieldOptions.JSType do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :JS_NORMAL, 0 field :JS_STRING, 1 field :JS_NUMBER, 2 end +defmodule Google.Protobuf.FieldOptions.OptionRetention do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :RETENTION_UNKNOWN, 0 + field :RETENTION_RUNTIME, 1 + field :RETENTION_SOURCE, 2 +end + +defmodule Google.Protobuf.FieldOptions.OptionTargetType do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :TARGET_TYPE_UNKNOWN, 0 + field :TARGET_TYPE_FILE, 1 + field :TARGET_TYPE_EXTENSION_RANGE, 2 + field :TARGET_TYPE_MESSAGE, 3 + field :TARGET_TYPE_FIELD, 4 + field :TARGET_TYPE_ONEOF, 5 + field :TARGET_TYPE_ENUM, 6 + field :TARGET_TYPE_ENUM_ENTRY, 7 + field :TARGET_TYPE_SERVICE, 8 + field :TARGET_TYPE_METHOD, 9 +end + defmodule Google.Protobuf.MethodOptions.IdempotencyLevel do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :IDEMPOTENCY_UNKNOWN, 0 field :NO_SIDE_EFFECTS, 1 field :IDEMPOTENT, 2 end +defmodule Google.Protobuf.FeatureSet.FieldPresence do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :FIELD_PRESENCE_UNKNOWN, 0 + field :EXPLICIT, 1 + field :IMPLICIT, 2 + field :LEGACY_REQUIRED, 3 +end + +defmodule Google.Protobuf.FeatureSet.EnumType do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :ENUM_TYPE_UNKNOWN, 0 + field :OPEN, 1 + field :CLOSED, 2 +end + +defmodule Google.Protobuf.FeatureSet.RepeatedFieldEncoding do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :REPEATED_FIELD_ENCODING_UNKNOWN, 0 + field :PACKED, 1 + field :EXPANDED, 2 +end + +defmodule Google.Protobuf.FeatureSet.Utf8Validation do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :UTF8_VALIDATION_UNKNOWN, 0 + field :VERIFY, 2 + field :NONE, 3 +end + +defmodule Google.Protobuf.FeatureSet.MessageEncoding do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :MESSAGE_ENCODING_UNKNOWN, 0 + field :LENGTH_PREFIXED, 1 + field :DELIMITED, 2 +end + +defmodule Google.Protobuf.FeatureSet.JsonFormat do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :JSON_FORMAT_UNKNOWN, 0 + field :ALLOW, 1 + field :LEGACY_BEST_EFFORT, 2 +end + defmodule Google.Protobuf.GeneratedCodeInfo.Annotation.Semantic do @moduledoc false - use Protobuf, enum: true, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, enum: true, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :NONE, 0 field :SET, 1 @@ -86,35 +202,51 @@ end defmodule Google.Protobuf.FileDescriptorSet do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :file, 1, repeated: true, type: Google.Protobuf.FileDescriptorProto + + extensions [{536_000_000, 536_000_001}] end defmodule Google.Protobuf.FileDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :package, 2, optional: true, type: :string field :dependency, 3, repeated: true, type: :string - field :public_dependency, 10, repeated: true, type: :int32 - field :weak_dependency, 11, repeated: true, type: :int32 - field :message_type, 4, repeated: true, type: Google.Protobuf.DescriptorProto - field :enum_type, 5, repeated: true, type: Google.Protobuf.EnumDescriptorProto + field :public_dependency, 10, repeated: true, type: :int32, json_name: "publicDependency" + field :weak_dependency, 11, repeated: true, type: :int32, json_name: "weakDependency" + + field :message_type, 4, + repeated: true, + type: Google.Protobuf.DescriptorProto, + json_name: "messageType" + + field :enum_type, 5, + repeated: true, + type: Google.Protobuf.EnumDescriptorProto, + json_name: "enumType" + field :service, 6, repeated: true, type: Google.Protobuf.ServiceDescriptorProto field :extension, 7, repeated: true, type: Google.Protobuf.FieldDescriptorProto field :options, 8, optional: true, type: Google.Protobuf.FileOptions - field :source_code_info, 9, optional: true, type: Google.Protobuf.SourceCodeInfo + + field :source_code_info, 9, + optional: true, + type: Google.Protobuf.SourceCodeInfo, + json_name: "sourceCodeInfo" + field :syntax, 12, optional: true, type: :string - field :edition, 13, optional: true, type: :string + field :edition, 14, optional: true, type: Google.Protobuf.Edition, enum: true end defmodule Google.Protobuf.DescriptorProto.ExtensionRange do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :start, 1, optional: true, type: :int32 field :end, 2, optional: true, type: :int32 @@ -124,7 +256,7 @@ end defmodule Google.Protobuf.DescriptorProto.ReservedRange do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :start, 1, optional: true, type: :int32 field :end, 2, optional: true, type: :int32 @@ -133,26 +265,77 @@ end defmodule Google.Protobuf.DescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :field, 2, repeated: true, type: Google.Protobuf.FieldDescriptorProto field :extension, 6, repeated: true, type: Google.Protobuf.FieldDescriptorProto - field :nested_type, 3, repeated: true, type: Google.Protobuf.DescriptorProto - field :enum_type, 4, repeated: true, type: Google.Protobuf.EnumDescriptorProto - field :extension_range, 5, repeated: true, type: Google.Protobuf.DescriptorProto.ExtensionRange - field :oneof_decl, 8, repeated: true, type: Google.Protobuf.OneofDescriptorProto + + field :nested_type, 3, + repeated: true, + type: Google.Protobuf.DescriptorProto, + json_name: "nestedType" + + field :enum_type, 4, + repeated: true, + type: Google.Protobuf.EnumDescriptorProto, + json_name: "enumType" + + field :extension_range, 5, + repeated: true, + type: Google.Protobuf.DescriptorProto.ExtensionRange, + json_name: "extensionRange" + + field :oneof_decl, 8, + repeated: true, + type: Google.Protobuf.OneofDescriptorProto, + json_name: "oneofDecl" + field :options, 7, optional: true, type: Google.Protobuf.MessageOptions - field :reserved_range, 9, repeated: true, type: Google.Protobuf.DescriptorProto.ReservedRange - field :reserved_name, 10, repeated: true, type: :string + + field :reserved_range, 9, + repeated: true, + type: Google.Protobuf.DescriptorProto.ReservedRange, + json_name: "reservedRange" + + field :reserved_name, 10, repeated: true, type: :string, json_name: "reservedName" +end + +defmodule Google.Protobuf.ExtensionRangeOptions.Declaration do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :number, 1, optional: true, type: :int32 + field :full_name, 2, optional: true, type: :string, json_name: "fullName" + field :type, 3, optional: true, type: :string + field :reserved, 5, optional: true, type: :bool + field :repeated, 6, optional: true, type: :bool end defmodule Google.Protobuf.ExtensionRangeOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" + + field :declaration, 2, + repeated: true, + type: Google.Protobuf.ExtensionRangeOptions.Declaration, + deprecated: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :features, 50, optional: true, type: Google.Protobuf.FeatureSet + + field :verification, 3, + optional: true, + type: Google.Protobuf.ExtensionRangeOptions.VerificationState, + default: :UNVERIFIED, + enum: true, + deprecated: false extensions [{1000, Protobuf.Extension.max()}] end @@ -160,25 +343,25 @@ end defmodule Google.Protobuf.FieldDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :number, 3, optional: true, type: :int32 field :label, 4, optional: true, type: Google.Protobuf.FieldDescriptorProto.Label, enum: true field :type, 5, optional: true, type: Google.Protobuf.FieldDescriptorProto.Type, enum: true - field :type_name, 6, optional: true, type: :string + field :type_name, 6, optional: true, type: :string, json_name: "typeName" field :extendee, 2, optional: true, type: :string - field :default_value, 7, optional: true, type: :string - field :oneof_index, 9, optional: true, type: :int32 - field :json_name, 10, optional: true, type: :string + field :default_value, 7, optional: true, type: :string, json_name: "defaultValue" + field :oneof_index, 9, optional: true, type: :int32, json_name: "oneofIndex" + field :json_name, 10, optional: true, type: :string, json_name: "jsonName" field :options, 8, optional: true, type: Google.Protobuf.FieldOptions - field :proto3_optional, 17, optional: true, type: :bool + field :proto3_optional, 17, optional: true, type: :bool, json_name: "proto3Optional" end defmodule Google.Protobuf.OneofDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :options, 2, optional: true, type: Google.Protobuf.OneofOptions @@ -187,7 +370,7 @@ end defmodule Google.Protobuf.EnumDescriptorProto.EnumReservedRange do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :start, 1, optional: true, type: :int32 field :end, 2, optional: true, type: :int32 @@ -196,7 +379,7 @@ end defmodule Google.Protobuf.EnumDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :value, 2, repeated: true, type: Google.Protobuf.EnumValueDescriptorProto @@ -204,15 +387,16 @@ defmodule Google.Protobuf.EnumDescriptorProto do field :reserved_range, 4, repeated: true, - type: Google.Protobuf.EnumDescriptorProto.EnumReservedRange + type: Google.Protobuf.EnumDescriptorProto.EnumReservedRange, + json_name: "reservedRange" - field :reserved_name, 5, repeated: true, type: :string + field :reserved_name, 5, repeated: true, type: :string, json_name: "reservedName" end defmodule Google.Protobuf.EnumValueDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :number, 2, optional: true, type: :int32 @@ -222,7 +406,7 @@ end defmodule Google.Protobuf.ServiceDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string field :method, 2, repeated: true, type: Google.Protobuf.MethodDescriptorProto @@ -232,48 +416,105 @@ end defmodule Google.Protobuf.MethodDescriptorProto do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 1, optional: true, type: :string - field :input_type, 2, optional: true, type: :string - field :output_type, 3, optional: true, type: :string + field :input_type, 2, optional: true, type: :string, json_name: "inputType" + field :output_type, 3, optional: true, type: :string, json_name: "outputType" field :options, 4, optional: true, type: Google.Protobuf.MethodOptions - field :client_streaming, 5, optional: true, type: :bool, default: false - field :server_streaming, 6, optional: true, type: :bool, default: false + + field :client_streaming, 5, + optional: true, + type: :bool, + json_name: "clientStreaming", + default: false + + field :server_streaming, 6, + optional: true, + type: :bool, + json_name: "serverStreaming", + default: false end defmodule Google.Protobuf.FileOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :java_package, 1, optional: true, type: :string, json_name: "javaPackage" + field :java_outer_classname, 8, optional: true, type: :string, json_name: "javaOuterClassname" + + field :java_multiple_files, 10, + optional: true, + type: :bool, + json_name: "javaMultipleFiles", + default: false + + field :java_generate_equals_and_hash, 20, + optional: true, + type: :bool, + json_name: "javaGenerateEqualsAndHash", + deprecated: true - field :java_package, 1, optional: true, type: :string - field :java_outer_classname, 8, optional: true, type: :string - field :java_multiple_files, 10, optional: true, type: :bool, default: false - field :java_generate_equals_and_hash, 20, optional: true, type: :bool, deprecated: true - field :java_string_check_utf8, 27, optional: true, type: :bool, default: false + field :java_string_check_utf8, 27, + optional: true, + type: :bool, + json_name: "javaStringCheckUtf8", + default: false field :optimize_for, 9, optional: true, type: Google.Protobuf.FileOptions.OptimizeMode, + json_name: "optimizeFor", default: :SPEED, enum: true - field :go_package, 11, optional: true, type: :string - field :cc_generic_services, 16, optional: true, type: :bool, default: false - field :java_generic_services, 17, optional: true, type: :bool, default: false - field :py_generic_services, 18, optional: true, type: :bool, default: false - field :php_generic_services, 42, optional: true, type: :bool, default: false + field :go_package, 11, optional: true, type: :string, json_name: "goPackage" + + field :cc_generic_services, 16, + optional: true, + type: :bool, + json_name: "ccGenericServices", + default: false + + field :java_generic_services, 17, + optional: true, + type: :bool, + json_name: "javaGenericServices", + default: false + + field :py_generic_services, 18, + optional: true, + type: :bool, + json_name: "pyGenericServices", + default: false + field :deprecated, 23, optional: true, type: :bool, default: false - field :cc_enable_arenas, 31, optional: true, type: :bool, default: true - field :objc_class_prefix, 36, optional: true, type: :string - field :csharp_namespace, 37, optional: true, type: :string - field :swift_prefix, 39, optional: true, type: :string - field :php_class_prefix, 40, optional: true, type: :string - field :php_namespace, 41, optional: true, type: :string - field :php_metadata_namespace, 44, optional: true, type: :string - field :ruby_package, 45, optional: true, type: :string - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + field :cc_enable_arenas, 31, + optional: true, + type: :bool, + json_name: "ccEnableArenas", + default: true + + field :objc_class_prefix, 36, optional: true, type: :string, json_name: "objcClassPrefix" + field :csharp_namespace, 37, optional: true, type: :string, json_name: "csharpNamespace" + field :swift_prefix, 39, optional: true, type: :string, json_name: "swiftPrefix" + field :php_class_prefix, 40, optional: true, type: :string, json_name: "phpClassPrefix" + field :php_namespace, 41, optional: true, type: :string, json_name: "phpNamespace" + + field :php_metadata_namespace, 44, + optional: true, + type: :string, + json_name: "phpMetadataNamespace" + + field :ruby_package, 45, optional: true, type: :string, json_name: "rubyPackage" + field :features, 50, optional: true, type: Google.Protobuf.FeatureSet + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -281,22 +522,78 @@ end defmodule Google.Protobuf.MessageOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :message_set_wire_format, 1, + optional: true, + type: :bool, + json_name: "messageSetWireFormat", + default: false + + field :no_standard_descriptor_accessor, 2, + optional: true, + type: :bool, + json_name: "noStandardDescriptorAccessor", + default: false - field :message_set_wire_format, 1, optional: true, type: :bool, default: false - field :no_standard_descriptor_accessor, 2, optional: true, type: :bool, default: false field :deprecated, 3, optional: true, type: :bool, default: false - field :map_entry, 7, optional: true, type: :bool - field :deprecated_legacy_json_field_conflicts, 11, optional: true, type: :bool, deprecated: true - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :map_entry, 7, optional: true, type: :bool, json_name: "mapEntry" + + field :deprecated_legacy_json_field_conflicts, 11, + optional: true, + type: :bool, + json_name: "deprecatedLegacyJsonFieldConflicts", + deprecated: true + + field :features, 12, optional: true, type: Google.Protobuf.FeatureSet + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end +defmodule Google.Protobuf.FieldOptions.EditionDefault do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true + field :value, 2, optional: true, type: :string +end + +defmodule Google.Protobuf.FieldOptions.FeatureSupport do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :edition_introduced, 1, + optional: true, + type: Google.Protobuf.Edition, + json_name: "editionIntroduced", + enum: true + + field :edition_deprecated, 2, + optional: true, + type: Google.Protobuf.Edition, + json_name: "editionDeprecated", + enum: true + + field :deprecation_warning, 3, optional: true, type: :string, json_name: "deprecationWarning" + + field :edition_removed, 4, + optional: true, + type: Google.Protobuf.Edition, + json_name: "editionRemoved", + enum: true +end + defmodule Google.Protobuf.FieldOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :ctype, 1, optional: true, @@ -313,11 +610,43 @@ defmodule Google.Protobuf.FieldOptions do enum: true field :lazy, 5, optional: true, type: :bool, default: false - field :unverified_lazy, 15, optional: true, type: :bool, default: false + + field :unverified_lazy, 15, + optional: true, + type: :bool, + json_name: "unverifiedLazy", + default: false + field :deprecated, 3, optional: true, type: :bool, default: false field :weak, 10, optional: true, type: :bool, default: false - field :debug_redact, 16, optional: true, type: :bool, default: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :debug_redact, 16, optional: true, type: :bool, json_name: "debugRedact", default: false + + field :retention, 17, + optional: true, + type: Google.Protobuf.FieldOptions.OptionRetention, + enum: true + + field :targets, 19, + repeated: true, + type: Google.Protobuf.FieldOptions.OptionTargetType, + enum: true + + field :edition_defaults, 20, + repeated: true, + type: Google.Protobuf.FieldOptions.EditionDefault, + json_name: "editionDefaults" + + field :features, 21, optional: true, type: Google.Protobuf.FeatureSet + + field :feature_support, 22, + optional: true, + type: Google.Protobuf.FieldOptions.FeatureSupport, + json_name: "featureSupport" + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -325,9 +654,14 @@ end defmodule Google.Protobuf.OneofOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :features, 1, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -335,12 +669,23 @@ end defmodule Google.Protobuf.EnumOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 - field :allow_alias, 2, optional: true, type: :bool + field :allow_alias, 2, optional: true, type: :bool, json_name: "allowAlias" field :deprecated, 3, optional: true, type: :bool, default: false - field :deprecated_legacy_json_field_conflicts, 6, optional: true, type: :bool, deprecated: true - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + field :deprecated_legacy_json_field_conflicts, 6, + optional: true, + type: :bool, + json_name: "deprecatedLegacyJsonFieldConflicts", + deprecated: true + + field :features, 7, optional: true, type: Google.Protobuf.FeatureSet + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -348,10 +693,21 @@ end defmodule Google.Protobuf.EnumValueOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :deprecated, 1, optional: true, type: :bool, default: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :features, 2, optional: true, type: Google.Protobuf.FeatureSet + field :debug_redact, 3, optional: true, type: :bool, json_name: "debugRedact", default: false + + field :feature_support, 4, + optional: true, + type: Google.Protobuf.FieldOptions.FeatureSupport, + json_name: "featureSupport" + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -359,10 +715,15 @@ end defmodule Google.Protobuf.ServiceOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + field :features, 34, optional: true, type: Google.Protobuf.FeatureSet field :deprecated, 33, optional: true, type: :bool, default: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -370,17 +731,23 @@ end defmodule Google.Protobuf.MethodOptions do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :deprecated, 33, optional: true, type: :bool, default: false field :idempotency_level, 34, optional: true, type: Google.Protobuf.MethodOptions.IdempotencyLevel, + json_name: "idempotencyLevel", default: :IDEMPOTENCY_UNKNOWN, enum: true - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field :features, 35, optional: true, type: Google.Protobuf.FeatureSet + + field :uninterpreted_option, 999, + repeated: true, + type: Google.Protobuf.UninterpretedOption, + json_name: "uninterpretedOption" extensions [{1000, Protobuf.Extension.max()}] end @@ -388,53 +755,149 @@ end defmodule Google.Protobuf.UninterpretedOption.NamePart do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 - field :name_part, 1, required: true, type: :string - field :is_extension, 2, required: true, type: :bool + field :name_part, 1, required: true, type: :string, json_name: "namePart" + field :is_extension, 2, required: true, type: :bool, json_name: "isExtension" end defmodule Google.Protobuf.UninterpretedOption do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :name, 2, repeated: true, type: Google.Protobuf.UninterpretedOption.NamePart - field :identifier_value, 3, optional: true, type: :string - field :positive_int_value, 4, optional: true, type: :uint64 - field :negative_int_value, 5, optional: true, type: :int64 - field :double_value, 6, optional: true, type: :double - field :string_value, 7, optional: true, type: :bytes - field :aggregate_value, 8, optional: true, type: :string + field :identifier_value, 3, optional: true, type: :string, json_name: "identifierValue" + field :positive_int_value, 4, optional: true, type: :uint64, json_name: "positiveIntValue" + field :negative_int_value, 5, optional: true, type: :int64, json_name: "negativeIntValue" + field :double_value, 6, optional: true, type: :double, json_name: "doubleValue" + field :string_value, 7, optional: true, type: :bytes, json_name: "stringValue" + field :aggregate_value, 8, optional: true, type: :string, json_name: "aggregateValue" +end + +defmodule Google.Protobuf.FeatureSet do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :field_presence, 1, + optional: true, + type: Google.Protobuf.FeatureSet.FieldPresence, + json_name: "fieldPresence", + enum: true, + deprecated: false + + field :enum_type, 2, + optional: true, + type: Google.Protobuf.FeatureSet.EnumType, + json_name: "enumType", + enum: true, + deprecated: false + + field :repeated_field_encoding, 3, + optional: true, + type: Google.Protobuf.FeatureSet.RepeatedFieldEncoding, + json_name: "repeatedFieldEncoding", + enum: true, + deprecated: false + + field :utf8_validation, 4, + optional: true, + type: Google.Protobuf.FeatureSet.Utf8Validation, + json_name: "utf8Validation", + enum: true, + deprecated: false + + field :message_encoding, 5, + optional: true, + type: Google.Protobuf.FeatureSet.MessageEncoding, + json_name: "messageEncoding", + enum: true, + deprecated: false + + field :json_format, 6, + optional: true, + type: Google.Protobuf.FeatureSet.JsonFormat, + json_name: "jsonFormat", + enum: true, + deprecated: false + + extensions [{1000, 9995}, {9995, 10000}, {10000, 10001}] +end + +defmodule Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true + + field :overridable_features, 4, + optional: true, + type: Google.Protobuf.FeatureSet, + json_name: "overridableFeatures" + + field :fixed_features, 5, + optional: true, + type: Google.Protobuf.FeatureSet, + json_name: "fixedFeatures" +end + +defmodule Google.Protobuf.FeatureSetDefaults do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 + + field :defaults, 1, + repeated: true, + type: Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault + + field :minimum_edition, 4, + optional: true, + type: Google.Protobuf.Edition, + json_name: "minimumEdition", + enum: true + + field :maximum_edition, 5, + optional: true, + type: Google.Protobuf.Edition, + json_name: "maximumEdition", + enum: true end defmodule Google.Protobuf.SourceCodeInfo.Location do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false field :span, 2, repeated: true, type: :int32, packed: true, deprecated: false - field :leading_comments, 3, optional: true, type: :string - field :trailing_comments, 4, optional: true, type: :string - field :leading_detached_comments, 6, repeated: true, type: :string + field :leading_comments, 3, optional: true, type: :string, json_name: "leadingComments" + field :trailing_comments, 4, optional: true, type: :string, json_name: "trailingComments" + + field :leading_detached_comments, 6, + repeated: true, + type: :string, + json_name: "leadingDetachedComments" end defmodule Google.Protobuf.SourceCodeInfo do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :location, 1, repeated: true, type: Google.Protobuf.SourceCodeInfo.Location + + extensions [{536_000_000, 536_000_001}] end defmodule Google.Protobuf.GeneratedCodeInfo.Annotation do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false - field :source_file, 2, optional: true, type: :string + field :source_file, 2, optional: true, type: :string, json_name: "sourceFile" field :begin, 3, optional: true, type: :int32 field :end, 4, optional: true, type: :int32 @@ -447,7 +910,7 @@ end defmodule Google.Protobuf.GeneratedCodeInfo do @moduledoc false - use Protobuf, syntax: :proto2, protoc_gen_elixir_version: "0.13.0" + use Protobuf, protoc_gen_elixir_version: "0.13.0", syntax: :proto2 field :annotation, 1, repeated: true, type: Google.Protobuf.GeneratedCodeInfo.Annotation end diff --git a/mix.exs b/mix.exs index 5908b0bf..838da546 100644 --- a/mix.exs +++ b/mix.exs @@ -57,7 +57,7 @@ defmodule Protobuf.Mixfile do # and make sure it's there for tests without Git submodules or anything like that. {:google_protobuf, github: "protocolbuffers/protobuf", - ref: "d36a64116f19ce59acf3af49e66cadef4c2fb2df", + ref: "b407e8416e3893036aee5af9a12bd9b6a0e2b2e6", submodules: true, app: false, compile: false, diff --git a/mix.lock b/mix.lock index 4c3c32f8..149deac8 100644 --- a/mix.lock +++ b/mix.lock @@ -8,7 +8,7 @@ "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "excoveralls": {:hex, :excoveralls, "0.14.6", "610e921e25b180a8538229ef547957f7e04bd3d3e9a55c7c5b7d24354abbba70", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "0eceddaa9785cfcefbf3cd37812705f9d8ad34a758e513bb975b081dce4eb11e"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "google_protobuf": {:git, "https://github.com/protocolbuffers/protobuf.git", "d36a64116f19ce59acf3af49e66cadef4c2fb2df", [ref: "d36a64116f19ce59acf3af49e66cadef4c2fb2df", submodules: true]}, + "google_protobuf": {:git, "https://github.com/protocolbuffers/protobuf.git", "b407e8416e3893036aee5af9a12bd9b6a0e2b2e6", [ref: "b407e8416e3893036aee5af9a12bd9b6a0e2b2e6", submodules: true]}, "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, diff --git a/test/protobuf/protobuf_test.exs b/test/protobuf/protobuf_test.exs index b227bc5c..103cf952 100644 --- a/test/protobuf/protobuf_test.exs +++ b/test/protobuf/protobuf_test.exs @@ -2,9 +2,9 @@ defmodule Protobuf.ProtobufTest do use ExUnit.Case, async: false test "load_extensions/0 is a noop" do + assert loaded_extensions() == 18 Protobuf.load_extensions() - assert loaded_extensions() == 15 - assert loaded_extensions() == 15 + assert loaded_extensions() == 18 end describe "encode/1" do