Breaking Changes
Code Generation Changes
- Self-referencing fields are now quoted with
--disable-future-imports- When--disable-future-importsis set (nofrom __future__ import annotationsand no native PEP 649 deferred evaluation on Python < 3.14), self-referencing and forward-referencing field annotations in regularBaseModelclasses are now emitted as quoted forward references instead of bare names. Previously such annotations were left unquoted, producing invalid code that raisedNameError(Ruff F821) at class-evaluation time. Output for the common case (withfrom __future__ import annotationsor Python 3.14 native deferred annotations) is unchanged. Users who snapshot/golden-file generated output for the--disable-future-importsconfiguration with self-referencing models will see the annotation change from unquoted to quoted, e.g.children: Optional[List[Node]]→children: Optional[List["Node"]]. (#3387)
What's Changed
- Update CHANGELOG for 0.63.0 by @dcg-generated-docs[bot] in #3345
- Deduplicate module content builder by @koxudaxi in #3346
- Deduplicate import reference helpers by @koxudaxi in #3348
- Refactor jsonschema root model registration by @koxudaxi in #3352
- Refactor XML Schema literal helpers by @koxudaxi in #3349
- Move builtin formatter helpers by @koxudaxi in #3351
- Deduplicate Pydantic v2 config helpers by @koxudaxi in #3350
- Deduplicate DataType type hint rendering by @koxudaxi in #3354
- Fix
constr()for string fields carrying minItems/maxItems by @DarkaMaul in #3353 - Cover non-finite import idempotence by @koxudaxi in #3367
- Deduplicate input text detection by @koxudaxi in #3357
- Remove stale protobuf coverage pragma by @koxudaxi in #3358
- Cover explicit null OpenAPI media schemas by @koxudaxi in #3360
- Simplify Python version feature checks by @koxudaxi in #3361
- Speed up CI checks by @koxudaxi in #3378
- Add maintainer link to docs footer and README by @koxudaxi in #3379
- Use builtin formatter in CI by @koxudaxi in #3380
- Split coverage by OS by @koxudaxi in #3381
- Simplify import removal cleanup by @koxudaxi in #3362
- Pin deprecation warning stacklevel by @koxudaxi in #3363
- Pin public module exports by @koxudaxi in #3364
- Cover to_hashable branch cases by @koxudaxi in #3366
- Cover stable toposort behavior by @koxudaxi in #3369
- Extract registry render helpers by @koxudaxi in #3371
- Fix minItems for arrays of URI strings by @sjh9714 in #3377
- Deduplicate config value validators by @koxudaxi in #3372
- Cover CLI option metadata helpers by @koxudaxi in #3374
- Cover Pydantic v2 version fallback by @koxudaxi in #3368
- Fix nullable JSON Schema const enums by @koxudaxi in #3355
- Pin patchable generation seams by @koxudaxi in #3365
- Cover utility helper behavior by @koxudaxi in #3375
- Cover DefaultPutDict behavior by @koxudaxi in #3376
- Cover validator config normalization by @koxudaxi in #3373
- Avoid expensive runtime type checks by @koxudaxi in #3382
- Avoid eager builtin formatter import by @koxudaxi in #3383
- Avoid eager TOML parser import by @koxudaxi in #3384
- Stabilize msgspec payload tests by @koxudaxi in #3385
- Avoid eager input parser imports by @koxudaxi in #3386
- Avoid eager parser model imports by @koxudaxi in #3388
- Avoid eager AsyncAPI converter imports by @koxudaxi in #3389
- Dispose parser on parse errors by @koxudaxi in #3390
- Fix YAML warning filter handling by @koxudaxi in #3392
- Cache local parser sources by @koxudaxi in #3393
- Guard mutable generation inputs by @koxudaxi in #3394
- Compact dynamic cache keys by @koxudaxi in #3395
- Guard OpenAPI path items by @koxudaxi in #3397
- Isolate converted schemas by @koxudaxi in #3396
- Add performance measurement coverage by @koxudaxi in #3398
- Restore input model modules by @koxudaxi in #3399
- Reduce Pydantic v2 render work by @koxudaxi in #3400
- Defer parser config imports by @koxudaxi in #3402
- Slot generation facts by @koxudaxi in #3403
- Fast path JSON schemas by @koxudaxi in #3404
- Lazy root format exports by @koxudaxi in #3405
- Defer generation refresh by @koxudaxi in #3406
- Cache parsed sources by @koxudaxi in #3407
- Shard Python tests by @koxudaxi in #3408
- Cache payload validation strategies by @koxudaxi in #3409
- fix: quote self-referencing fields when --disable-future-imports is set by @kaizeenn in #3387
- Skip discriminator import scan by @koxudaxi in #3411
- Fast path schema output by @koxudaxi in #3410
New Contributors
- @DarkaMaul made their first contribution in #3353
- @sjh9714 made their first contribution in #3377
- @kaizeenn made their first contribution in #3387
Full Changelog: 0.63.0...0.64.0