-
Notifications
You must be signed in to change notification settings - Fork 876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: JSON.GET now works with our own jsonpath #2653
Conversation
@@ -30,6 +30,12 @@ class TestDriver : public Driver { | |||
} | |||
}; | |||
|
|||
inline JsonType ValidJson(string_view str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a convenience wrapper
@@ -123,6 +129,19 @@ TEST_F(JsonPathTest, Parser) { | |||
EXPECT_EQ(0, Parse("$.plays[*].game")); | |||
} | |||
|
|||
TEST_F(JsonPathTest, Root) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only change is this test. Now for empty Path we return the whole object to satisfy $
query.
@@ -65,6 +65,17 @@ inline void Evaluate(const json::Path& expr, const JsonType& obj, ExprCallback c | |||
}); | |||
} | |||
|
|||
inline JsonType Evaluate(const JsonExpression& expr, const JsonType& obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a special variant of Evaluate that does not accept a callback and instead returns all the hits as a json array.
return expr.evaluate(obj); | ||
} | ||
|
||
inline JsonType Evaluate(const json::Path& expr, const JsonType& obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same variant for json::Path
No description provided.