class documentation

class PydanticJSONPlainPayloadConverter(EncodingPayloadConverter): (source)

View In Hierarchy

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 from_payload See base class.
Method to_payload See base class.
Property encoding See base class.
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.