Skip to content

[JSON Schema] Add additionalProperties (false) to the generated JSON schema #3804

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

Conversation

alanpoulain
Copy link
Member

@alanpoulain alanpoulain commented Oct 30, 2020

Q A
Bug fix? yes/no
New feature? no
BC breaks? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

This PR is part of a set of PR whose purpose is to make the assertions assertMatchesResourceItemJsonSchema and assertMatchesResourceCollectionJsonSchema work correctly.
The PR are:

It add additionalProperties (to false) to the definitions in order to not validate a schema if the validated object has additional properties (it could be another resource in this case).

@alanpoulain alanpoulain force-pushed the fix/json-schema-additional-properties-false branch from 91d95e7 to 3a3c2ef Compare November 2, 2020 16:35
@soyuka soyuka merged commit 1ef4176 into api-platform:2.5 Nov 2, 2020
@soyuka
Copy link
Member

soyuka commented Nov 2, 2020

Thanks @alanpoulain

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.

2 participants