Skip to content

Choose a tag to compare

@github-actions github-actions released this 26 Jun 14:45
ddb1bfe

Breaking Changes

  • msgspec nullable annotated fields now place None outside Annotated - For msgspec.Struct models, nullable fields that carry Meta/Annotated constraints no longer wrap the type in Optional inside the Annotated[...]. The None member is now emitted as a separate union arm outside the Annotated wrapper, which changes the generated type hints and the resulting imports (Optional is dropped when no longer needed). This is required for the generated models to validate correctly at runtime under msgspec, but it changes output for existing users. (#3495)
# Before
from typing import Annotated, Optional, Union
name: Union[Annotated[Optional[str], Meta(max_length=5)], UnsetType] = UNSET

# After
from typing import Annotated, Union
name: Union[Annotated[str, Meta(max_length=5)], None, UnsetType] = UNSET

What's Changed

Full Changelog: 0.65.1...0.66.0