Closed tl-madhulika-mitra closed 2 years ago
Hey @tl-madhulika-mitra, thanks for the message (and using the tool)
The validation is being performed by this tool - which is a fork of atlassians https://bitbucket.org/atlassian/swagger-mock-validator
A change in default behaviour was introduced
This thread is worth a read and it will provide some reasoning as to the issues in validation for allOf, anyOf and oneOf
Using Pact broker
Just to confirm, you are using the Pactflow broker, not the OSS broker
Thank you @YOU54F . Yes we are using Pactflow broker.
@YOU54F - Also 2 follow up issues is
Without setting any additional properties
setting any additional properties:true
If you could provide some code examples illustrating the points and the pact/specs in question, it would help tremendously in visualising.
We can collate the various examples to illustrate the points, you can see some in the readme on this page.
You would just need a sample pact file and swagger file, and you can show the output with the different combination of flags.
Hey @tl-madhulika-mitra
Docs updated here
and this issue would be best tracked against this repo
https://github.com/pactflow/swagger-mock-validator/issues?q=is%3Aopen+is%3Aissue
where we would hope to be able to address this in the future
Thanks @YOU54F . Could you please clarify where do we add the "additionalPropertiesInResponse":true - when we are using pactflow, I tried to refer this , but not super clear where to add this setting.
Consumer: Cypress+MSW - Generated Pact file Provider - Open API Specification Using Pact broker
The response structure schema looks like this:
In the consumer pact file - we have added the required interaction for Authorization Required status.
On comparison all the fields error out and Response Body Is Incompatible Response body is incompatible with the response body schema in the spec file: should NOT have additional properties - id
Mismatched Pact Path: [root].interactions[0].response.body Mismatched Provider Path: [root].paths./status/{id}.get.responses.200.content.application/json; charset=UTF-8.schema.additionalProperties.
Similarly when our schemas had "AllOf" also , we encounter a failure. Once we remove these and make a simple response body which does not nest further, we are able to proceed.
Kindly let us know if there is an open issue for this or is there some specification we need to mention. I did not post this to slack, since after a lot of retries and check I do feel there is some issue here. But please correct me if im wrong :)