Skip to content

Conversation

@Haisia
Copy link

@Haisia Haisia commented Nov 8, 2025

Implementation Notes

Approach difference from the original issue:

Instead of using containing() with string manipulation (as suggested in #776),
this implementation uses matchingJsonPath + equalToJson for better reliability.

Why?

  • JSON-aware matching (structure, not strings)
  • Handles nested objects and formatting variations
  • Resilient to whitespace and key ordering
  • String matching breaks with complex values

Implementation:

requestContaining.forEach { (key, value) ->
  builder.withRequestBody(
    matchingJsonPath("$.$key", equalToJson(String(serde.serialize(value))))
  )
}

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