Skip to content

Commit 08b00b7

Browse files
authored
Fix serialization schema generation (#7)
Signed-off-by: Federico Busetti <[email protected]>
1 parent b29d53a commit 08b00b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cloudevents_pydantic/events/_event.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# ==============================================================================
2323
import base64
2424
import datetime
25-
from typing import Annotated, Any, Dict, Optional, Union
25+
from typing import Annotated, Any, Optional, Union
2626

2727
from pydantic import (
2828
BaseModel,
@@ -127,8 +127,9 @@ def event_factory(
127127
Using `orjson` could solve this, perhaps it could be a future improvement.
128128
"""
129129

130+
# Typing for return value here breaks `.model_json_schema(mode='serialization')`
130131
@model_serializer(when_used="json")
131-
def base64_json_serializer(self) -> Dict[str, Any]:
132+
def base64_json_serializer(self):
132133
"""Takes care of handling binary data serialization into `data_base64`
133134
attribute.
134135

0 commit comments

Comments
 (0)