Hi, How we can compare only schema of response in ...
# pact-js
d
Hi, How we can compare only schema of response in contract testing ?
b
Like, flexible matching of the shape, or you have a schema defined and you want to verify it?
d
yes Right, I have defined expected response and I want to verify only schema.
I have also used the matcher but it does not full fill my requirement as it have some limitation with null value check.
b
The FAQ, especially https://docs.pact.io/faq/#why-is-there-no-support-for-specifying-optional-attributes addresses some of these concerns (and others).
Pact is contract-by-example, not schema-by-spec, but I'm not sure if you're trying to do something Pact isn't meant for, or if it's just a vocabulary issue.
If you genuinely want to do only schema validation, there are other tools, and you will lose a significant amount of reasoning power.
d
Thanks