mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
How to match number with JsonPartialWildcardMatcher #403
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 @robertmircea on GitHub (Feb 13, 2022).
I have the following body matcher in json mapping file and I would like to match any number for
pricefield.The file loading crashes with
File xyz.json could not be read. This file will be skipped.probably because it is not a valid json file. If I specify:no matching happens (
No matching mapping found). UsingAllowPartialMapping=false@StefH commented on GitHub (Feb 14, 2022):
@robertmircea
No sorry.
This matcher can only match (at least for now) on string-values. I don't know yet how to implement this logic.
In the meantime, you could try to use the csharp-code-csharpcodematcher
@StefH commented on GitHub (Jul 11, 2022):
@robertmircea
I can fix this by allowing a regular expression:
So in your case:
@StefH commented on GitHub (Jul 11, 2022):
@robertmircea
You can try preview version
1.5.1-ci-16292(https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)@StefH commented on GitHub (Jul 11, 2022):
https://github.com/WireMock-Net/WireMock.Net/pull/771
@StefH commented on GitHub (Jul 13, 2022):
@robertmircea : did you have time to test?
@StefH commented on GitHub (Jul 18, 2022):
@robertmircea : Can you please test that preview version to see if this works for you?
@StefH commented on GitHub (Jul 24, 2022):
Merged to main and a new version is released to NuGet.
@robertmircea commented on GitHub (Aug 3, 2022):
For me, I confirm that this release allows me to match numbers using regex expression. Thank you for support.