-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Format response field as decimal number instead of string when using JsonPath. #855
Comments
@robertmircea So: "BodyAsJson": {
"reservedAmount": "{{request.bodyAsJson.price}}",
"transactionId": "{{Random type='Guid' Format='N'}}"
}, |
Your recommendation works but the price field is still formatted incorrectly as a string instead of a number and it uses a comma instead of a decimal dot:
|
I'll take a look. |
@robertmircea https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions |
It works! Looks good! Can you include the fix please in a nuget release? |
Yes I will release a new nuget soon. |
I am using the following mapping JSON file:
Please note the following transformation expression for "reservedAmount" field in the response:
"reservedAmount": "{{JsonPath.SelectToken request.bodyAsJson \"price\"}}",
The transformer generates the following json response given that I send the following request to Wiremock standalone server:
Response:
Two questions:
reservedAmount
field as JSON decimal number and not as a string?The text was updated successfully, but these errors were encountered: