Skip to content

Conversation

alanpoulain
Copy link
Member

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

Same PR as #3806, but for Hydra.

The hydra:required property was always set to false if validation groups were used for the property in the NotBlank constraint.
It's because the property metadata are filled with the ValidatorPropertyMetadataFactory:

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

In Hydra, since the properties are decoupled from the operations, the code assumes that the "required" information is taken in the POST operation of the resource.

The "hydra:required" property was always set to false if validation
groups were used for the property.
@alanpoulain
Copy link
Member Author

PHP 8 failure is not related.

Base automatically changed from master to main January 23, 2021 21:59
@alanpoulain
Copy link
Member Author

WDYT @api-platform/core-team? For the part:

In Hydra, since the properties are decoupled from the operations, the code assumes that the "required" information is taken in the POST operation of the resource.

@stale
Copy link

stale bot commented Nov 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 4, 2022
@stale
Copy link

stale bot commented Jan 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 3, 2023
@stale stale bot closed this Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant