@fastify/swagger is a Fastify plugin that serves Swagger (OpenAPI v2) or OpenAPI v3 schemas. It can auto-generate documentation from your route schemas in dynamic mode, or serve an existing Swagger/OpenAPI schema in static mode. It is useful for adding Swagger/OpenAPI docs to Fastify APIs, including via front ends like swagger-ui integrations.
Project status
- Actively maintained, with recent
updatesas of 2026-08-06 (upstream push on 2026-08-06, plus packageupdatesin July 2026), indicating ongoing work rather than dormancy. - Update cadence appears moderately frequent recently, with
v9.8.0on 2026-07-08,v9.8.1on 2026-07-13, then a longer gap tov9.7.0on 2026-02-07, suggesting active development with occasional pauses.
AI summary generated
Recent updates
v9.8.1
v9.8.1 is a small patch release focused on reducing the number of Fastify onReady hooks used to collect schemas. The code changes consolidate per-instance schema aggregation into a single top-level onReady pass.
v9.8.0
v9.8.0 focuses on improving OpenAPI generation, specifically adding proper handling for JSON Schema file-like fields using `contentEncoding` in multipart uploads. The release also includes internal maintenance updates (CI/workflows, dependabot config, stale/lock-threads) and a dev tooling migration from `tsd` to `tstyche` for type tests.
v9.7.0
v9.7.0 focuses on OpenAPI output correctness and some repository chores, including faster checks and test workflow adjustments. The main behavioral changes ensure requestBody.required is always true when schema.body exists, and that required query parameters are preserved correctly, including through $ref resolution.
Breakingv9.6.1
Release v9.6.1 makes a small TypeScript typing correction related to the `convertConstToEnum` option. The code changes primarily affect `index.d.ts` and update the type tests to match the corrected option shape.
v9.6.0
v9.6.0 introduces configurability for how JSON Schema `const` keywords are represented in generated OpenAPI documents. It also bumps some dev tooling dependencies and adds CI workflow concurrency cancellation behavior.
Featuresv9.5.2
v9.5.2 is primarily a maintenance release focused on CI/test stability, cleanup/refactors, and dev dependency bumps. It also changes OpenAPI schema generation behavior around handling `$ref` objects.
v9.5.1
v9.5.1 primarily updates development tooling dependencies and includes two bug fixes: it prevents mutation of response header schemas during OpenAPI generation, and it corrects TypeScript types for route configuration regarding Swagger options. The diff shows small, targeted changes with only dependency bumps and test coverage additions.
v9.5.0
v9.5.0 primarily updates TypeScript typings for fastify-swagger by exporting the Swagger transform types. The rest of the changes are README and CI workflow adjustments.
Featuresv9.4.2
v9.4.2 makes two non-code changes, updating Dependabot to run npm dependency checks monthly and bumping the json-schema-resolver dependency. The package version is also updated from 9.4.1 to 9.4.2. No application source code changes are present in this diff.
v9.4.1
v9.4.1 is a small release with mainly internal refactors, test infrastructure changes (tap to node:test), and dev tooling updates (neostandard/ESLint). The diff also contains TypeScript declaration changes, including additions to dynamic plugin options and removal of some exported UI-related types.
Breaking