muleanypoint-studioapikit

Mule APIKit Include Reason in 400 error


I have a raml doc the specifies my request data structure with a field like the following:

    "EstInstallDate": {
  "description": "the estimated date that the installation will be completed",
  "type": "string",
  "format": "date"
}

this is great, because when the APIkit is hit, a MessageException is raise with the following text:

string "2016-32-32" is invalid against requested date format(s) yyyy-MM-dd

but the generic 400 error payload is jsut "bad request" I would like to include this error message in the response payload.

how do i do this?


Solution

  • I found that in my exception block i can access

    exception.message

    to get the full string of the error. however, it would be great to include which field failed the validation