How to use the orjson.JSONEncodeError function in orjson

To help you get started, we’ve selected a few orjson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dutradda / jsondaora / jsondaora / serializers.py View on Github external
def default_function(cls, v: Any) -> Any:
        if isinstance(v, bytes):
            return v.decode()

        try:
            return cls.types_default_map[type(v)](v)
        except KeyError:
            orjson.JSONEncodeError(v)

orjson

Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy

Apache-2.0
Latest version published 21 days ago

Package Health Score

90 / 100
Full package analysis