The $context.error.validationErrorString parameter is a string containing a detailed validation error message . This may be proper JSON or not, depending on the validation errors.
Unfortunately, the customization of the validation error is currently not supported in API Gateway. There is also no current way to programmatically access the information obtained from "$context.error.validationErrorString" parameter within the API Gateway.
A workaround would be for the logic in the application or workflow (the client) that is responsible for processing the validation error message, will have to format the string as needed i.e stripping the parenthesis and square brackets from the $context.error.validationErrorString parameter response.
A feature request is open with regards to the format of the $context.error.validationErrorString parameter response not being a proper JSON string at all times. No timelines are available as to when this may be implemented.
Return proper JSON validation errors from API Gateway ResponseAccepted Answerasked 3 months ago
Validate path param in AWS API Gateway through OpenAPI specasked 10 months ago
Return a custom header from lambda authorizer in API-gateway (HTTP api)asked 6 months ago
How to invoke a private REST API (created with AWS Gateway) endpoint from an EventBusRule?Accepted Answerasked 8 months ago
Can't define an AWS API Gateway mapping template from the consoleasked 3 years ago
Return HTML to browser from API Gateway using Lambda Proxy Integrationasked 4 years ago
rest api gateway in front of dynamodb gives 404 on GET callsAccepted Answer
Is it possible to send json data in body of GET method defined in API Gateway REST API ?Accepted Answerasked 9 months ago
REST API sent to API Gateway, how to access POST body data (application/json type) from within lambda application?Accepted Answerasked 2 years ago
rest api gateway in front of dynamodb, POST mapping template for updateitem format