-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Aggregation of allOf combined with additionalProperties false not working - Response validation #239
Comments
@luboskriz thanks for the issue. i'll have a look. |
Hi @cdimascio I am happy that you will look at the issue! I am working on a larger rapidly growing project and this is a no go blocker for us. I tried couple workarounds, but none of them works for me completely. I would need to have this fixed as soon as possible, so if it is not a priority for you and you could give me some hints, I would like to help fixing it, even though I am not definitely such expert as you are. I have already tried, but the code took me to the ajv internals and this was too much for me. Thanks for any help! I appreciate your work, I really like the library overall. |
@luboskriz this issue occurs for both request and response validation. it's an issue in AJV itself. Though arguably, its how JSON Schema works - See the thread here ajv-validator/ajv#837 All in all, a workaround is to remove
|
Thanks for the investigation, @cdimascio, appreciate it. I will implement some workaround. |
FYI, i saw this today, json-schema-merge-all-of. I will plan to look into it. Im curious if it might help this situation. If so, perhaps, we can leverage it within the validator. It seems to tackle this issue as well
|
@cdimascio is there any progress with this issue? |
Still facing this issue |
Seeing this issue as well. Our API schema is "composed" by combining lower level types into high level complex response types (using Anybody found a good workaround? |
I am getting the following error when validating response for a /route endpoint (see schema and the response example below)
Expected result: The validation should pass
Example 1 - Demonstrates the issue
Having the following schema, the below response causes validation error - no additional properties
Schema:
Response:
Example 2 - No issue
If there is just one item in allOf collection, it validates correctly:
Schema:
Response:
The text was updated successfully, but these errors were encountered: