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

Loose matching for JSON structures #551

Closed
nikolaik opened this issue Apr 25, 2022 · 0 comments · Fixed by #562
Closed

Loose matching for JSON structures #551

nikolaik opened this issue Apr 25, 2022 · 0 comments · Fixed by #562
Assignees

Comments

@nikolaik
Copy link

Allow matching partial JSON structures using the json_params_matcher similar to how #498 So you can more easily filter out requests that have a certain field set.

F.ex the matcher:

json_params_matcher({"message": ""}, strict_match=False)

would match a request with an empty message i.e and some other ignored fields

{
  "message": "",
  "id": 1,
  "field_x": "asdf"
}
@beliaev-maksim beliaev-maksim self-assigned this Jun 23, 2022
beliaev-maksim added a commit to beliaev-maksim/responses that referenced this issue Jun 23, 2022
markstory pushed a commit that referenced this issue Jul 5, 2022
Add support for the `loose` version of `json_params_matcher` via named argument `strict_match`. See #551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants