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
[Bug]: Mutual exclusion by use of additionalProperties: false
across union types
#803
Labels
kind/bug
Indicates an issue
Comments
Hi @segfault87 thanks for the report. Mutual exclusion is not something that should be checked by validation tool. Validation tools just make sure your requirements are met. Is up to user how he design his requirements. Tools shouldn't forbid to make mutual exclusion requirement like What you need is probably unevaluatedProperties which part of OpenAPI 3.1
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual Behavior
If
additionalProperties: false
is declared in components and being combined into one byallOf
, validation unconditionally fails.Let's say we have following OpenAPI spec:
This spec compiles without any problem. But when validating actual request with this spec, validator fails with following error message:
Expected Behavior
I think openapi-core should behave one of following:
additionalProperties: false
in context of union types (allOf
) at schema lvel.Steps to Reproduce
Validate
{"foo": "-", "bar": "-"}
with spec supplied above.OpenAPI Core Version
0.19.0
OpenAPI Core Integration
pydantic
Affected Area(s)
validation
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: