Is there a way to change the requestID on the API gateway 9.4 to be in a UUID format?
We would like to standardise our error messages to RFC7807 format (https://tools.ietf.org/html/rfc7807). We also send the requestID and uuid to syslog but the "generate UUID" is executed quite late during the request flow.
If we could utilize the requestID but in a uuid format we could just use this instead. This will also allow us to use the same id when the gateway generates an error prior to routing.
Example error from backend.
{
"type": "http://api.gateway.com/error/types/403",
"status": 400,
"title": "Bad Request",
"detail": "More details about the error here",
"instance": "urn:uuid:7673868d-231e-490d-9c4f-19288e7e668d"
}
We do a JSON Schema validation of the returned error. If the error complies we pass it on and accept the developer handled the error correctly else the gateway generates an error response on the gateway level.
.....
"instance": {
"description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
"type": "string",
"format": "uri"
},
...