Replies: 1 comment
-
Using present seems correct to me, this was a bug which should be fixed with the release later today. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Current it seems there is no way to make a field optional without using the
|Optional
class... or the?
optional flag on property.I would like to validate an empty array, so:
I would like to change this to use
present
instead ofrequired
, but the#[Present]
doesn't work, the required is still applied.Changing to
array|Optional
works but then it will get optional object instead of empty array...It there a better way to allow an empty array instead of overwriting rules?
To be honest i thought
present
would be implied by default instead ofrequired
.For now what i did was i created a
PresentRuleInferrer
and removedRequiredRuleInferrer
, maybe that's a good approach, i can open a PR with that if you guys think it's a good approach.Beta Was this translation helpful? Give feedback.
All reactions