Open API Schema 3.0 Contract Testing

Hi,
I am using the contract testing functionality in the API section. I have create a collection to test and I have imported the OpenAPI definition but when I click on validate I always receive Validation OK, even if i use a mock to force an invalid json response that does not match with the schema definition.

Do you have any idea?

thanks a lot

Hi @Moon, I’m also having this issue and wondering if you solved it. Seems like the contract testing tests some parts but not the validity of the response body. I can copy and past the schema into the javascript tests and validate it with tv4 just fine, but that sort of diminishes the value here.

The documentation seems to indicate support for this feature: https://learning.postman.com/docs/postman/design-and-develop-apis/validating-elements-against-schema/

Hard to believe such an obvious feature would be missing.

There is a whole lot of validation going on so it can be confusing to follow each step. This validation is making sure the collection you generated from your OpenAPI still in alignment. This validation isn’t making sure the response of each API is valid, it is for making sure OpenAPI contract is met, not the individual API schema contract. Does that make sense? We have a lot of work to do in defining the right words to use for this process. Try changing a path name in your collection, and you should see it not validate.

That make sense.
Thanks a lot for your help!