krakenjs / hapi-openapi

Build design-driven apis with OpenAPI (formerly swagger) 2.0 and hapi.
Other
211 stars 75 forks source link

joi validation function called as async, leading to incorrect error handling #167

Open DanielAnfelt opened 4 years ago

DanielAnfelt commented 4 years ago

In Validators.js, there is a call const result = await schema.validate(data); which does not seem to work as intended. The joi validation will return an object with a error property and a result. When I run the current code, I get the validation error, but not through the indented flow. As a result, the details that explain what I messed up don't propagate back to me.