aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/proto2json_printer.cpp
diff options
context:
space:
mode:
authorbulatman <bulatman@yandex-team.com>2022-12-16 16:19:13 +0300
committerbulatman <bulatman@yandex-team.com>2022-12-16 16:19:13 +0300
commitb7ee1c8a87b97e1ce35c3b9c101230e67daebac4 (patch)
treed65aa8374285ad88fad00e980f930b535110b506 /library/cpp/protobuf/json/proto2json_printer.cpp
parentdcce88f9fa7e94021bf0221b8d43b5ac747f4829 (diff)
downloadydb-b7ee1c8a87b97e1ce35c3b9c101230e67daebac4.tar.gz
Do not print missing oneof field in proto2json even MissingKeyDefault is specified
Diffstat (limited to 'library/cpp/protobuf/json/proto2json_printer.cpp')
-rw-r--r--library/cpp/protobuf/json/proto2json_printer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/cpp/protobuf/json/proto2json_printer.cpp b/library/cpp/protobuf/json/proto2json_printer.cpp
index 409147dc06..6ec7800ad3 100644
--- a/library/cpp/protobuf/json/proto2json_printer.cpp
+++ b/library/cpp/protobuf/json/proto2json_printer.cpp
@@ -234,7 +234,8 @@ namespace NProtobufJson {
<< field.full_name() << ".";
}
}
- shouldPrintField = shouldPrintField || GetConfig().MissingSingleKeyMode == TProto2JsonConfig::MissingKeyDefault;
+ shouldPrintField = shouldPrintField ||
+ (GetConfig().MissingSingleKeyMode == TProto2JsonConfig::MissingKeyDefault && !field.containing_oneof());
if (shouldPrintField) {
switch (field.cpp_type()) {