A developer uses API Gateway Lambda proxy integration and returns an application/json response. Some clients report intermittent 502 errors only under high concurrency. Which change most likely fixes the issue?

Answer

Ensure the Lambda returns a valid JSON string in body and sets statusCode correctly; avoid returning non-serializable objects

Explanation

Lambda proxy requires a properly structured response object; invalid JSON or malformed status/body content can surface as 502s. Correct serialization and statusCode handling eliminates those intermittents.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list