mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix(json_family): Fix error in JsonFamilyTest.MGet (#3285)
* fix(json_family): Fix error in JsonFamilyTest.MGet Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): address comments Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): Change LOG(WARNING) to VLOG(2) Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * fix(json_family): Test case when jsonpathv2 is false Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> * refactor(json_family): Update VLOGs level from 2 to 1 Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com> --------- Signed-off-by: Stepan Bagritsevich <bagr.stepan@gmail.com>
This commit is contained in:
parent
628985bed2
commit
e914a5f7cf
3 changed files with 9 additions and 2 deletions
|
@ -1447,10 +1447,16 @@ io::Result<JsonPathV2, string> ParsePathV2(string_view path) {
|
|||
}
|
||||
|
||||
if (absl::GetFlag(FLAGS_jsonpathv2)) {
|
||||
return json::ParsePath(path);
|
||||
auto path_result = json::ParsePath(path);
|
||||
if (!path_result) {
|
||||
VLOG(1) << "Invalid Json path: " << path << ' ' << path_result.error() << std::endl;
|
||||
return nonstd::make_unexpected(kSyntaxErr);
|
||||
}
|
||||
return path_result;
|
||||
}
|
||||
io::Result<JsonExpression> expr_result = ParseJsonPath(path);
|
||||
if (!expr_result) {
|
||||
VLOG(1) << "Invalid Json path: " << path << ' ' << expr_result.error() << std::endl;
|
||||
return nonstd::make_unexpected(kSyntaxErr);
|
||||
}
|
||||
return JsonPathV2(std::move(expr_result.value()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue