Skip to content

EventBridge Schema Registry uses custom formats not handled by new Validation code #246

Closed
@n2N8Z

Description

@n2N8Z

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

  1. Pass through custom formats Dict.

  2. AWS schema not use custom formats on non-string types.

  3. 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

How to enable debug mode**

# paste logs here
fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format: int64

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions