diff options
| author | malkovskynv <[email protected]> | 2023-08-03 13:42:05 +0300 |
|---|---|---|
| committer | malkovskynv <[email protected]> | 2023-08-03 13:42:05 +0300 |
| commit | 29af40f86c4159175acf78d57de7cd39e44c0dab (patch) | |
| tree | 016948d29c43f651dd64d5a9f2d9cbdd4a827bfc /library/cpp/protobuf/json/proto/enum_options.proto | |
| parent | fef1ffbaef82af08b6201f41c2ed15723a4fe1cf (diff) | |
MARKETRECOM-8673_json_enum_value
Diffstat (limited to 'library/cpp/protobuf/json/proto/enum_options.proto')
| -rw-r--r-- | library/cpp/protobuf/json/proto/enum_options.proto | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/library/cpp/protobuf/json/proto/enum_options.proto b/library/cpp/protobuf/json/proto/enum_options.proto new file mode 100644 index 00000000000..0349187b36c --- /dev/null +++ b/library/cpp/protobuf/json/proto/enum_options.proto @@ -0,0 +1,23 @@ +syntax="proto3"; + +import "google/protobuf/descriptor.proto"; + +/** +Allows custom strings for Enum proto values when converting to/from json + +Example: + +Enum SomeEnum { + DefaultEnumValue = 0 [json_enum_value="custom_name_for_default_value"]; +} +message TProtoTest { + SomeEnum someField = 0 [json_name="some_field"]; +} + +will correspond {"some_field": "custom_name_for_default_value"} +when [Proto2JsonConfig|Json2ProtoConfig].UseJsonEnumValue = True + +*/ +extend google.protobuf.EnumValueOptions { + string json_enum_value = 4242279; +} |
