Skip to content

Commit a3bd747

Browse files
committed
return dict rather than pydantic model
1 parent d2842a3 commit a3bd747

File tree

1 file changed

+3
-3
lines changed
  • python_workflow_definition/src/python_workflow_definition

1 file changed

+3
-3
lines changed

python_workflow_definition/src/python_workflow_definition/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def dump_json_file(
188188
raise
189189

190190
@classmethod
191-
def load_json_str(cls: Type[T], json_data: Union[str, bytes]) -> T:
191+
def load_json_str(cls: Type[T], json_data: Union[str, bytes]) -> dict:
192192
"""
193193
Loads and validates workflow data from a JSON string or bytes.
194194
@@ -210,7 +210,7 @@ def load_json_str(cls: Type[T], json_data: Union[str, bytes]) -> T:
210210
logger.info(
211211
"Successfully loaded and validated workflow model from JSON data."
212212
)
213-
return instance
213+
return instance.model_dump()
214214
except ValidationError: # Catch validation errors specifically
215215
logger.error("Workflow model validation failed.", exc_info=True)
216216
raise
@@ -224,7 +224,7 @@ def load_json_str(cls: Type[T], json_data: Union[str, bytes]) -> T:
224224
raise
225225

226226
@classmethod
227-
def load_json_file(cls: Type[T], file_name: Union[str, Path]) -> T:
227+
def load_json_file(cls: Type[T], file_name: Union[str, Path]) -> dict:
228228
"""
229229
Loads and validates workflow data from a JSON file.
230230

0 commit comments

Comments
 (0)