fix(deps): update dependency @nestjs/swagger to v12 - #71
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/nestjs-swagger-12.x
branch
from
September 4, 2026 09:37
293fd50 to
09bbf87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^11.4.6→^12.0.0Release Notes
nestjs/swagger (@nestjs/swagger)
v12.0.1Compare Source
12.0.1 (2026-08-28)
Bug fixes
Dependencies
Committers: 1
v12.0.0Compare Source
What's Changed
@nestjs/swaggeris now a native ES module, requires Nest 12, and changes how nullable schemas are spelled in the generated document.ESM migration
The package is published as pure ESM (
"type": "module", compiled with NodeNext) behind a proper exports map. The legacy rootindex.ts/plugin.js/plugin.tsshims are gone, and deep imports into build internals are no longer resolvable — import from the package root (@nestjs/swagger) or from@nestjs/swagger/plugin.require(esm) — CommonJS still works
You do not need to convert your app to ESM. Thanks to Node's
require(esm)support, a CommonJS app can keep doingconst { SwaggerModule } = require('@nestjs/swagger'). The CLI plugin entry (@nestjs/swagger/plugin) also keeps arequirecondition sonest-cli.jsonsetups load it unchanged.This is why the package now declares
"engines": { "node": "^20.19.0 || >=22.12.0" }— those are the Node versions whererequire(esm)is available without a flag.Nest 12 peer dependencies
@nestjs/commonand@nestjs/corepeers are now^12.0.0.@nestjs/mapped-typesmoves to12.0.0(itself ESM, with its major aligned to the Nest 12 line), soPartialType,PickType,OmitTypeandIntersectionTypecome from an ESM build too.Standard Schema support
Schemas passed to Nest 12's route decorators (for example
@Body({ schema: z.object({ ... }) })) can now be reflected into the OpenAPI document. Supply an adapter via the newstandardSchemaConverterdocument option:SwaggerDocumentOptions,StandardSchemaConverterandStandardSchemaConversionResultare all exported from@nestjs/swagger;createSchemacomes from[zod-openapi](https://www.npmjs.com/package/zod-openapi)(for Valibot, usetoJsonSchemafrom@valibot/to-json-schemawithtarget: 'openapi-3.0'and check for the'valibot'vendor instead). Neither is a dependency of this package — install whichever converter matches the schema library you use.The callback receives the raw schema value plus whether an
inputoroutputschema is wanted, so you can narrow to library-specific types without unsafe casts, and return extracomponentsto register. Returningundefinedfalls back to the DTO-derived schema, so one converter can handle several libraries and ignore the rest. Standard Schema overrides apply to bodies, queries, params, unions and enums, and take priority over the DTO-derived schema.Breaking: nullability is spelled per document version
Nullable schemas are now normalized once on the finished document, matching the version it declares:
nullablekeyword (removed in JSON Schema 2020-12) is gone. Typed schemas become a type union (type: ['string', 'null']), enums gain anullvalue, and references and composite schemas becomeanyOf: [<schema>, { type: 'null' }]. The 3.0type: 'object'+allOfwrapper around nullable references is unwrapped. Previously these documents carriednullable, which strict 3.1 consumers silently ignore — reading the property as non-nullable.nullablekeyword (with theallOfwrapper for references). Since #3897 they emittedoneOf: [<schema>, { type: 'null' }], atype: 'null'that 3.0 does not define.The pass covers schema properties, parameters, headers, request bodies, responses, callbacks and webhooks, plus any
nullableyou wrote by hand. Free-form positions (example,examples,default,const,enum) andx-extensions are left alone. Snapshot tests assertingnullable: truein 3.1 documents, oroneOfin 3.0 responses, will need updating.Closes #4063.
Breaking: lodash replaced with es-toolkit
lodashis no longer a runtime dependency — internals usees-toolkit/compat. This shrinks the install footprint and only affects you if you relied on lodash arriving transitively.CLI plugin
esmCompatibleis now auto-detected per file. The plugin resolves each source file's implied module format (viapackage.jsontypeand themodulesetting) and emits ESM-compatible output for ESM projects. SettingesmCompatibleexplicitly innest-cli.jsonstill wins — the resolved value is only used when you left it unset. Fixes generated imports in ESM projects that previously got CJS-shaped output.@paramtags now become descriptions. WithintrospectCommentson, a@paramtag is matched to the route parameter by name and sets the description on the generated@ApiQuery/@ApiParam. Existing explicit@ApiQuery/@ApiParamdecorators are left untouched. Closes #2784.requireexport condition was added for the plugin entry so CJS-based CLI setups keep working. Fixes #3944.Upgrading
For most apps the upgrade is: bump
@nestjs/swaggerto^12.0.0alongside Nest 12, make sure you are on Node 20.19+ / 22.12+, and re-check any committed OpenAPI snapshot for the nullable spelling above.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.