Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validate allOf #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cydparser
Copy link

An alternative fix would be to default additionalProperties to true.

@edmundnoble
Copy link

edmundnoble commented May 11, 2022

Without the last commit here, allOf validation is broken for most usecases. For example the allOf samples in the swagger docs don't validate, and in practice most uses of allOf will result in schemas which do not validate against any values.

@cydparser cydparser force-pushed the fix-validate-all-of branch from 0a0c2a6 to ebdaeb9 Compare May 11, 2022 21:28
@tchakkazulu
Copy link

Any news on this? As it currently stands, allOf-validation is still broken.

@tchakkazulu
Copy link

Hrm. Never mind, allOf-validation is not as easily fixed as is done in this PR. The allOf of two oneOf schemas is not just what you get by concatenating them. An object property is only unaccounted for in an allOf-schema, if it is unaccounted for in all of its subschemas. The current implementation will complain if a property is unaccounted for in any of the subschemas. The PR's fix does something unrelated. Defaulting additionalProperties to true also feels janky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants