-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support JSONPath expression syntax #44
Comments
I have a local branch that does exactly that. I haven't added anything regarding that to #39, but will consider it. So it will be added to either |
Do you have any experience with mtdowling/jmespath.php? That seems to be somewhat more stable than flow/jsonpath (at least wrt version numbers) and has a bunch more downloads. |
To be honest I have only experience with jmespath.php and would prefer it for the same reasons. |
I have finally started working on this, and have currently come up with two possible steps:
and
The first does a simple value matching using Are you still interested in this functionality @oqq? If so, do you have anything to add to the above? |
Of curse I am! Maybe a test with Assertion::same would fail, since the response string is not exactly the same for a json string. I would like to a test against json data type (string, number, object, area, boolean and null). |
Perhaps sending the data through to the array comparator would work better. Then one could use the matcher functions against the data found by the expression. |
Hi @christeredvartsen!
Your current implementation for json tests are not really flexible. I would recommend another approach for a test expression.
How about a new behavior like
@Then JSONPath :path in response contains :value
, where :path got resolved by something like https://github.com/FlowCommunications/JSONPath and the value could be any scalar value or one of your@function
expressions.The text was updated successfully, but these errors were encountered: