Sugi S
06/05/2023, 4:22 PMoneOf in the schema...Using BDCT workflow and we have oneOf keyword in the schema and I had followed the instructions here : https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas/keyword-support/ and dereferencing and inlining $refs using swagger-cli before publishing to pact broker...When I set the additionalProperties:false to the oneOf refs as mentioned here: https://github.com/pactflow/bdct-oas-examples/blob/main/examples/oneOf/oneOf.oas.yml#LL44C7-L44C34 the contract is failing....
We also use these oneOf refs in the include param...Wondering if that could be the issue..any suggestions?Sugi S
06/05/2023, 4:28 PM/v1/students endpoint which contains query param like full_time, part_time
In the response based on the query param include requested ,the response would contain the one of them fullTime or partTime object
When I set additionalProperties:false to full_time and say fullTime has properties id, type, attributes then the contract is failing
Response body is incompatible with the response body schema in the spec file: should NOT have additional properties - idSugi S
06/05/2023, 4:30 PMfull_time
"query": "include=full_time",Matt (pactflow.io / pact-js / pact-go)
additionalProperties: true bit as noted here: https://github.com/pactflow/bdct-oas-examples/blob/main/examples/oneOf/oneOf.oas.yml#L26Matt (pactflow.io / pact-js / pact-go)
oneOf is used?Sugi S
06/06/2023, 9:09 AMMatt (pactflow.io / pact-js / pact-go)
Sugi S
06/06/2023, 11:09 AMMatt (pactflow.io / pact-js / pact-go)
Slackbot
06/06/2023, 11:13 AMMatt (pactflow.io / pact-js / pact-go)
additionalProperties needs to be on the property adjecent to oneOf (see screenshot). In your case, it looks to be much higher up the hierarchy, which may be invalid or be dangerously allowing additional properties where it shouldn’t (or just unrelated)Sugi S
06/06/2023, 3:32 PMoneOf as you have suggested...Matt (pactflow.io / pact-js / pact-go)
Sugi S
06/07/2023, 8:22 AMMatt (pactflow.io / pact-js / pact-go)