class documentation
class JSONPlainPayloadConverter(EncodingPayloadConverter): (source)
Constructor: JSONPlainPayloadConverter(encoder, decoder, encoding, custom_type_converters)
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 |
See base class. |
Method | to |
See base class. |
Property | encoding |
See base class. |
Instance Variable | _custom |
Undocumented |
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', custom_type_converters: Sequence[ JSONTypeConverter]
= []):
(source)
¶
Initialize a JSON data converter.
Parameters | |
encoder:Optional[ | Custom encoder class object to use. |
decoder:Optional[ | Custom decoder class object to use. |
encoding:str | Encoding name to use. |
customSequence[ | Set of custom type converters that are used when converting from a payload to type-hinted values. |
def from_payload(self, payload:
temporalio.api.common.v1.Payload
, type_hint: Optional[ Type]
= None) -> Any
:
(source)
¶
See base class.