I have a JSON request and I need to check that the value of one field is json. I'm trying use regex:
"request": {
...
"bodyPatterns": [
{
"equalToJson": {
"field_1": "Value",
"field_2": "${json-unit.any-number}",
"field_3": "${json-unit.regex}^\u007B.\u007D$"
}
}
]
}
Also I have tried:
"field_3": "${json-unit.regex}\\{.\\}"
"field_3": "${json-unit.regex}{.}"
But none of this works. How will it be correct to determine that the value of the field contains JSON?
An example request that must match the stub:
{
"field_1": "Value",
"field_2": 100,
"field_3": {
"1.1": 2,
"1.2": null,
"1.3": null,
"1.4": null,
...
}
}