pact-specification icon indicating copy to clipboard operation
pact-specification copied to clipboard

Assure property exists

Open Sinuhe20 opened this issue 6 years ago • 3 comments

I'm not very satisfied with the matchers. With current matchers it's possible to say that if a property exists it has to be of a special type or must have a special content, but it's not possible to assure, that the property has to exist at all. For example, how would you assure with matchers that with

body: {
  "abc": "def"
}

property "abc" is a string and must be present in the body?

matching rule

"$.body.*": 
{
"match": "type"
},

would not give an error, if only

{}

is sent.

Sinuhe20 avatar May 22 '18 11:05 Sinuhe20