diff options
author | bbiff <bbiff@yandex-team.com> | 2022-09-11 00:15:54 +0300 |
---|---|---|
committer | bbiff <bbiff@yandex-team.com> | 2022-09-11 00:15:54 +0300 |
commit | 67576a8962c2506b8ee10da48dffba311acb0042 (patch) | |
tree | 51a695bbddbb9be4e5a0cc5c7ec558ca233c2be5 /library/cpp/protobuf/json/config.h | |
parent | a8945929eb162f6910b228697c3d2db3b7cb2ca9 (diff) | |
download | ydb-67576a8962c2506b8ee10da48dffba311acb0042.tar.gz |
support duration and timestamp as string in json2proto
Diffstat (limited to 'library/cpp/protobuf/json/config.h')
-rw-r--r-- | library/cpp/protobuf/json/config.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/cpp/protobuf/json/config.h b/library/cpp/protobuf/json/config.h index dc84fb4d5d..8b9d60ab4f 100644 --- a/library/cpp/protobuf/json/config.h +++ b/library/cpp/protobuf/json/config.h @@ -65,6 +65,9 @@ namespace NProtobufJson { /// with FieldNameMode. bool UseJsonName = false; + // Allow nonstandard conversions, e.g. from google.protobuf.Duration to string + bool ConvertTimeAsString = false; + /// Transforms will be applied only to string values (== protobuf fields of string / bytes type). /// yajl_encode_string will be used if no transforms are specified. TVector<TStringTransformPtr> StringTransforms; @@ -125,6 +128,11 @@ namespace NProtobufJson { return *this; } + TSelf& SetConvertTimeAsString(bool value) { + ConvertTimeAsString = value; + return *this; + } + TSelf& SetExtensionFieldNameMode(ExtFldNameMode mode) { ExtensionFieldNameMode = mode; return *this; |