-
Notifications
You must be signed in to change notification settings - Fork 336
Format constraint runs on empty values #192
Comments
#182 Seems to be related as well P.S. Will be happy to create a PR if you point me in the right direction. I didn't get to dig into the code just yet. |
@itamargiv I have solved this problem by wrapping my
This function can then be used to wrap your constraints like this:
The solution is very lightweight so at least I'm using it gladly over downgrading versions. |
@jakee Thank you for the workaround, looks great. I'll try to implement and update you if it worked for my usecase. I agree, a lightweight workaround is always much better than rolling back. |
From now on empty strings, arrays etc are treated as values. You can use |
Description
In case I need to validate the format of a non required attribute
someAttribue
, running the validate on this attribute when it is empty''
or' '
will still return the validation failure message.Desired use case
To skip the Regex comparison when an attribute is empty. This seems to be the inverse of #99 and indeed, this behavior was introduced in
0.11.0
Is there a way to mitigate between those two opposing use cases? Is there a workaround here that I am missing?
In any case, will revert to version 0.10.0 for now :)
The text was updated successfully, but these errors were encountered: