# JsonPlusSerializer

> **Class** in `langgraph.checkpoint`

📖 [View in docs](https://reference.langchain.com/python/langgraph.checkpoint/serde/jsonplus/JsonPlusSerializer)

Serializer that uses ormsgpack, with optional fallbacks.

!!! warning

    Security note: This serializer is intended for use within the `BaseCheckpointSaver`
    class and called within the Pregel loop. It should not be used on untrusted
    python objects. If an attacker can write directly to your checkpoint database,
    they may be able to trigger code execution when data is deserialized.

    Set the environment variable ``LANGGRAPH_STRICT_MSGPACK=true`` to restrict
    deserialization to a built-in allowlist of safe types.  You can also pass
    an explicit ``allowed_msgpack_modules`` to the constructor.

## Signature

```python
JsonPlusSerializer(
    self,
    *,
    pickle_fallback: bool = False,
    allowed_json_modules: Iterable[tuple[str, ...]] | Literal[True] | None = None,
    allowed_msgpack_modules: AllowedMsgpackModules | Literal[True] | None = _lg_msgpack._SENTINEL,
    __unpack_ext_hook__: Callable[[int, bytes], Any] | None = None,
)
```

## Extends

- `SerializerProtocol`

## Constructors

```python
__init__(
    self,
    *,
    pickle_fallback: bool = False,
    allowed_json_modules: Iterable[tuple[str, ...]] | Literal[True] | None = None,
    allowed_msgpack_modules: AllowedMsgpackModules | Literal[True] | None = _lg_msgpack._SENTINEL,
    __unpack_ext_hook__: Callable[[int, bytes], Any] | None = None,
) -> None
```

| Name | Type |
|------|------|
| `pickle_fallback` | `bool` |
| `allowed_json_modules` | `Iterable[tuple[str, ...]] \| Literal[True] \| None` |
| `allowed_msgpack_modules` | `AllowedMsgpackModules \| Literal[True] \| None` |
| `__unpack_ext_hook__` | `Callable[[int, bytes], Any] \| None` |


## Properties

- `pickle_fallback`

## Methods

- [`with_msgpack_allowlist()`](https://reference.langchain.com/python/langgraph.checkpoint/serde/jsonplus/JsonPlusSerializer/with_msgpack_allowlist)
- [`dumps_typed()`](https://reference.langchain.com/python/langgraph.checkpoint/serde/jsonplus/JsonPlusSerializer/dumps_typed)
- [`loads_typed()`](https://reference.langchain.com/python/langgraph.checkpoint/serde/jsonplus/JsonPlusSerializer/loads_typed)

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/398d6cc59d4cf81ab23c09f037e9f521c3fedcd6/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py#L82)