zircote/swagger-php

A php swagger annotation and parsing library

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 11 minutes ago
Added to GitGenius on September 12th, 2026
Created on March 24th, 2012
Open Issues & Pull Requests: 22 (+0)
GitHub issues: Enabled
Number of forks: 937
Total Stargazers: 5,309 (+0)
Total Subscribers: 92 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 13.3 hours
Mean response time: 18.4 days
90th percentile: 52.0 days
Tracked items: 147

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 12% of issues opened in the past year have been closed. Three people close 86% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 12
New in 7 days: 2
Closed in 7 days: 2
Avg open age: 626 days
Stale 30+ days: 10
Stale 90+ days: 9

Recent activity

Opened in 7 days: 2
Closed in 7 days: 2
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (39)
  • bug (20)
  • question (20)
  • type handling (17)
  • documentation (16)
  • OpenApi 3.1.0 (4)
  • wontfix (1)

Detailed Description

Swagger-php is a PHP library that generates OpenAPI documentation from PHP attributes or doctrine annotations.

The tool solves the problem of keeping API documentation in sync with code by extracting metadata directly from PHP source files. Developers annotate their classes, methods, and other structural elements with OpenAPI attributes or doctrine annotations, and the library parses these annotations to generate a complete OpenAPI specification. The library supports OpenAPI 3.0, 3.1, and 3.2 specifications and can resolve complex types using the symfony/type-info library. It offers both programmatic and command-line interfaces for generating documentation as static YAML or JSON files.

Teams should adopt this tool if they maintain RESTful APIs in PHP and want documentation that stays current with code changes. It works well for projects where developers are already familiar with PHP attributes or annotations. The tool requires PHP 8.2 or later. Doctrine annotations are now optional and must be installed separately if needed. The library includes a beta spec attributes pipeline that provides an alternative processing mode with typed data transfer objects and version-aware compilers, available through hybrid mode for gradual migration from existing code.

The project maintains active development with regular updates to support new OpenAPI versions and PHP features. The codebase includes comprehensive error reporting with hints and context to guide users through configuration issues. A beta processing pipeline demonstrates ongoing architectural evolution, offering users an optional path to modernized internals without requiring immediate migration. The tool provides both classic and hybrid processing modes, allowing teams to adopt new features incrementally alongside existing implementations.