Dragutin Todorović
10/20/2023, 8:40 AM{
"name": "recordState",
"parameters": {
"state": {
"id": "{{jsonPath response.body '$.id'}}",
"name": "{{jsonPath request.body '$.name'}}",
"externalId": "{{jsonPath request.body '$.externalId'}}"
},
"context": "resource-{{jsonPath response.body '$.id'}}"
}
}
If in the body any param is not passed, recordState will put in the context anyway this field with value empty string ""
. Afterward, when I want to GET this resource on GET endpoint, I’ll receive in the response empty string for value which is initially not passed (nullable field). Actually it should return null.
Desired behaviour is to differentiate null from empty string.
How to achieve desired behaviour of the mock?default='null'
and it’s returning in the response "null"
as string.
But since this field should be numeric, I don’t want it to return in the response "externalId": "null"
, I want it to be "externalId": null
Dirk Bolte
10/20/2023, 11:43 AMDragutin Todorović
10/20/2023, 11:48 AM