diff options
author | mikari <mikari@yandex-team.ru> | 2022-02-10 16:48:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:47 +0300 |
commit | f821ddfc9200113ec259d8d35b7cf3833372abc9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/json/json2proto.cpp | |
parent | 2e0ed5ad2d70bf924ccd3cbbfab508784ab36325 (diff) | |
download | ydb-f821ddfc9200113ec259d8d35b7cf3833372abc9.tar.gz |
Restoring authorship annotation for <mikari@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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index f3f642bf81..640c10f5a5 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -13,10 +13,10 @@ #define JSON_TO_FIELD(EProtoCppType, name, json, JsonCheckType, ProtoSet, JsonGet) \ case FieldDescriptor::EProtoCppType: { \ - if (config.CastRobust) { \ - reflection->ProtoSet(&proto, &field, json.JsonGet##Robust()); \ - break; \ - } \ + if (config.CastRobust) { \ + reflection->ProtoSet(&proto, &field, json.JsonGet##Robust()); \ + break; \ + } \ if (!json.JsonCheckType()) { \ if (config.CastFromString && json.IsString()) { \ if (config.DoNotCastEmptyStrings && json.GetString().empty()) { \ @@ -87,12 +87,12 @@ JsonString2Field(const NJson::TJsonValue& json, const Reflection* reflection = proto.GetReflection(); Y_ASSERT(!!reflection); - if (!json.IsString() && !config.CastRobust) { + if (!json.IsString() && !config.CastRobust) { ythrow yexception() << "Invalid type of JSON field '" << field.name() << "': " << "IsString() failed while " << "CPPTYPE_STRING is expected."; } - TString value = json.GetStringRobust(); + TString value = json.GetStringRobust(); for (size_t i = 0, endI = config.StringTransforms.size(); i < endI; ++i) { Y_ASSERT(!!config.StringTransforms[i]); if (!!config.StringTransforms[i]) { |