PHPackages                             mijohansen/slim-swagger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mijohansen/slim-swagger

ActiveLibrary[API Development](/categories/api)

mijohansen/slim-swagger
=======================

Simpler way to hook a swagger api into slim-framework.

0.0.5(7y ago)7641MITPHPPHP &gt;=7.0

Since Nov 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mijohansen/php-slim-swagger)[ Packagist](https://packagist.org/packages/mijohansen/slim-swagger)[ RSS](/packages/mijohansen-slim-swagger/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (7)Used By (0)

php-slim-swagger
================

[](#php-slim-swagger)

Slim needs a simpler way to define an Swagger API. No docblock magic, just code.

This project is at an early stage. Functionality will break.

Usage
-----

[](#usage)

### Adding the dependencies to the container

[](#adding-the-dependencies-to-the-container)

You need to override the router and add the swagger liberary to Slim. A clean way of doing this is BEFORE the $app object is initiated.

Minimal example:

```
use Slim\App;
use SlimSwagger\SlimSwagger;

$container = SlimSwagger::init();
$app = new App($container);
```

### Installing the swagger route:

[](#installing-the-swagger-route)

```
use SlimSwagger\SwaggerAction;

$app->get('/swagger.json', SwaggerAction::class);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

2726d ago

PHP version history (2 changes)0.0.1PHP &gt;=7.1

0.0.3PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7bbaac8c405bc506a2e4d91cb8b62f335dfffdebff9be6c7798902f469b2274?d=identicon)[mijohansen](/maintainers/mijohansen)

---

Top Contributors

[![mijohansen](https://avatars.githubusercontent.com/u/589907?v=4)](https://github.com/mijohansen "mijohansen (4 commits)")

---

Tags

swaggerslim

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mijohansen-slim-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/mijohansen-slim-swagger/health.svg)](https://phpackages.com/packages/mijohansen-slim-swagger)
```

###  Alternatives

[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)[psx/api

Parse and generate API specification formats

37178.0k4](/packages/psx-api)[wapmorgan/openapi-generator

OpenApi configuration generator directly from PHP code (PhpDoc, functions signature and type hints) and projects (for yii2, slim, laravel). Can be used with a large monolithic backend to maintain big API documentation

202.8k](/packages/wapmorgan-openapi-generator)[scrumptious/slagger

Slim middleware for generating Swagger json for use with Swagger UI

101.2k](/packages/scrumptious-slagger)[digit-soft/laravel-swagger-generator

Swagger yaml generator

158.0k](/packages/digit-soft-laravel-swagger-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
