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.3k stars 67 forks source link

Pass key constraints as `propertyNames` in JSON Schema #604

Closed jcrist closed 10 months ago

jcrist commented 10 months ago

This adds support for publicizing constraints on dict keys using the propertyNames field when generating a JSON Schema. For now this is only done for dicts with string keys; constraints on other key types are trickier to specify.

Supersedes #576.