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 | 2e0ed5ad2d70bf924ccd3cbbfab508784ab36325 (patch) | |
tree | c407f44de8fd4579bf0ceffc822d243ff76cfd26 /library/cpp/protobuf/json/json2proto.cpp | |
parent | ab32245a89d56835833808c7e644b3da277d7085 (diff) | |
download | ydb-2e0ed5ad2d70bf924ccd3cbbfab508784ab36325.tar.gz |
Restoring authorship annotation for <mikari@yandex-team.ru>. Commit 1 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 640c10f5a5..f3f642bf81 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]) { |