diff options
author | art-snake <art-snake@yandex-team.ru> | 2022-02-10 16:50:35 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:35 +0300 |
commit | dc5517df41fe6319ff249956fe5650e4bbc3e660 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/json/json2proto.cpp | |
parent | 1700010e2088971894d12a7a16d6004866f986fd (diff) | |
download | ydb-dc5517df41fe6319ff249956fe5650e4bbc3e660.tar.gz |
Restoring authorship annotation for <art-snake@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/json2proto.cpp')
-rw-r--r-- | library/cpp/protobuf/json/json2proto.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index f19204ac35..640c10f5a5 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -19,10 +19,10 @@ } \ if (!json.JsonCheckType()) { \ if (config.CastFromString && json.IsString()) { \ - if (config.DoNotCastEmptyStrings && json.GetString().empty()) { \ - /* Empty string is same as "no value" for scalar types.*/ \ - break; \ - } \ + if (config.DoNotCastEmptyStrings && json.GetString().empty()) { \ + /* Empty string is same as "no value" for scalar types.*/ \ + break; \ + } \ reflection->ProtoSet(&proto, &field, FromString(json.GetString())); \ break; \ } \ @@ -335,7 +335,7 @@ Json2RepeatedField(const NJson::TJsonValue& json, } } - if (fieldJson.GetType() != NJson::JSON_ARRAY && !config.MapAsObject && !config.VectorizeScalars && !config.ValueVectorizer) { + if (fieldJson.GetType() != NJson::JSON_ARRAY && !config.MapAsObject && !config.VectorizeScalars && !config.ValueVectorizer) { ythrow yexception() << "JSON field doesn't represent an array for " << name << "(actual type is " @@ -361,10 +361,10 @@ Json2RepeatedField(const NJson::TJsonValue& json, for (const NJson::TJsonValue& jsonValue : jsonArray) { Json2RepeatedFieldValue(jsonValue, proto, field, config, reflection); } - } else if (config.ValueVectorizer) { - for (const NJson::TJsonValue& jsonValue : config.ValueVectorizer(fieldJson)) { - Json2RepeatedFieldValue(jsonValue, proto, field, config, reflection); - } + } else if (config.ValueVectorizer) { + for (const NJson::TJsonValue& jsonValue : config.ValueVectorizer(fieldJson)) { + Json2RepeatedFieldValue(jsonValue, proto, field, config, reflection); + } } else if (config.VectorizeScalars) { Json2RepeatedFieldValue(fieldJson, proto, field, config, reflection); } |