mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
How to create a implement a JsonMatcher or JsonPartialMatcher With Regex? #378
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AndresGMD on GitHub (Oct 20, 2021).
Hello every one!!
In the case I would like to implement a Json Matcher just for detect Json Keys for any Value.
How can this be implemented? Thanks in advance
@StefH commented on GitHub (Oct 23, 2021):
@andresendava
Please explain in more detail what you want to match (add some examples)
@AndresGMD commented on GitHub (Oct 25, 2021):
Hi Stef,
Off course.
I would like to know how I can further validate the structure with any value. Example:
This is my Dataset I would like to validate.
If I Include Another Dataset in Request Body (Change Name with Las Name):
The result will be:
Thanks in advance
@StefH commented on GitHub (Oct 26, 2021):
@andresendava
I've created a new matcher : "JsonPartialWildcardMatcher" which can be used like:
will match:
This new code is present in a preview build version :
1.4.24-ci-15542.See https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
PR
https://github.com/WireMock-Net/WireMock.Net/pull/667
@AndresGMD commented on GitHub (Oct 26, 2021):
Hi @StefH
Thanks a lot!.
Additional info: For Install in MAC I check Include prerelease & and I have to update all WireMock Packages.
@AndresGMD commented on GitHub (Oct 27, 2021):
It is working very well
Wrong dataset:
Correct dataset
@StefH commented on GitHub (Oct 27, 2021):
Hello @andresendava ,
Thank you for testing. I'll merge the PR and in some time this functionality is also present in official nuget.