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

[Hydra] Use validation groups for Hydra documentation #3947

Closed

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