opticdev / optic

OpenAPI linting, diffing and testing. Optic helps prevent breaking changes, publish accurate documentation and improve the design of your APIs.
https://useoptic.com
MIT License
1.35k stars 79 forks source link

Fix patching for allOf #2622

Closed niclim closed 8 months ago

niclim commented 9 months ago

🍗 Description

What does this PR do? Anything folks should know?

Previously, allOf patches didn't work - this was because we were applying additionalProperties: false to every variant of allOf, meaning that they failed. What we needed was unevaluatedProperties which is only available in draft2019+. We want to set unevaluatedProperties on allOf, and additionalProperties: true to every allOf's direct children

This also means draft4 evaluation doesnt work - not really sure how this would work with OAS3, but the case we do know about we can handle

📚 References

Links to relevant docs (Notion, Twist, GH issues, etc.), if applicable.

👹 QA

How can other humans verify that this PR is correct?