class documentation

class JSONPlainPayloadConverter(EncodingPayloadConverter): (source)

View In Hierarchy

Converter for 'json/plain' payloads supporting common Python values.

For encoding, this supports all values that json.dump supports and by default adds extra encoding support for dataclasses, classes with dict() methods, and all iterables.

For decoding, this uses type hints to attempt to rebuild the type from the type hint.

Method __init__ Initialize a JSON data converter.
Method from_payload See base class.
Method to_payload See base class.
Property encoding See base class.
Instance Variable _decoder Undocumented
Instance Variable _encoder Undocumented
Instance Variable _encoding Undocumented
def __init__(self, *, encoder: Optional[Type[json.JSONEncoder]] = AdvancedJSONEncoder, decoder: Optional[Type[json.JSONDecoder]] = None, encoding: str = 'json/plain'): (source)

Initialize a JSON data converter.

Parameters
encoder:Optional[Type[json.JSONEncoder]]Custom encoder class object to use.
decoder:Optional[Type[json.JSONDecoder]]Custom decoder class object to use.
encoding:strEncoding name to use.
def from_payload(self, payload: temporalio.api.common.v1.Payload, type_hint: Optional[Type] = None) -> Any: (source)
def to_payload(self, value: Any) -> Optional[temporalio.api.common.v1.Payload]: (source)
_decoder = (source)

Undocumented

_encoder = (source)

Undocumented

_encoding = (source)

Undocumented