unstale

pypi / datamodel-code-generator

datamodel-code-generator

What changed in datamodel-code-generator 0.60 to 0.96, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

20 breaking14 security3 deprecations11 new APIs and options1 performance13 behavior and defaults1 tooling27 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

datamodel-code-generator 0.968 changes

Breaking changes 2

  • For stream responses whose schema is only an itemSchema, generated operation methods and result aliases now return the whole raw body instead of the item model; use the generated stream helper to get typed items.

    0.96.0release notes

  • Generated SSE, JSON Lines and NDJSON stream helpers for a bare $ref itemSchema now use the referenced model rather than a duplicate ItemSchema or ItemSchemaModel.

    0.96.0release notes

New APIs and options 2

  • When enabled, const, enum, nested composition, false schemas and full referenced schemas are considered when identifying branches that admit no object; object keywords are omitted from those branches.

    0.96.0release notes

  • Generated GraphQL models now have a __typename property that graphql-core can read.

    0.96.0release notes

Behavior and default changes 2

  • Notices are now attributed to the outermost calling frame outside the package, so filters matching module="datamodel_code_generator" no longer suppress them.

    0.96.0release notes

  • Users of unmodeled mapped and x-python-import refs are now typed by import, and mapped classes are imported only in modules that use them.

    0.96.0release notes

Fixes and other changes 2

  • The Genson notice is skipped when an installed package declares the extra.

    0.96.0release notes

  • Pydantic v2 output now chooses string literal quoting to avoid adding an unintended backslash before quotes in regex patterns; the published pattern no longer contains the extra backslash.

    0.96.0release notes

datamodel-code-generator 0.957 changes

Breaking changes 3

  • With schema validators enabled, mapped references no longer contribute runtime validation rules; generated models may accept data they previously rejected.

    0.95.0release notes

  • Generated FastAPI endpoint and service Protocol signatures use the plain type for required nullable parameters without content; callers that pass None or rely on the old signatures get type errors.

    0.95.0release notes

  • With untrusted-input checking enabled, generation now errors for schemas nested more than 100 levels or containing more than 2,000,000 objects and arrays.

    0.95.0release notes

Deprecations 2

  • Using a custom template directory now emits a FutureWarning about Jinja2 becoming optional; configurations that treat warnings as errors can fail until the warning is filtered.

    0.95.0release notes

  • Generating from JSON, YAML, or CSV sample data now emits a FutureWarning about Genson becoming optional; schema inputs do not warn.

    0.95.0release notes

Behavior and default changes 1

  • Dynamic model and module generation skip formatting when no formatter is selected; set formatters to restore formatting and stripped docstring whitespace.

    0.95.0release notes

Fixes and other changes 1

  • Object keywords beside anyOf are read for object branches when an option is enabled.

    0.95.0release notes

datamodel-code-generator 0.945 changes

Breaking changes 2

  • Generated client arguments for required nullable query, path, header, and cookie parameters serialized by style no longer accept None; passing None or an optional-typed value now fails type checking.

    0.94.0release notes

  • Strict schema-version mode now checks nested subschemas.

    0.94.0release notes

New APIs and options 1

Tooling 1

  • A datamodel-codegen alias package is published with each release.

    0.94.0release notes

Fixes and other changes 1

  • Fixes float constants with equal bounds when this option is used.

    0.94.0release notes

datamodel-code-generator 0.937 changes

Breaking changes 3

  • The builtin formatter changes generated-code layout, including string wrapping, imports, comments, indentation, and function bodies, to follow black and isort conventions.

    0.93.0release notes

  • The generator can no longer be installed or run on Python 3.10; its minimum runtime is now Python 3.11. Generated code targeting Python 3.10 is unchanged.

    0.93.0release notes

  • Using --validation with --no-allow-remote-refs now raises an error and generates no code, because the validator fetches remote $ref URLs.

    0.93.0release notes

Performance 1

  • The builtin formatter's line layout is faster.

    0.93.0release notes

Fixes and other changes 3

  • The generator warns when Pydantic 2.14 refuses a bytes pattern at import.

    0.93.0release notes

  • Generated client output leaves out request media types the client cannot write, rather than omitting the operation.

    0.93.0release notes

  • Reserved parameter names are written only where additional keys read them.

    0.93.0release notes

datamodel-code-generator 0.9224 changes

Security 1

  • Adds an option to refuse external refs and code keywords in input.

    0.92.0release notes

