aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/config.h
diff options
context:
space:
mode:
authorbbiff <bbiff@yandex-team.com>2022-09-11 00:15:54 +0300
committerbbiff <bbiff@yandex-team.com>2022-09-11 00:15:54 +0300
commit67576a8962c2506b8ee10da48dffba311acb0042 (patch)
tree51a695bbddbb9be4e5a0cc5c7ec558ca233c2be5 /library/cpp/protobuf/json/config.h
parenta8945929eb162f6910b228697c3d2db3b7cb2ca9 (diff)
downloadydb-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.h8
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;