Closed
Description
What were you trying to accomplish?
Validate events against EventBridge Schema Registry published schema.
Expected Behavior
AWS published schema can be imported, and events successfully validated against it.
Current Behavior
Importing schema results in fastjsonschema error:
fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format: int64
Possible Solution
-
Pass through custom formats Dict.
-
AWS schema not use custom formats on non-string types.
-
fastjsonschema not fail on custom formats.
Custom formats for non-string types horejsek/python-fastjsonschema#108
Steps to Reproduce (for bugs)
import json
from aws_lambda_powertools.utilities.validation import validator, validate
json_schema_dict = json.loads(json.loads(open('aws.s3@AWSAPICallViaCloudTrail-v2.JSONSchemaDraft4.txt').read())['Content'])
validate(event={}, schema=json_schema_dict)
aws.s3@AWSAPICallViaCloudTrail-v2.JSONSchemaDraft4.txt
Environment
- Powertools version used: 1.9.0
- Packaging format (Layers, PyPi): PyPi
- AWS Lambda function runtime:: N/A
- Debugging logs: N/A
# paste logs here
fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format: int64
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage