Skip to content

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

Merged
soyuka merged 1 commit into
api-platform:2.5from
alanpoulain:fix/json-schema-validation-groups
Nov 2, 2020
Merged

[JSON Schema] Use validation groups for property metadata in JSON Schema factory#3806
soyuka merged 1 commit into
api-platform:2.5from
alanpoulain:fix/json-schema-validation-groups

Conversation

@alanpoulain

@alanpoulainalanpoulain commented Oct 30, 2020

Copy link
Copy Markdown
Member
QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRN/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);
}

Comment threadsrc/JsonSchema/SchemaFactory.php
Comment threadsrc/JsonSchema/SchemaFactory.php Outdated
@alanpoulain
alanpoulainforce-pushed the fix/json-schema-validation-groups branch from 69c765e to a9fd1b8CompareOctober 31, 2020 15:36
@alanpoulain
alanpoulainforce-pushed the fix/json-schema-validation-groups branch from a9fd1b8 to a7e03b1CompareNovember 2, 2020 16:46
@soyuka
soyuka merged commit fba4b1a into api-platform:2.5Nov 2, 2020
@soyuka

Copy link
Copy Markdown
Member

thanks @alanpoulain

Sign up for freeto 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

@alanpoulain@soyuka