Skip to content
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

Add JSON path evaluation #18

Merged
merged 3 commits into from
Feb 21, 2024
Merged

Add JSON path evaluation #18

merged 3 commits into from
Feb 21, 2024

Conversation

chirauki
Copy link
Contributor

Add JSON path evaluation for the response body.

You provide 2 arguments:

  • jsonpath is the expression to run against the response JSON (eg. {.service})
  • json_value is a regexp that will be run against the result of the JSONPath evaluation. Eg. if the result of executing the JSONPath evaluation returns fancy-online-server, you could provide fancy-online-server, fancy-.*-server, fancy-(online|offline)-server, etc.

You need to provide both arguments to use this feature, and the check will pass only if the regexp matches with the output of running the JSONPath expression against the response body.

Copy link

@oktocat oktocat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Just add a doc/example, otherwise LGTM

@oktocat oktocat self-requested a review February 20, 2024 17:32
@chirauki chirauki merged commit 2f47cfe into main Feb 21, 2024
3 checks passed
@chirauki chirauki deleted the body-jsonpath branch February 21, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants