You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conditional validation for nested nullable input fields (#185)
* Fix batching and enums sections (#183)
I was reading through the docs for this and noticed the accidental opening of a code block breaking the markdown for the "batching" and "enums" sections.
* Comment undefined classes in config.php (#184)
* Include a pre-validation check for the existence of nullable fields.
Validation is now skipped for nullable fields which are not included in
the request. Tests have been updated to ensure that:
- validation is skipped for nullable fields which are absent
- validation is run for nullable fields when present
- validation is run for non-nullable fields regardless of presence
* tidy up mutation test
This additional call to get the field rules isn't being used anywhere,
so it can safely be removed.
* Revert non-nested object tests
I had thought that this change would also affect the other fields in
the tests, however this change only affects nested input objects since
the nullable check is run after rules have been obtained from the
initial field.
* Refactoring
$this->assertEquals($messages->first('test'), 'The test field is required.');
145
-
$this->assertEquals($messages->first('test_with_rules_input_object.nest.email'), 'The test with rules input object.nest.email must be a valid email address.');
163
+
$this->assertEquals($messages->first('test_with_rules_nullable_input_object.nest.email'), 'The test with rules nullable input object.nest.email must be a valid email address.');
164
+
$this->assertEquals($messages->first('test_with_rules_non_nullable_input_object.nest.email'), 'The test with rules non nullable input object.nest.email must be a valid email address.');
0 commit comments