Skip to content

Choose a tag to compare

@github-actions github-actions released this 21 Jun 18:19
· 10 commits to main since this release
19039d0

Breaking Changes

Error Handling Changes

  • YAML !!set tags now rejected - load_yaml now validates all YAML input and raises a yaml.YAMLError when it encounters the unsupported tag:yaml.org,2002:set (!!set) tag. Previously such input was loaded silently (constructed as a Python set). YAML schemas or sample data that relied on !!set tags will now fail to load with an "Unsupported YAML tag" error. This validation runs unconditionally on every YAML load and is not gated behind any opt-in flag (#3447)

Code Generation Changes

  • msgspec.Struct boolean const fields now generate bool instead of Literal[True]/Literal[False] - When generating msgspec.Struct models (--output-model-type msgspec.Struct), a JSON Schema const with a boolean value now produces a plain bool type instead of a boolean Literal, because msgspec does not support boolean Literal tag values at runtime. Output for other model types (e.g. Pydantic) is unchanged. Existing msgspec users with boolean-const fields will see different generated output. (#3462)
  • msgspec.Struct combined object unions now render as tagged Struct unions - For msgspec.Struct output, combined (oneOf/anyOf) object schemas that share a required literal discriminator field with int/str values now have a discriminator inferred and are emitted as tagged Struct unions (tag_field=..., tag=...). This changes the generated class definitions for existing msgspec users whose schemas match this shape. (#3462)

What's Changed

Full Changelog: 0.64.1...0.65.0