deepkit-framework
deepkit-framework copied to clipboard
validate only returns first error
When I check documentation I see that validate should returns an array of errors for diferent properties:
But when I validate object with some errors, I only get first:
import { validate } from '@deepkit/type';
interface Article {
id: number;
title: string;
}
validate<Article>({}));
returns:
[
ValidationErrorItem {
path: 'id',
code: 'type',
message: 'Not a number'
}
]
I expect:
[
ValidationErrorItem {
path: 'id',
code: 'type',
message: 'Not a number'
},
ValidationErrorItem {
path: 'title',
code: 'type',
message: 'Not a string'
}
]
I'm using: "@deepkit/type": "^1.0.1-alpha.71"
What about validates
?
What about
validates
?
According to the documentation the correct method to get an array of errors is validate
:
validates
returns a boolean.
Thanks for the report, fixed in https://github.com/deepkit/deepkit-framework/commit/7e965bd9bafe437e6a5340c1c3b22360b50d1ed7