Hilzu / express-openapi-validate

Express middleware to validate requests based on an OpenAPI 3 document
Apache License 2.0
75 stars 12 forks source link

Beautifying errrors #40

Closed DavidFaizulaev closed 5 years ago

DavidFaizulaev commented 5 years ago

Hello,

I started using the package and I see that the errors are not very user friendly, are there plans to beautify the errors? or may I take the liberty and attempt to add beautified ajv errors?

Hilzu commented 5 years ago

The errors currently contain textual description generated by ajv that exactly tell what the error was: https://ajv.js.org/#errorstextarrayobject-errors--object-options---string. They should be familiar if you've used ajv before. I'm hesitant of adding a layer on top of them in this library. If the error messages are bad they should be improved in ajv in my opinion.