jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.01k stars 59 forks source link

Support setting `strict=False` on specific fields #670

Open TheMythologist opened 2 months ago

TheMythologist commented 2 months ago

Description

Instead of globally setting strict=False on the decoder function/class, allow setting strict=False for specific fields. This way, we can get the non-strict conversions on some fields, and get strict conversions on the other fields.

soldni commented 3 weeks ago

That would be a great feature!