Gi60s / openapi-enforcer

Apache License 2.0
94 stars 22 forks source link

Expose matched operations on validation errors #95

Closed jankuca closed 3 years ago

jankuca commented 3 years ago

When there is an error (exception) returned from openApi.request() complaining about invalid parameters, it would be very useful to know which operation was matched by the request and validated against.

Gi60s commented 3 years ago

I've published a fix to NPM as version 1.12.1 that should get you what you are looking for.

The exception object will now have some helpful properties on it in the case of an exception. You can read more about it in the documentation at https://byu-oit.github.io/openapi-enforcer/api/components/openapi#request at the end of the Returns subsection.

Thanks for the request. This is a valuable improvement.

jankuca commented 3 years ago

Thanks a lot! This should work for me.