When i use the json file in other code base by pact stub server , it gets the request from UI as ===> Received Request ( method: GET, path: /api/assets/10006, query: None, headers: Some({"actasuserid": "5", "content-type": "application/vnd.nativ.mio.v1+json", "host": "masteraccount.local.nativ.tv:30044", "accept": "application/json", "authorization": "Basic bWFzdGVydXNlcjptYXN0ZXJ1c2Vy", "connection": "close", "content-length": "2"}), body: Present(2 bytes) )
but does not sends any response
But if i just remove the matching rules part "matchingRules": { "$.path": { "match": "regex", "regex": "\/api\/assets\/[0-9]+" } } it starts to work again
describe('Getting asset for player', () => { before(() => { return provider.addInteraction({ given: 'GET call', uponReceiving: 'Get asset for player', withRequest: { method: 'GET', path: term({ matcher: '/api/assets/[0-9]+', generate: '/api/assets/10006' }), }, willRespondWith: { status: 200, headers: { 'Content-Type': 'application/json' }, body: assetByPlayer } }); });
}); I get the json file as : https://pastebin.com/TqRbTmNS
When i use the json file in other code base by pact stub server , it gets the request from UI as ===> Received Request ( method: GET, path: /api/assets/10006, query: None, headers: Some({"actasuserid": "5", "content-type": "application/vnd.nativ.mio.v1+json", "host": "masteraccount.local.nativ.tv:30044", "accept": "application/json", "authorization": "Basic bWFzdGVydXNlcjptYXN0ZXJ1c2Vy", "connection": "close", "content-length": "2"}), body: Present(2 bytes) )
but does not sends any response
But if i just remove the matching rules part "matchingRules": { "$.path": { "match": "regex", "regex": "\/api\/assets\/[0-9]+" } } it starts to work again
===> Received Request ( method: GET, path: /api/assets/10006, query: None, headers: Some({"authorization": "Basic bWFzdGVydXNlcjptYXN0ZXJ1c2Vy", "accept": "application/json", "content-length": "2", "connection": "close", "host": "masteraccount.local.nativ.tv:30044", "content-type": "application/vnd.nativ.mio.v1+json", "actasuserid": "5"}), body: Present(2 bytes) )
<=== Sending Response ( status: 200, headers: Some({"Content-Type": "application/json"}), body: Present(4500 bytes) )
and I can see the data to be present
Could you let me what is wrong here ?