# zircote/swagger-php

A php swagger annotation and parsing library

Repository: https://github.com/zircote/swagger-php
Canonical: https://ross.abutalabs.com/products/swagger-php
Homepage: http://zircote.github.io/swagger-php/
Language: PHP
License: Apache-2.0
License Family: permissive
Last push: 2026-08-26T20:45:15+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 5275, "days_push": 7, "days_rel": 9, "gap_med": 6.0, "n_releases_24m": 65}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5306, forks 937 (observed 2026-08-28T04:09:15.366513+00:00)

## What it is
A PHP library that generates OpenAPI (Swagger) documentation for RESTful APIs using PHP 8 attributes or legacy doctrine annotations embedded in source code. It supports OpenAPI 3.0, 3.1, and 3.2 specs and can be used programmatically or via a command-line tool.

## Use cases
- generate OpenAPI documentation from PHP source code
- document a RESTful API with PHP attributes
- produce swagger. or openapi.yaml specs for a PHP API
- keep API docs in sync with code via docblock annotations
- generate OpenAPI 3.1 specs from a PHP codebase
- add interactive API documentation to a PHP backend

## When to choose
- you maintain a PHP REST API and want OpenAPI docs generated from the code itself
- you want documentation colocated with controllers using PHP 8 attributes
- you need CLI or programmatic generation of OpenAPI 3.0/3.1/3.2 specs

## When to avoid
- your API is not written in PHP
- you prefer writing OpenAPI specs by hand or from a design-first workflow
- you rely on doctrine annotations without wanting an extra dependency (attributes are preferred)

## Facets
- artifact type: library
- maturity: active
- function: api-framework, documentation, parser, cli
- domain: apis, documentation, web-development, developer-tools
- platform: php, cli, cross-platform
- tags: openapi, swagger, api-docs, php-attributes, rest-api

## Member repositories
- zircote/swagger-php (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:15.366513+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-29T17:59:00.290510+00:00, confidence not recorded.
  - readme: https://github.com/zircote/swagger-php (fetched 2026-08-28T04:09:15.366513+00:00, sha 4ffc4217bf0e)
  - homepage: http://zircote.github.io/swagger-php/ (fetched 2026-08-29T08:53:47.237642+00:00, sha 0bd38952c289)
- Data as of 2026-08-30T08:39:29.467469+00:00.
