diff --git a/lib/src/validator.dart b/lib/src/validator.dart index 98a20047..88455bc9 100644 --- a/lib/src/validator.dart +++ b/lib/src/validator.dart @@ -382,10 +382,10 @@ class ValidationException extends AngelHttpException { /// A descriptive message describing the error. final String message; - ValidationException(this.message, {List errors = const []}) + ValidationException(this.message, {Iterable errors = const []}) : super(FormatException(message), statusCode: 400, - errors: errors ?? [], + errors: (errors ?? []).toSet().toList(), stackTrace: StackTrace.current) { if (errors != null) this.errors.addAll(errors); }