# fastify/fastify-swagger

Swagger documentation generator for Fastify

Repository: https://github.com/fastify/fastify-swagger
Canonical: https://ross.abutalabs.com/products/fastify-swagger
Homepage: https://npmjs.com/package/@fastify/swagger
Language: JavaScript
License: MIT
License Family: permissive
Topics: fastify, swagger, documentation, fastify-plugin
Last push: 2026-09-02T06:16:03+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 93, longevity 100
- inputs: {"age_days": 3441, "days_push": 0, "days_rel": 51, "gap_med": 28.5, "n_releases_24m": 15}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1092, forks 219 (observed 2026-09-03T02:15:11.857634+00:00)

## What it is
A Fastify plugin that automatically generates and serves Swagger (OpenAPI v2) or OpenAPI v3 schemas from your route schemas or an existing spec. It pairs with UI plugins like @fastify/swagger-ui to serve interactive API documentation.

## Use cases
- generate openapi spec from fastify routes
- serve swagger documentation for a nodejs api
- auto-generate api docs from json schemas
- publish openapi v3 schema for a rest api
- document fastify endpoints with swagger
- expose swagger json endpoint for codegen

## When to choose
- you use Fastify and want API docs generated from route schemas
- you need OpenAPI v2 or v3 output for clients or tooling
- you want a spec-first or schema-first documentation workflow in Node.js

## When to avoid
- you use Express, Koa, or another non-Fastify framework
- you want a built-in Swagger UI - use @fastify/swagger-ui alongside it
- you need to generate routes from an existing OpenAPI schema - use fastify-openapi-glue

## Facets
- artifact type: plugin
- maturity: active
- function: api-documentation, documentation, middleware, plugin-system
- domain: web-development, backend, apis, documentation, developer-tools
- platform: -
- tags: fastify, swagger, openapi, openapi-v3, api-specs, route-schemas, nodejs, web-server, javascript

## Member repositories
- fastify/fastify-swagger (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:11.857634+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:49:07.893175+00:00, confidence not recorded.
  - readme: https://github.com/fastify/fastify-swagger (fetched 2026-09-03T02:15:11.857634+00:00, sha 498eb9bb7bd1)
  - homepage: https://npmjs.com/package/@fastify/swagger (fetched 2026-08-29T12:51:14.523159+00:00, sha 9672c60cfa22)
  - registry_npm: https://registry.npmjs.org/fastify-swagger (fetched 2026-08-29T12:51:14.563933+00:00, sha 63ce72335858)
- Data as of 2026-08-30T08:39:29.467469+00:00.
