msgspec v0.21.1 Release Notes

Release Date: 2026-04-12 // about 2 months ago
    • 🛠 Fix ValidationError and DecodeError raised in dec_hook being incorrectly wrapped in another ValidationError (#1013).
    • Fix a potential NULL dereference in structmeta_get_module_ns (#1016).
    • Fix a reference leak in ms_passes_big_int_constraints (#1017).
    • 🛠 Fix missing ref_template parameter in msgspec.json.schema type stub (#1002).
    • 📄 Clarify order='deterministic' encoder docstrings (#1011).
    • ➕ Add a porting guide for users migrating from orjson (#1007).

Previous changes from v0.21.0

    • Fix a segfault on Python 3.13+ that could occur when creating structs that contained a __dict__, instead of only using __slots__ (#960).
    • 👌 Improve type annotations for msgspec.UNSET (#975).
    • 🛠 Fix hashing of decoded tuples on Python 3.14 (#980).
    • ➕ Add ref_template arg to msgspec.json.schema (#983).
    • ➕ Add missing libm linkage to some architectures (#993).
    • 🛠 Fix memory leak when decoding sets (#991).
    • ➕ Add uniqueItems annotation to set/frozenset JSON schemas (#984).
    • 💥 BREAKING : Call __post_init__ from msgspec.structs.replace/copy.replace (#1000).