Wiremock standalone set/set null value in response template
352 views
Skip to first unread message
Razvan Cîmpean
unread,
Oct 12, 2022, 9:27:27 AM10/12/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremock-user
Hi,
How can I get the null or numeric value of a field from my request and use it in the response?
So far using transformers I can only get the string value of null(empty string) or of a numeric value (ex: "123" instead of 123) - see attached imgs for more info.
Thanks.
mapping file:
request payload:
Expected response:
Actual response:
Tom Akehurst
unread,
Oct 13, 2022, 8:33:43 AM10/13/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremock-user
I think the problem here is that you're passing requestBody to the jsonPath helper, whereas it needs to be request.body: