Originally created by: dependabot[bot]
Bumps @nestjs/swagger from 8.1.1 to 12.0.1.
Sourced from @nestjs/swagger's releases.
Release 12.0.1
12.0.1 (2026-08-28)
Bug fixes
- #4082](https://github.com/href="https://redirect.github.com/nestjs/swagger/pull/4082">/issues/4082) fix: esm hoist static imports (
@kamilmysliwiec)Dependencies
- #4077](https://github.com/href="https://redirect.github.com/nestjs/swagger/pull/4077">/issues/4077) chore(deps): update dependency swagger-ui-dist to v5.32.14 (
@renovate[bot])Committers: 1
- Kamil Mysliwiec (
@kamilmysliwiec)Release 12.0.0
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:import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import type { SwaggerDocumentOptions } from '@nestjs/swagger'; import { createSchema } from 'zod-openapi'; import type { ZodType } from 'zod';
// Standard Schema exposes the producing library under~standard.vendor, // which is how you narrow the raw value to a library-specific type. function isZodSchema(schema: unknown): schema is ZodType { return ( !!schema && typeof schema === 'object' && (schema as { '~standard'?: { vendor?: string } })['~standard']?.vendor === 'zod' ); </tr></table>
... (truncated)
4274e7c chore(): release v12.0.1325d009 Merge pull request #4082](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4082">/issues/4082) from nestjs/fix/esm-hoist-static-imports8980a54 fix: esm hoist static imports31b0bf4 chore(deps): update dependency lint-staged to v17.4.1 (#4078](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4078">/issues/4078))b71a812 Merge pull request #4077](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4077">/issues/4077) from nestjs/renovate/swagger-ui-dist-5.x-lockfileec18a13 chore(deps): update dependency swagger-ui-dist to v5.32.140f85b4c Merge pull request #4072](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4072">/issues/4072) from nestjs/renovate/js-yaml-5.x7d8b38e Merge pull request #4076](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4076">/issues/4076) from nestjs/renovate/vite-8.x-lockfileebc4cb8 Merge pull request #4069](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4069">/issues/4069) from nestjs/renovate/zod-openapi-6.x71e1769 Merge pull request #4068](https://github.com/href="https://redirect.github.com/nestjs/swagger/issues/4068">/issues/4068) from nestjs/renovate/swagger-ui-dist-5.xThis version adds prepare script that runs during installation. Review the package contents before updating.