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

Fixed JsonPathMatcher to match nested objects #966

Merged
merged 4 commits into from
Jul 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.
  • Loading branch information
StefH committed Jul 12, 2023
commit 97bcf6d887399968113c70c81d5a56d8991711ee
1 change: 1 addition & 0 deletions src/WireMock.Net/Matchers/JSONPathMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public double IsMatch(object? input)
private double IsMatch(JToken jToken)
{
// https://github.com/WireMock-Net/WireMock.Net/issues/965
// https://stackoverflow.com/questions/66922188/newtonsoft-jsonpath-with-c-sharp-syntax
// Filtering using SelectToken() isn't guaranteed to work for objects inside objects -- only objects inside arrays.
// So this code checks if it's an JArray, if it's not an array, construct a new JArray.
JToken newJToken;
Expand Down
Loading