1 Answer
- Newest
- Most votes
- Most comments
2
Verify that the request body is correctly encoded as UTF-8. JSON is typically UTF-8 encoded by default, but you should ensure that your client (Axios in this case) is correctly encoding the payload.
Charset Declaration: Explicitly specify charset=utf-8 in the Content-Type header to ensure the server correctly interprets the character encoding.
Enable Detailed CloudWatch Logs:
Go to the API Gateway console. Select your API and then the Stages section. Choose your stage, and under the Logs/Tracing tab, enable detailed CloudWatch logging. Check CloudWatch logs for detailed error messages that might provide more insight into the validation failure.
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago

Thank for your quick answer. Looking through the logs and fiddling with the source code of axios, i managed to see that the special characters do not encode the same way and the lenght of the body was correcly computed so it was truncated, causing the failure to parse the JSON.