我有以下带有以下交互的协议文件
"interactions": [
{
"description": "I call fixture service using a valid fixture Id",
"providerState": "a request to check the api response",
"request": {
"method": "get",
"path": "/api/v1.0/abc/5d550d86-fe18-44e5-93d2-817318acca3d",
"headers": {
"Accept": "application/json",
"X-Clarksons-Security-Cloud": "xxxxyyyyy"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"body": {
"fixtureId": "5d550d86-fe18-44e5-93d2-817318acca3d",
"fixtureNumber": "145393-02-DR-03-18"
},
"matchingRules": {
"$.body.fixtureId": {
"match": "type"
},
"$.body.fixtureNumber": {
"match": "regex",
"regex": "[0-9]{6}-[0-9]{2}-[a-zA-Z]{2}-[0-9]{2}-[0-9]{2}"
}
}
}
}
],
有机会fixtureNumber
可以为空。请让我知道一个匹配器,它既可以检查[0-9]{6}-[0-9]{2}-[a-zA-Z]{2}-[0-9]{2}-[0-9]{2}
也可以检查空值。