Skip to content

Choose a tag to compare

@github-actions github-actions released this 23 Jul 03:42
· 2522 commits to main since this release
89f3262

Breaking Changes

  • Preserved additionalProperties value constraints change generated output - JSON Schema additionalProperties (and propertyNames/mapping) value schemas that carry constraints (e.g. minimum/maximum, minLength/maxLength/pattern, array item constraints, allOf-merged primitives) now retain those constraints in the generated model instead of dropping them. This produces new TypeAlias/RootModel/TypeAliasType definitions and changes dict value type hints, so output differs for existing schemas. For example, a mapping value that previously generated dict[str, Literal['fixed']] now generates a dedicated alias preserving the constraints (#3616):
# Before
class DictModel(RootModel[dict[str, Literal['fixed']]]):
    root: dict[str, Literal['fixed']]

# After
DictModelAdditionalProperty = TypeAliasType(
    "DictModelAdditionalProperty",
    Annotated[Literal['fixed'], Field(max_length=100, min_length=1)],
)


class DictModel(RootModel[dict[str, DictModelAdditionalProperty]]):
    root: dict[str, DictModelAdditionalProperty]

What's Changed

Full Changelog: 0.69.0...0.70.0