-
-
Notifications
You must be signed in to change notification settings - Fork 52
Nullable fields #72
Comments
I kind of don't like the approach of Laravel Rules should be there to validate the piece of text and not set global states which are then read by other rules and I believe that is what Laravel is doing here. What I think will be right is passing const rules: {
content: 'required|string|max:255',
description: 'string:allowNull|max:255'
} What you think? |
Okay went on a different path and refactored concept of modes.
Whereas the normal will bypass these values and one must use |
Awesome ! the strict mode approach is much better. Thanks |
Expect |
Cool, great work you are doing there with AdonisJs Framework, keep it up. |
I'm Using Lucid ORM and Indicative for validation and in my db schema I have a non required columns that defaults to null.
The problem is that validation fails when model is retrieved from database, because there is no way to skip null values in Indicative, only undefined are skipped when required rule is not set.
I believe non required fields should skip undefined or null, or adding a nullable rule.
Would like to hear your take on that kind of issue and thanks for your great work @thetutlage
The text was updated successfully, but these errors were encountered: