Skip to content

Fix the jsonPath helper to write extracted arrays in JSON format#3330

Merged
RafeArnold merged 1 commit into
wiremock:masterfrom
picimako:jsonpath-write-json-arrays-as-json
Mar 13, 2026
Merged

Fix the jsonPath helper to write extracted arrays in JSON format#3330
RafeArnold merged 1 commit into
wiremock:masterfrom
picimako:jsonpath-write-json-arrays-as-json

Conversation

@picimako

Copy link
Copy Markdown
Contributor

Previously, when the jsonPath helper was used to extract an array, the resulting array was written as e.g.

[{name=One}, {name=Two}, {name=Three}]

intead of in JSON format:

[{"name" : "One"}, {"name" : "Two"}, {"name" : "Three"}]

which made it inconsistent with object extraction since it produces the actual JSON object.

This behaviour of array extraction also made it necessary to apply the toJson helper too to receive the array in the actual JSON format.

References

  • TODO

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@picimako picimako requested a review from a team as a code owner February 13, 2026 12:26
@RafeArnold RafeArnold merged commit 576a85e into wiremock:master Mar 13, 2026
5 checks passed
@RafeArnold

Copy link
Copy Markdown
Contributor

thanks @picimako !

@picimako picimako deleted the jsonpath-write-json-arrays-as-json branch March 20, 2026 05:51
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