New APIs and options 4

  • Generates a WebSocket client from AsyncAPI documents, including handshake query, headers and credentials, channels sharing an address, and server-sent event channels.

    0.92.0release notes

  • Writes deepObject query arrays as name[]=value and scalars as name=value; it also supports nested deepObject values and URL-encoded form bodies.

    0.92.0release notes

  • Adds an experimental Python API that returns the root class and the class for each schema location alongside the models.

    0.92.0release notes

  • With register_module=True, dynamic classes are registered so that they and their instances can be pickled.

    0.92.0release notes

Behavior and default changes 6

  • Routes multiple messages per channel direction, sends subclass messages using their nearest class's encoder, and reads string discriminators as the property they name.

    0.92.0release notes

  • The builtin formatter graduates from experimental.

    0.92.0release notes

  • The formatter splits long lines as black does, measures line widths as black does across Python versions, and sorts imported names in natural order.

    0.92.0release notes

  • Includes the empty subclass written for a duplicate by --reuse-model, at the duplicate's location.

    0.92.0release notes

  • The Python API is marked experimental.

    0.92.0release notes

  • Unsupported operations caused only by their own declarations are skipped with one UserWarning naming the operation and reasons; other operations are generated. Generation still fails if all operations are skipped or a document- or setting-level refusal occurs.

    0.92.0release notes

Fixes and other changes 13

  • Fixes client handshake URLs and empty packages.

    0.92.0release notes

  • Includes the empty subclass written for a duplicate by --reuse-model in models_by_source_ref, at the duplicate's location.

    0.92.0release notes

  • Uses the call's parameter value where an API key credential would go when provided, and uses the credential when it is not.

    0.92.0release notes

  • Sends and reads a whole JSON body declared as a binary string as raw octets of its media type.

    0.92.0release notes

  • Generates multipart requests whose body schema is a union of objects by merging their parts by name.

    0.92.0release notes

  • Writes a parameter declared as one item or an array according to its style, treating each item as a scalar.

    0.92.0release notes

  • An unsupported security alternative is left out when an operation declares another alternative the client can use, rather than causing the operation to be skipped.

    0.92.0release notes

  • Sends one credential when schemes in an AND requirement place the same kind at one position, allowing documents that require two OAuth 2 schemes together to generate a client.

    0.92.0release notes

  • Writes patterns for an output regex engine, selecting python-re when the Rust engine refuses a pattern, rewriting an unescaped bracket in a class, and warning when no engine compiles a pattern.

    0.92.0release notes

  • On macOS, watch mode detects directory changes that happen before generation ends and polls only existing dependencies rather than walking the surrounding project tree.

    0.92.0release notes

  • Watch mode starts again while skipping unreadable directories below a watched root, rather than failing to start.

    0.92.0release notes

  • Retries YAML documents that libyaml cannot read using PyYAML's scanner, avoiding differences in document reading based on whether PyYAML has libyaml.

    0.92.0release notes

  • Reads a plain = in YAML input as the string =, as YAML 1.2 does, rather than refusing the document.

    0.92.0release notes

datamodel-code-generator 0.8616 changes

Breaking changes 5

  • Mapped format: byte strings with length constraints now generate Annotated bytes using EncodedBytes and Base64Encoder, decoding base64 and checking lengths on the encoded text.

    0.86.0release notes

  • Mapped format: byte fields under strict bytes now decode base64 instead of holding raw text; FastAPI path, query, header, and cookie parameters no longer stop generation with an error.

    0.86.0release notes

  • Mapped format: byte values without constraints now pass through base64 decoding, including byte strings in multi-type schemas.

    0.86.0release notes

  • Integer and subclass enums listing null no longer generate a None member that raises TypeError on import; an enum containing only null becomes RootModel[None].

    0.86.0release notes

  • Optional one-value Literal discriminator tags now default to their sole value instead of None, allowing the discriminated union to import.

    0.86.0release notes

Deprecations 1

  • The generator warns about msgspec unions containing an Enum alongside another member of the same JSON type.

    0.86.0release notes

New APIs and options 3

  • Adds schema analysis and rule-based recommendations for generation options.

    0.86.0release notes

  • Adds an option to represent single-value enums as constants; nullable unions and mixed-type branches are kept distinct, and nullable single-value enums remain enums that accept null.

    0.86.0release notes

  • Adds an option to use tag values as union variant names; prefixed names of models inside key-named branches no longer repeat the key.

    0.86.0release notes

