class documentation

Pydantic JSON payload converter.

Supports conversion of all types supported by Pydantic to and from JSON.

In addition to Pydantic models, these include all json.dump-able types, various non-json.dump-able standard library types such as dataclasses, types from the datetime module, sets, UUID, etc, and custom types composed of any of these.

See https://docs.pydantic.dev/latest/api/standard_library_types/

Method __init__ Create a new payload converter.
Method from_payload See base class.
Method to_payload See base class.
Property encoding See base class.
Instance Variable _schema_serializer Undocumented
Instance Variable _to_json_options Undocumented
def __init__(self, to_json_options: ToJsonOptions | None = None): (source)

Create a new payload converter.

def from_payload(self, payload: temporalio.api.common.v1.Payload, type_hint: type | None = None) -> Any: (source)

See base class.

Uses pydantic.TypeAdapter.validate_json to construct an instance of the type specified by type_hint from the JSON payload.

See https://docs.pydantic.dev/latest/api/type_adapter/#pydantic.type_adapter.TypeAdapter.validate_json.

def to_payload(self, value: Any) -> temporalio.api.common.v1.Payload | None: (source)

See base class.

Uses pydantic_core.to_json to serialize value to JSON.

See https://docs.pydantic.dev/latest/api/pydantic_core/#pydantic_core.to_json.

_schema_serializer = (source)

Undocumented

_to_json_options = (source)

Undocumented