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

fix(SymfonyConstraintAnnotationReader): disallow null if NotNull attribute is present #2329

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jeremyVignelles
Copy link
Contributor

@jeremyVignelles jeremyVignelles commented Aug 2, 2024

Q A
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #2309

if a property is set as something like this:

#[OA\Property()]
#[Assert\NotNull(groups: ['validation'])]
private ?string $prop = null;

that property will be marked as nullable AND required.
This PR ensures that the nullable property is also set appropriately when a NotNull is set

NOTE: PHPUnit already fails on master

@DjordyKoert
Copy link
Collaborator

Could you update with master? :)

@jeremyVignelles jeremyVignelles force-pushed the fix/not-null branch 3 times, most recently from 5d260e1 to 450704f Compare August 9, 2024 19:50
@jeremyVignelles
Copy link
Contributor Author

Done, unit tests and code style fixed, commits squashed into one :)
You're good to go :)

.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
@DjordyKoert DjordyKoert merged commit ddeb3d4 into nelmio:master Aug 16, 2024
15 checks passed
@DjordyKoert
Copy link
Collaborator

Thank you :)

@jeremyVignelles jeremyVignelles deleted the fix/not-null branch August 16, 2024 14:05
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.

[Bug]: Using #[NotNull] / #[NotBlank] doesn't influence nullable
2 participants