Behavior and default changes 2

  • Long Annotated assignments with a None default are wrapped like black; --check with a dated preset using the builtin formatter reports the reformatting.

    0.86.0release notes

  • Warns when keys in the model name map match no generated model.

    0.86.0release notes

Fixes and other changes 5

  • Number constraints are no longer emitted on generated fields whose types do not take them.

    0.86.0release notes

  • Pydantic discriminator tag fields no longer carry a pattern that every tag value already satisfies, avoiding generated output that fails at import.

    0.86.0release notes

  • Generated msgspec Structs are flattened when their generated bases have conflicting layouts.

    0.86.0release notes

  • A stale name for a renamed type is released from a package __init__ re-import.

    0.86.0release notes

  • Generated code now imports the object that holds enum members used by x-python-type Literals.

    0.86.0release notes

datamodel-code-generator 0.8510 changes

Breaking changes 5

  • Output encoding failures now raise datamodel_code_generator.Error instead of codec exceptions; modular output writes no files if a module cannot be encoded.

    0.85.0release notes

  • Unknown encodings and codecs that are not text encodings are rejected during config preparation, before input is read or output paths are created.

    0.85.0release notes

  • The builtin formatter now classifies standard-library imports using the target Python version; when no target is given, it uses 3.10.

    0.85.0release notes

  • Non-ASCII generated names now follow the target Python version's Unicode rules, which can change field, class, enum member, and module names.

    0.85.0release notes

  • Generation fails if a referenced standard-library type is unavailable in the target Python version.

    0.85.0release notes

New APIs and options 1

  • Python 3.15 is now available as a target version.

    0.85.0release notes

Behavior and default changes 2

  • The builtin formatter now places each module in a multi-module import statement in its own section according to its category.

    0.85.0release notes

  • Explicit names are validated against the target Python version's identifier rules rather than those of the running interpreter.

    0.85.0release notes

Fixes and other changes 2

  • Model reuse now recognizes references starting with non-ASCII letters, so equivalent models can be reused instead of emitted as duplicates.

    0.85.0release notes

  • Newer typing and collections.abc names requested through overrides or schema import paths are imported from typing_extensions when unavailable in the target Python version.

    0.85.0release notes

datamodel-code-generator 0.811 changes

Security 1

  • datamodel-code-generator: Protobuf weak-import path traversal allows files to be written outside the temporary directory

    0.81.0security advisory

datamodel-code-generator 0.641 changes

Security 1

  • datamodel-code-generator vulnerable to code injection via x-python-import / customTypePath in generated import statements

    0.64.0security advisory

datamodel-code-generator 0.632 changes

Security 2

  • datamodel-code-generator: Authorization / request headers leaked to cross-origin redirect target when fetching remote schemas

    0.63.0security advisory

  • datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding

    0.63.0security advisory

datamodel-code-generator 0.622 changes

Security 2

  • datamodel-code-generator vulnerable to arbitrary local file read via JSON-Schema $ref (file:// and ../ traversal), bypassing --no-allow-remote-refs

    0.62.0security advisory

  • datamodel-code-generator vulnerable to arbitrary local file read via XSD schemaLocation (xs:include/xs:import) path traversal, with no remote-ref gate

    0.62.0security advisory

datamodel-code-generator 0.612 changes

Security 2

  • datamodel-code-generator vulnerable to SSRF via JSON-Schema $ref to HTTP URL (silent by default)

    0.61.0security advisory

  • datamodel-code-generator vulnerable to SSRF via --url: no host/IP validation, follows redirects

    0.61.0security advisory

datamodel-code-generator 0.605 changes

Security 5

  • datamodel-code-generator vulnerable to code execution on import via unescaped validators entries in --extra-template-data

    0.60.2security advisory

  • datamodel-code-generator vulnerable to code execution on import via x-python-type JSON-Schema extension in datamodel-code-generator

    0.60.2security advisory

  • datamodel-code-generator vulnerable to code injection in via attacker-controlled default_factory schema field

    0.60.2security advisory

  • datamodel-code-generator vulnerable to code injection via unescaped carriage return in --extra-template-data comment field

    0.60.2security advisory

  • datamodel-code-generator vulnerable to code injection via unescaped carriage return in GraphQL Union description

    0.60.1security advisory