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
allOf + enum is resulting in a enum array merge when it should be an intersection #2472
Comments
frankkilcommins
changed the title
allOf + enum is resulting in a enum array merge when it should actually be an intersection
allOf + enum is resulting in a enum array merge when it should be an intersection
Feb 23, 2022
I've got this issue as well, do you know if there's anything planned to fix it or at least if it's considered a bug by maintainers? |
Any updates on this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Q&A (please complete the following information)
Content & configuration
Paste the
yaml
below into https://editor.swagger.io/Swagger/OpenAPI definition:
Describe the bug you're encountering
allOf + enum
is resulting in a enum array merge when it should actually be an intersection as any instance must validate against all subschemas.In the example above, the expected result in the composed model would be to have the policyType with
enum: [CAR]
as CAR is the only enum value existing in both schemas. However a merge of the two enum arrays occurs resulting inenum: [CAR, HOME, HEALTH, CAR, CAR-COMPREHENSIVE]
(even duplicates).To reproduce...
Steps to reproduce the behavior:
Paste the YAML into swagger editor
Expected behavior
allOf + enum
is resulting in a enum array merge when it should actually be an intersection as any instance must validate against all subschemas.Screenshots
Additional context or thoughts
Enums will have to be fixed directly in all-off plugin, before the deepmerge is executed. See this PR for related discussion
The text was updated successfully, but these errors were encountered: