Skip to content

On attribute validation #351

Answered by rpaul-stripe
louiss0 asked this question in Q&A
Discussion options

You must be logged in to vote

The logic in the validator assumes that these are all arrays, it does something like: errors.push(...errorsFromValidationFunction) so if you return an object rather than an array, it will throw an error. In order to support returning a single object, we would have to add explicit logic in the validator in several places to check and see if the output is an array, and we'd prefer not to do that. Is there a particular reason why you don't want to return an array?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@louiss0
Comment options

Answer selected by louiss0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants