diff --git a/azure/durable_functions/models/OrchestratorState.py b/azure/durable_functions/models/OrchestratorState.py index d4d6fffe..abf09a74 100644 --- a/azure/durable_functions/models/OrchestratorState.py +++ b/azure/durable_functions/models/OrchestratorState.py @@ -5,6 +5,7 @@ from .utils.json_utils import add_attrib from azure.durable_functions.models.actions.Action import Action +from azure.functions._durable_functions import _serialize_custom_object class OrchestratorState: @@ -75,7 +76,7 @@ def schema_version(self): """Get the Replay Schema represented in this OrchestratorState payload.""" return self._replay_schema.value - def to_json(self) -> Dict[str, Union[str, int]]: + def to_json(self) -> Dict[str, Any]: """Convert object into a json dictionary. Returns @@ -83,7 +84,7 @@ def to_json(self) -> Dict[str, Union[str, int]]: Dict[str, Any] The instance of the class converted into a json dictionary """ - json_dict: Dict[str, Union[str, int]] = {} + json_dict: Dict[str, Any] = {} add_attrib(json_dict, self, '_is_done', 'isDone') if self._replay_schema != ReplaySchema.V1: add_attrib(json_dict, self, 'schema_version', 'schemaVersion') @@ -113,4 +114,4 @@ def to_json_string(self) -> str: The instance of the object in json string format """ json_dict = self.to_json() - return json.dumps(json_dict) + return json.dumps(json_dict, default=_serialize_custom_object)