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

[JSON Schema] Use validation groups for property metadata in JSON Schema factory #3806

Merged

Conversation

alanpoulain
Copy link
Member

@alanpoulain alanpoulain commented Oct 30, 2020

Q A
Bug fix? yes
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 uses the validation groups when creating the property metadata. The aim is to use correctly the ValidatorPropertyMetadataFactory, mainly to receive correctly the required attribute:

if (null === $required && isset($options['validation_groups'])) {
$required = $this->isRequiredByGroups($validatorPropertyMetadata, $options);
}

@alanpoulain alanpoulain force-pushed the fix/json-schema-validation-groups branch from 69c765e to a9fd1b8 Compare October 31, 2020 15:36
@alanpoulain alanpoulain force-pushed the fix/json-schema-validation-groups branch from a9fd1b8 to a7e03b1 Compare November 2, 2020 16:46
@soyuka soyuka merged commit fba4b1a 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