https://pact.io logo
#pact-js
Title
# pact-js
d

Dharmesh

02/24/2022, 10:31 AM
Hi, How we can compare only schema of response in contract testing ?
b

Boris

02/24/2022, 11:02 AM
Like, flexible matching of the shape, or you have a schema defined and you want to verify it?
d

Dharmesh

02/24/2022, 11:07 AM
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

Boris

02/25/2022, 12:42 AM
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

Dharmesh

02/25/2022, 5:29 AM
Thanks