How to set null value in wiremock standalone response template?

81 views
Skip to first unread message

Ankita Nautiyal

unread,
Jan 28, 2023, 1:38:09 PM1/28/23
to wiremock-user
Hi Team,

I have to mock this request to my response template - 

{
    "endToEndId": [
        null
    ]
}


Tried using matchesJsonPath  , that didnot help .Is there any other way where can map this request to my response?


using jar - wiremock-standalone-2.32.0.jar

Ankita Nautiyal

unread,
Jan 28, 2023, 1:44:11 PM1/28/23
to wiremock-user
Also tried this in files -

{
"priority": 10,
"request": {
"method": "POST",
"urlPathPattern": "/wiremock/tsapi/v1.1/payment/statustnt",
"bodyPatterns": [
{
"equalToJson" : "{\"'endToEndId'\":['null']}",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true,
"absent":true
}
]
},
"response": {
"status": 200,
"bodyFileName": "partner/statusDefaultResponse.json",
"headers": {
"Content-Type": "application/json; charset=utf-8"
}
}
}


Which didnot help

Uri Maoz

unread,
Jan 29, 2023, 12:59:32 PM1/29/23
to wiremock-user
Hi

Can you please post the question in our Slack community? We are moving the WireMock discussions to Slack community 

You can join here:


Thanks,

Uri
Reply all
Reply to author
Forward
0 new messages