jmons/ramlwrap

Custom error method on ValidationException

Closed this issue · 2 comments

jmons commented

Not everyone agrees with a 422 error response - some people will want to customise this (we have specific example where the API is defined by another business unit who demand a specific error messaging etc)

To solve this, Im proposing a setting RAMLWRAP_VALIDATION_ERROR_HANDLER (?) that will point at a function (or a string of a function?) that will be called.

I'd go with string of a function... otherwise we'll have the potential for circular dependencies (yay!) if the function itself needs to grab something from settings?

Fixed, See #20