msgspec icon indicating copy to clipboard operation
msgspec copied to clipboard

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML

Results 211 msgspec issues
Sort by recently updated
recently updated
newest added
trafficstars

### Description Right now, `dec_hooks` and `enc_hooks` are called only if msgspec encounters unknown type. I'd like a way to override dec/enc logic for specific supported types, but there is...

### Question I've noticed that when encoding a dataclass class (as opposed to an instance), the class is encoded to an empty dict. I was wondering if this was intentional...

### Description Currently msgspec only supports encoding Enum values that strings or integers, throwing `msgspec.EncodeError: Only enums with int or str values are supported` when attempting to encode anything else....

### Description json.schema can take a schema_hook to encode custom types in the schema, but the fields can only support values of built-in types as defaults.

[freezegun](https://github.com/spulec/freezegun) is a utility library commonly used in testing to control the time. In doing so it causes the `datetime` library to produce fake types. Although these types correctly identify...

### Question Hi, I was hoping for a flag or some other method of interpreting a `None` value in json as the default value, such that it would continue to...

### Description Running the latest version of msgspec (0.18.6) on Python 3.12.2. I noticed that we are unable to define types that use `ForwardRef` to reference itself. For example, I...

### Description if `msgspec.Struct` is faster than dataclasses, can msgspec also provide enums? There is `fastenum` which claims to be faster than regular python enum. but its not written in...

### Description When using `msgspec.convert()` to convert to a Struct with `from_attributes=True`, the Struct's `__post_init__` is not called. It works as expected with dataclasses. ```python from dataclasses import dataclass import...

### Question This is something I'm not sure should be a feature request. Validating data against a schema as you're _encoding_ it is more niche than validating data as you're...