Skip to content

Bump datamodel-code-generator from 0.86.0 to 0.87.0 - #111

Open
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/pip/datamodel-code-generator-0.87.0
Open

dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/pip/datamodel-code-generator-0.87.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 2, 2026

Copy link
Copy Markdown

Bumps datamodel-code-generator from 0.86.0 to 0.87.0.

Release notes

Sourced from datamodel-code-generator's releases.

0.87.0

Compatibility policy for 0.87.0

  • Default output is unchanged from 0.86.0 except for fixes of output that failed to import or generate, or that rejected every valid payload, and changes that do not alter behaviour. Every other change is behind its own option and the dated presets standard-*-20261027 / practical-*-20261027 (for example standard-py312-20261027).
  • Announced exceptions to "unchanged by default":
    • External $anchor references in directory input resolve to the document that declares the anchor (#5088). This is what the specification says; 0.86.0 depended on the order the files were read.
    • msgspec unions whose members all failed to decode in 0.86.0 now decode. A member class that is also used on its own loses the field named like the union tag, or the field its base already declares (#5369, #4984, #5085, #5086).
    • propertyNames keys that reference a root model are typed as a constrained str (#5017); the previous output rejected every non-empty map.
    • With --strict-nullable --reuse-model --collapse-reuse-models (and the practical presets), a reference to a non-nullable object schema whose model was merged into an equal nullable one rejects null again, as in 0.83.0; 0.84.0 to 0.86.0 wrote | None there (#5407). No class is renamed or removed; where a second merge depended on that None, the model or type alias of the non-nullable schema is written again.
  • Import cycles: the modules merged into _internal (#5347, #5374) keep every name importable from its 0.86.0 module path, including the _internal module. A module import named like a builtin is aliased where the module also writes that builtin (partial fix of #5387).
  • Performance: generation is 12-21% faster than the previous development build, but on large schemas it is still 1.27-1.71x the time of 0.86.0 (quiet x86 Linux host, minimum of 7 runs; small schemas 1.27-1.30x).
  • New tooling: per-release output-change pages and an upgrade guide are generated from recorded behaviour differences (#5386, #5388).
  • Known issues, open at release: #5376, #5378, #5380, #5382, #5384, #5385, #5387, #5411, #5412.

Opt-in behaviour changes (enable per option or with the 20261027 preset)

  • --filter-literal-values drops enum and const values that fail the constraints beside them; implied by --omit-redundant-constraints (#5100)
  • --read-const-beside-enum types a value by the const that narrows its enum, and reads an enum that contains its const as that const under --use-single-value-enum-as-const (#5101, #5102)
  • --use-tuple-for-closed-arrays generates closed prefixItems / items arrays (and the length-fixing --use-tuple-for-fixed-items cases) as fixed-length tuples (#5103)
  • --pin-aliases-with-alias-generator decides each field's alias by the alias_generator its model applies, for Pydantic v2 models and dataclasses (#5104)
  • --tag-msgspec-by-payload-name tags msgspec discriminated unions by the property name in the document, not its Python name (#5105)
  • --order-constructor-fields-by final-names orders constructor fields by their final names, so an overriding required field keeps the position of the inherited one instead of becoming kw_only (#5106)
  • --use-site-models-for-constrained-refs gives a $ref that carries more assertions (or an allOf that adds constraints, an enum or a type to a reference) its own model (#5107)
  • --intersect-allof-keywords combines the keywords of every allOf part: constraints intersect, enums narrow, patterns conjoin, null members drop beside a type that excludes null (for example kind: str | None becomes kind: str) (#5108, #4951)
  • --use-single-dict-for-object-maps generates one dict for patternProperties / propertyNames object maps instead of a union of dicts, and counts every key in schema validators (#5113)
  • --read-unevaluated-properties reads a schema-valued unevaluatedProperties like additionalProperties, so extra keys are typed (#5114)
  • --dedupe-request-response-variants (needs --read-only-write-only-model-type request-response or all, which the preset does not set) decides request/response variants from the schema graph: no unreferenced duplicates, stable numbering, allOf parent inline models written once (#5115, #5089)
  • --order-constructor-fields-by written-defaults orders msgspec.Struct and Pydantic dataclass fields by the defaults they write under --strip-default-none (which the preset does not set): a stripped None default counts as a default for the field's place, a subclass after an inherited default is no longer kw_only=True, and a Pydantic dataclass field that redeclares an inherited stripped None default as required gets Field(...). Without it the output keeps 0.86.0's order, kw_only and inherited defaults (#5116, #4946, #5399)
  • --read-nullable-beside-type-list lets the root model admit None for nullable: true beside a type list that holds an object and another type, under --strict-nullable or --use-missing-sentinel (#5117, #5064)
  • --keep-field-defaults-off-branch-roots keeps a nullable field's default: null off the root model of a constrained union branch under --field-constraints / --use-annotated (#5118, #5084, #4987)
  • --omit-redundant-reference-null stops writing | None after a reference to a model that already admits null (list[Name | None] becomes list[Name]) (#5120, #5081)
  • --use-typed-map-values-beside-other-types, together with --use-typed-nullable-map-values (which no preset sets), types the additionalProperties values of the object member of type arrays that list other types, such as [object, string]; the option changes nothing without --use-typed-nullable-map-values (#5127, #5094)
  • --keep-enum-member-values writes an enum whose IntEnum / StrEnum / (T, Enum) base would change a member value as a plain Enum that keeps every value as written (#5133)
  • --omit-redundant-constraints does not write a constraint again beside a type that already enforces it, such as the bound of NonNegativeInt (needs --use-non-positive-negative-number-constrained-types, not set by the preset) and the length and number constraints a const or enum Literal meets by its values; implies --filter-literal-values (#4525, #4875)
  • --use-decimal-in-field-forms writes Decimal for multipleOf in field forms (#5021)
  • --collapse-shared-parent-wrappers: under --collapse-root-models --collapse-root-models-name-strategy parent, later holders of a parent root wrapper follow the first holder's collapse even where --field-type-collision-strategy rename-type renames the wrapper apart from its inner model. By default those holders keep the 0.86.0 wrapper; inputs that crashed in 0.86.0 are fixed either way. Under the parent strategy a pydantic v2 dataclass no longer writes the self-named alias Wrapper = TypeAliasType("Wrapper", Wrapper) beside the class that took the wrapper's name; the class validates the same payloads. (#5398)
  • --openapi-as-definitions paths-bodies gives the request and response bodies of the paths and webhooks scopes the model a schema definition of the same body gets, for example an object body with a type array such as [object, null] (needs --openapi-scopes paths / webhooks, not set by the preset); it also covers object-map bodies of the legacy paths scope, whose default output is as in 0.86.0 except that closed patternProperties maps are fixed by default (#5025, #5024, #5141)
  • Under --generate-schema-validators, counting every key of pattern maps and checking declared keys against matching patterns now needs --check-pattern-maps-strictly; without it the output is the same as 0.86.0 (#5152)
  • --order-constructor-fields-by written-defaults now also orders dataclass and Pydantic dataclass fields by the nested-model default factories they write (under --use-default-factory-for-optional-nested-models --strip-default-none); without it the output is the same as 0.86.0
  • Giving OpenAPI components written as a constrained $ref to a recursive schema their own root model now needs --openapi-as-definitions ref-components (in preset 20261027); without it the output is the same as 0.86.0 (#5176)

Crash and import fixes

  • msgspec: a union of several dicts, which msgspec cannot decode, is generated as one dict
  • Map keys that reference a root model that is not frozen are typed by the root type: the previous dict[Key, ...] raised TypeError: unhashable type on every non-empty map (#5017)
  • Object bodies in the legacy paths scope get models (#5024)
  • TypedDict extra_items names the final class so the module imports (#5022)
  • Non-finite float enum members are written importably (#4954)
  • GraphQL subclass enums are written as importable StrEnum (#4970)
  • A discriminator whose tag values are float (or, for msgspec, bool) consts no longer crashes generation or import; the union is written without a discriminator (#5053, #5086)
  • Schemas merged from another document resolve their $refs in their own document: inputs that failed with "A Parser can not resolve classes" (#5046), an inherited property narrowed by a child in another directory ($ref file not found, #5068), and several --read-only-write-only-model-type request-response inputs now generate
  • $ref to an $anchor declared inside a oneOf branch resolves instead of failing with Unresolved $id reference (#5056, #5092)
  • Fixed a ValidationError when an allOf child and its parent both declare a property named like a schema keyword, such as minimum or maximum (#5069)

... (truncated)

Changelog

Sourced from datamodel-code-generator's changelog.

0.87.0 - 2026-10-28

Compatibility policy for 0.87.0

  • Default output is unchanged from 0.86.0 except for fixes of output that failed to import or generate, or that rejected every valid payload, and changes that do not alter behaviour. Every other change is behind its own option and the dated presets standard-*-20261027 / practical-*-20261027 (for example standard-py312-20261027).
  • Announced exceptions to "unchanged by default":
    • External $anchor references in directory input resolve to the document that declares the anchor (#5088). This is what the specification says; 0.86.0 depended on the order the files were read.
    • msgspec unions whose members all failed to decode in 0.86.0 now decode. A member class that is also used on its own loses the field named like the union tag, or the field its base already declares (#5369, #4984, #5085, #5086).
    • propertyNames keys that reference a root model are typed as a constrained str (#5017); the previous output rejected every non-empty map.
    • With --strict-nullable --reuse-model --collapse-reuse-models (and the practical presets), a reference to a non-nullable object schema whose model was merged into an equal nullable one rejects null again, as in 0.83.0; 0.84.0 to 0.86.0 wrote | None there (#5407). No class is renamed or removed; where a second merge depended on that None, the model or type alias of the non-nullable schema is written again.
  • Import cycles: the modules merged into _internal (#5347, #5374) keep every name importable from its 0.86.0 module path, including the _internal module. A module import named like a builtin is aliased where the module also writes that builtin (partial fix of #5387).
  • Performance: generation is 12-21% faster than the previous development build, but on large schemas it is still 1.27-1.71x the time of 0.86.0 (quiet x86 Linux host, minimum of 7 runs; small schemas 1.27-1.30x).
  • New tooling: per-release output-change pages and an upgrade guide are generated from recorded behaviour differences (#5386, #5388).
  • Known issues, open at release: #5376, #5378, #5380, #5382, #5384, #5385, #5387, #5411, #5412.

Opt-in behaviour changes (enable per option or with the 20261027 preset)

  • --filter-literal-values drops enum and const values that fail the constraints beside them; implied by --omit-redundant-constraints (#5100)
  • --read-const-beside-enum types a value by the const that narrows its enum, and reads an enum that contains its const as that const under --use-single-value-enum-as-const (#5101, #5102)
  • --use-tuple-for-closed-arrays generates closed prefixItems / items arrays (and the length-fixing --use-tuple-for-fixed-items cases) as fixed-length tuples (#5103)
  • --pin-aliases-with-alias-generator decides each field's alias by the alias_generator its model applies, for Pydantic v2 models and dataclasses (#5104)
  • --tag-msgspec-by-payload-name tags msgspec discriminated unions by the property name in the document, not its Python name (#5105)
  • --order-constructor-fields-by final-names orders constructor fields by their final names, so an overriding required field keeps the position of the inherited one instead of becoming kw_only (#5106)
  • --use-site-models-for-constrained-refs gives a $ref that carries more assertions (or an allOf that adds constraints, an enum or a type to a reference) its own model (#5107)
  • --intersect-allof-keywords combines the keywords of every allOf part: constraints intersect, enums narrow, patterns conjoin, null members drop beside a type that excludes null (for example kind: str | None becomes kind: str) (#5108, #4951)
  • --use-single-dict-for-object-maps generates one dict for patternProperties / propertyNames object maps instead of a union of dicts, and counts every key in schema validators (#5113)
  • --read-unevaluated-properties reads a schema-valued unevaluatedProperties like additionalProperties, so extra keys are typed (#5114)
  • --dedupe-request-response-variants (needs --read-only-write-only-model-type request-response or all, which the preset does not set) decides request/response variants from the schema graph: no unreferenced duplicates, stable numbering, allOf parent inline models written once (#5115, #5089)
  • --order-constructor-fields-by written-defaults orders msgspec.Struct and Pydantic dataclass fields by the defaults they write under --strip-default-none (which the preset does not set): a stripped None default counts as a default for the field's place, a subclass after an inherited default is no longer kw_only=True, and a Pydantic dataclass field that redeclares an inherited stripped None default as required gets Field(...). Without it the output keeps 0.86.0's order, kw_only and inherited defaults (#5116, #4946, #5399)
  • --read-nullable-beside-type-list lets the root model admit None for nullable: true beside a type list that holds an object and another type, under --strict-nullable or --use-missing-sentinel (#5117, #5064)
  • --keep-field-defaults-off-branch-roots keeps a nullable field's default: null off the root model of a constrained union branch under --field-constraints / --use-annotated (#5118, #5084, #4987)
  • --omit-redundant-reference-null stops writing | None after a reference to a model that already admits null (list[Name | None] becomes list[Name]) (#5120, #5081)
  • --use-typed-map-values-beside-other-types, together with --use-typed-nullable-map-values (which no preset sets), types the additionalProperties values of the object member of type arrays that list other types, such as [object, string]; the option changes nothing without --use-typed-nullable-map-values (#5127, #5094)
  • --keep-enum-member-values writes an enum whose IntEnum / StrEnum / (T, Enum) base would change a member value as a plain Enum that keeps every value as written (#5133)
  • --omit-redundant-constraints does not write a constraint again beside a type that already enforces it, such as the bound of NonNegativeInt (needs --use-non-positive-negative-number-constrained-types, not set by the preset) and the length and number constraints a const or enum Literal meets by its values; implies --filter-literal-values (#4525, #4875)
  • --use-decimal-in-field-forms writes Decimal for multipleOf in field forms (#5021)
  • --collapse-shared-parent-wrappers: under --collapse-root-models --collapse-root-models-name-strategy parent, later holders of a parent root wrapper follow the first holder's collapse even where --field-type-collision-strategy rename-type renames the wrapper apart from its inner model. By default those holders keep the 0.86.0 wrapper; inputs that crashed in 0.86.0 are fixed either way. Under the parent strategy a pydantic v2 dataclass no longer writes the self-named alias Wrapper = TypeAliasType("Wrapper", Wrapper) beside the class that took the wrapper's name; the class validates the same payloads. (#5398)
  • --openapi-as-definitions paths-bodies gives the request and response bodies of the paths and webhooks scopes the model a schema definition of the same body gets, for example an object body with a type array such as [object, null] (needs --openapi-scopes paths / webhooks, not set by the preset); it also covers object-map bodies of the legacy paths scope, whose default output is as in 0.86.0 except that closed patternProperties maps are fixed by default (#5025, #5024, #5141)
  • Under --generate-schema-validators, counting every key of pattern maps and checking declared keys against matching patterns now needs --check-pattern-maps-strictly; without it the output is the same as 0.86.0 (#5152)
  • --order-constructor-fields-by written-defaults now also orders dataclass and Pydantic dataclass fields by the nested-model default factories they write (under --use-default-factory-for-optional-nested-models --strip-default-none); without it the output is the same as 0.86.0
  • Giving OpenAPI components written as a constrained $ref to a recursive schema their own root model now needs --openapi-as-definitions ref-components (in preset 20261027); without it the output is the same as 0.86.0 (#5176)

Crash and import fixes

  • msgspec: a union of several dicts, which msgspec cannot decode, is generated as one dict
  • Map keys that reference a root model that is not frozen are typed by the root type: the previous dict[Key, ...] raised TypeError: unhashable type on every non-empty map (#5017)
  • Object bodies in the legacy paths scope get models (#5024)
  • TypedDict extra_items names the final class so the module imports (#5022)
  • Non-finite float enum members are written importably (#4954)
  • GraphQL subclass enums are written as importable StrEnum (#4970)
  • A discriminator whose tag values are float (or, for msgspec, bool) consts no longer crashes generation or import; the union is written without a discriminator (#5053, #5086)
  • Schemas merged from another document resolve their $refs in their own document: inputs that failed with "A Parser can not resolve classes" (#5046), an inherited property narrowed by a child in another directory ($ref file not found, #5068), and several --read-only-write-only-model-type request-response inputs now generate
  • $ref to an $anchor declared inside a oneOf branch resolves instead of failing with Unresolved $id reference (#5056, #5092)

... (truncated)

Commits
  • 4e5fc62 Keep a reference rejecting null when the schema it names does, after --collap...
  • 878a178 Order the fields of a dataclass whose field class overrides field or str ...
  • 8de944f Bound the payload sampling of number schemas with an integer multipleOf to th...
  • 437f4f0 Rebalance the CI test shards on current durations and split them so each job ...
  • 0b09235 Keep the 0.86.0 kw_only and field order of msgspec and Pydantic dataclass sub...
  • 47665fa Generate per-release output-change pages and an upgrade guide from behaviour ...
  • f40a5e6 Keep the parent root wrapper for its later holders, as 0.86.0 did, where the ...
  • b25d531 Keep 0.86.0 output for legacy path object bodies, multipleOf field forms, inh...
  • 55e7dc2 Date the unreleased preset 20261027 (#5395)
  • 546c492 Restore the 0.86.0 dialect flag reads and constructor field ordering under --...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [datamodel-code-generator](https://github.com/datamodel-code-generator/datamodel-code-generator) from 0.86.0 to 0.87.0.
- [Release notes](https://github.com/datamodel-code-generator/datamodel-code-generator/releases)
- [Changelog](https://github.com/datamodel-code-generator/datamodel-code-generator/blob/main/CHANGELOG.md)
- [Commits](datamodel-code-generator/datamodel-code-generator@0.86.0...0.87.0)

---
updated-dependencies:
- dependency-name: datamodel-code-generator
  dependency-version: 0.87.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels Nov 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants