Skip to content

octoprint.util.json.encoding#

JsonEncoding #

add_encoder(typ, encoder) classmethod #

Add an encoder for a type.

:param typ: the type to add an encoder for :param encoder: the encoder. Must take a single argument and return a tuple (name, parameters...)

dumps(obj) classmethod #

Dump an object to JSON, handles additional types that the JSON encoder can't, like bytes and frozendicts.

Back to top