Skip to content

Commit 1830597

Browse files
authored
Merge pull request #125817 from jparta/patch-1
Clarify (de)serialization of custom data types in Python
2 parents 48a10b1 + 55b9359 commit 1830597

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

articles/azure-functions/durable/durable-functions-bindings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Here are some notes about the orchestration trigger:
9595
> Orchestrator functions should never be declared `async`.
9696
::: zone-end
9797

98+
<a name="python-trigger-usage"></a>
9899
### Trigger usage
99100

100101
The orchestration trigger binding supports both inputs and outputs. Here are some things to know about input and output handling:

articles/azure-functions/durable/durable-functions-serialization-and-persistence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ For full customization of the serialization/deserialization pipeline, consider h
155155

156156
It's recommended to use type annotations to ensure Durable Functions serializes and deserializes your data correctly. While many built-in types are handled automatically, some built-in data types require type annotations to preserve the type during deserialization.
157157

158-
For custom data types, you must define the JSON serialization and deserialization of a data type by exporting a static `to_json` and `from_json` method from your class.
158+
For custom data types, you make JSON serialization and deserialization possible by defining class methods `to_json` and `from_json` on your data type class. Note that these methods are not called on the return value from the orchestrator function, meaning the return value has to be natively JSON-serializable. For more information, see [Bindings](durable-functions-bindings.md#python-trigger-usage).
159159

160160
# [Java](#tab/java)
161161

0 commit comments

Comments
 (0)