Closed
Description
Expected Behaviour
Only the necessary data to be returned, including the name of the field that failed validation and the kind of error.
Current Behaviour
When a data validation error occurs, we can expose data that might not be wanted. This includes class names, file names, or simply the fact that pydantic and python is being used.
Code snippet
app = APIGatewayHttpResolver()
@app.get("/claims")
def claims() -> Dict[str, Any]:
return "oh no, this is not a dict" # type: ignore
Possible Solution
Return a subset of the information, while still allowing the customer to customize the payload using the global exception handler
Steps to Reproduce
Use the snippet above, and see the returned message when the API call is invoked.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.7
Packaging format used
PyPi
Debugging logs
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped