krakenjs / swaggerize-routes

Swagger document driven route builder.
Other
58 stars 57 forks source link

Return all validation errors rather than return first #49

Open rochal opened 8 years ago

rochal commented 8 years ago

Hi,

When I'm trying to validate object such as:

{
  "id": "asd",
  "username": 123
}

I get following ValidationError error back: "child "id" fails because ["id" must be a number]"

My schema defines "id" as integer and "username" as string so the validation behavior is correct. However - I am unable to get ALL errors at once from the validation function. This means I can't validate all fields at once and return an array of errors.

Is this possible / am I missing something?

rcherny commented 8 years ago

I'd like to be able to do this as well. Any pointers and would be grateful.