Skip to content

Broken error list with 'showValidatorFailures' #422

@rekrios

Description

@rekrios

Hi.
You can get broken error list with LaravelJsonApi::showValidatorFailures() when your Clousure/CustomRuleClass returns array as error message coz then there are different keys.

https://monosnap.com/file/VOFYTBPnVOQoC7DTrP8ZwMhDuoqwA7

  1. rule and answer in different places
  2. maybe try to get array's associative key when we have ordinary Closure ? Coz 'closure-validation-rule' is not very informative. For example,
    $rules = ['rulesName' => function(...) {...}]
    The only way for now, if u want to get normal info in 'rule' - use custom rule. Coz there are 'get_class($rule)' interpreter.
    $rules = [new CustomRule()]
  3. coz of problem with diffrerent keys (1), some rules are missed

P.S. maybe i will fix it myself if we will come to some consensus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions