Skip to content

Commit de85fc6

Browse files
author
Ron Serruya
committed
Validate jsonschema during read and write
1 parent 3319479 commit de85fc6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/aws_schema_registry/jsonschema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ def fqn(self) -> str:
4545
return ""
4646

4747
def read(self, bytes_: bytes):
48-
return orjson.loads(bytes_)
48+
data = orjson.loads(bytes_)
49+
self.validate(data)
50+
return data
4951

5052
def write(self, data) -> bytes:
53+
self.validate(data)
5154
return orjson.dumps(data)
5255

5356
def validate(self, data):

0 commit comments

Comments
 (0)