apigee-127 / swagger-tools

A Node.js and browser module that provides tooling around Swagger.
MIT License
701 stars 373 forks source link

Required validation errors do not follow the schema documented #570

Open dmorgantini opened 6 years ago

dmorgantini commented 6 years ago

https://github.com/apigee-127/swagger-tools/blob/361c1f6f08aed64c8da1784cef5ea61a83bac787/lib/validators.js#L169-L183

^ This code demonstrates how your validators translate from a validation error into the documented schema for validation errors. https://github.com/apigee-127/swagger-tools/blob/master/docs/Middleware.md#validation-errors

https://github.com/apigee-127/swagger-tools/blob/361c1f6f08aed64c8da1784cef5ea61a83bac787/lib/validators.js#L449-L453

^ This code shows that for Required fields the same transformation is not applied.

dmorgantini commented 6 years ago

ps: happy to wire up a pr to fix if it's something that you would accept.