|
5 | 5 |
|
6 | 6 | from .utils.json_utils import add_attrib
|
7 | 7 | from azure.durable_functions.models.actions.Action import Action
|
| 8 | +from azure.functions._durable_functions import _serialize_custom_object |
8 | 9 |
|
9 | 10 |
|
10 | 11 | class OrchestratorState:
|
@@ -75,15 +76,15 @@ def schema_version(self):
|
75 | 76 | """Get the Replay Schema represented in this OrchestratorState payload."""
|
76 | 77 | return self._replay_schema.value
|
77 | 78 |
|
78 |
| - def to_json(self) -> Dict[str, Union[str, int]]: |
| 79 | + def to_json(self) -> Dict[str, Any]: |
79 | 80 | """Convert object into a json dictionary.
|
80 | 81 |
|
81 | 82 | Returns
|
82 | 83 | -------
|
83 | 84 | Dict[str, Any]
|
84 | 85 | The instance of the class converted into a json dictionary
|
85 | 86 | """
|
86 |
| - json_dict: Dict[str, Union[str, int]] = {} |
| 87 | + json_dict: Dict[str, Any] = {} |
87 | 88 | add_attrib(json_dict, self, '_is_done', 'isDone')
|
88 | 89 | if self._replay_schema != ReplaySchema.V1:
|
89 | 90 | add_attrib(json_dict, self, 'schema_version', 'schemaVersion')
|
@@ -113,4 +114,4 @@ def to_json_string(self) -> str:
|
113 | 114 | The instance of the object in json string format
|
114 | 115 | """
|
115 | 116 | json_dict = self.to_json()
|
116 |
| - return json.dumps(json_dict) |
| 117 | + return json.dumps(json_dict, default=_serialize_custom_object) |
0 commit comments