jmons / ramlwrap

Wrapping Raml around Django rest-api's
MIT License
8 stars 2 forks source link

Custom error method on ValidationException #19

Closed jmons closed 7 years ago

jmons commented 7 years ago

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.

Jamian commented 7 years ago

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?

Jamian commented 7 years ago

Fixed, See #20