Closed
Description
Use case
The Validation feature in Powertools uses fastjsonschema.validate()
to perform the validation. This function in fastjsonschema
returns the validated payload. While usually this is exactly the same as the input payload, fastjsonschema
also populates default
values in missing fields. For example, with this schema:
{
"properties": {
"required_id": {
"type": "integer"
},
"test_default": {
"type": "string",
"default": "def"
}
},
"required": [
"required_id"
],
"type": "object"
}
And this payload:
{
"required_id": 1234
}
The validate()
function will return:
{
"required_id": 1234,
"test_default": "def"
}
Solution/User Experience
I'm wondering if we can have the Powertools validate()
function return the results from fastjsonschema.validate()
.
Alternative solutions
No response
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped