You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using API GW's request validation feature to validate request body, by default the error message is Invalid request body without any details on where it is invalid in request body. To get detailed error message, customers have to set the following in their swagger:
x-amazon-apigateway-gateway-responses:
# Provide more detailed error message for bad request body errors. See doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-gateway-responses.html
BAD_REQUEST_BODY:
responseTemplates:
application/json: '{"message": "$context.error.validationErrorString"}'
It would be nice if SAM can add this to swagger automatically if request body validation is enabled.
The text was updated successfully, but these errors were encountered:
Thanks for creating the issue, Lu! We don't support adding request-validators in SAM today, but this is on our roadmap. Once that support is added it totally makes sense to add gateway responses for BAD_REQUEST_BODY. It's being tracked in #931
Description:
When using API GW's request validation feature to validate request body, by default the error message is
Invalid request body
without any details on where it is invalid in request body. To get detailed error message, customers have to set the following in their swagger:It would be nice if SAM can add this to swagger automatically if request body validation is enabled.
The text was updated successfully, but these errors were encountered: