PHPackages                             stfalcon-studio/swagger-bundle - 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. stfalcon-studio/swagger-bundle

ActiveSymfony-bundle[API Development](/categories/api)

stfalcon-studio/swagger-bundle
==============================

Generate Swagger UI documentation from local files

v2.0.0(3mo ago)647.9k—1.9%2[1 PRs](https://github.com/stfalcon-studio/SwaggerBundle/pulls)MITPHPPHP &gt;=8.2CI passing

Since Apr 4Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/stfalcon-studio/SwaggerBundle)[ Packagist](https://packagist.org/packages/stfalcon-studio/swagger-bundle)[ Docs](https://github.com/stfalcon-studio/swagger-bundle)[ RSS](/packages/stfalcon-studio-swagger-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (27)Used By (0)

SwaggerBundle
=============

[](#swaggerbundle)

📦 Creates a [Swagger-ui](https://github.com/wordnik/swagger-ui) page (something like [this](https://petstore.swagger.io/)) in Symfony application.

Description
-----------

[](#description)

If you’re writing a Swagger API spec and it’s becoming too large, you can split it into multiple files. This bundle allows a simple way to split specification files and generate static `index.html` with Swagger UI.

Installation
------------

[](#installation)

`composer req stfalcon-studio/swagger-bundle`

### Check the `config/bundles.php` file

[](#check-the-configbundlesphp-file)

By default Symfony Flex will add SwaggerBundle to the `config/bundles.php` file. But in case when you ignored `contrib-recipe` during bundle installation it would not be added. In this case add the bundle manually.

```
# config/bundles.php

return [
    // other bundles
    StfalconStudio\SwaggerBundle\SwaggerBundle::class => ['all' => true],
    // other bundles
];
```

Using
-----

[](#using)

First all we need to set up the folder where the spec is be storing. This is the base folder relative for which we will structure the specification files.

```
swagger:
    config_folder: '%kernel.project_dir%/docs/api/'
```

Imagine you have a Swagger spec like this:

```
openapi: "3.0.0"
info:
  title: Simple API overview
  version: 2.0.0
paths:
  "/users":
    get:
      operationId: CreateUser
      summary: Create user
      responses:
        '201':
          description: |-
            201 response
  "/orders":
    post:
      operationId: CreateOrder
      summary: Create Order
      responses:
        '201':
          description: |-
            201 response
```

Here is our desired folder structure:

```
/docs/api/
     ├── index.yaml
     ├── paths
     │   └── user
     |       └── create-user.yaml
     │   └── order
     |       └── create-order.yaml
     ├── responses
     │   └── created.yaml
```

Root file is `index.yaml`. Using `index.yaml` as file name for your root file is a convention.

Here is list of files with their contents:

### index.yaml

[](#indexyaml)

```
openapi: "3.0.0"
info:
  title: Simple API overview
  version: 2.0.0
paths:
  "$paths"
```

### paths/user/create-user.yaml

[](#pathsusercreate-useryaml)

```
"/users":
  get:
    operationId: CreateUser
    summary: Create user
    responses:
      "$responses/created.yaml"
```

### paths/order/create-order.yaml

[](#pathsordercreate-orderyaml)

```
"/orders":
  post:
    operationId: CreateOrder
    summary: Create Order
    responses:
      "$responses/created.yaml"
```

### paths/responses/created.yaml

[](#pathsresponsescreatedyaml)

```
'201':
  description: |-
    201 response
```

As you can see from the example, in order to specify a folder or file for the include we use the symbol `$` and name.

- `$paths` - include all `.yaml` files from folder `paths` (recursively);
- `$responses/created.yaml` - include the file `created.yaml` that storing in `responses` folder.

Generate Swagger UI
-------------------

[](#generate-swagger-ui)

For generating Swagger UI static file use console command:

```
bin/console assets:install && bin/console swagger:generate-docs
```

The file will be saved in the `%kernel.publid_dic%/public/api/index.html` folder and shared at `http:///api/index.html`.

Contributing
------------

[](#contributing)

Read the [CONTRIBUTING](https://github.com/stfalcon-studio/SwaggerBundle/blob/master/.github/CONTRIBUTING.md) file.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance80

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.8% 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 ~104 days

Recently: every ~188 days

Total

25

Last Release

103d ago

Major Versions

v0.15.0 → v1.0.02024-02-11

v1.1.1 → v2.0.02026-02-04

PHP version history (7 changes)v0.1.0PHP ^7.0

v0.2.0PHP ^7.1

v0.4.0PHP ^7.2.5

v0.5.0PHP &gt;=7.3

0.9.0PHP &gt;=7.4

0.11.0PHP &gt;=8.1

v1.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/159215?v=4)[Stepan Tanasiychuk](/maintainers/stfalcon)[@stfalcon](https://github.com/stfalcon)

![](https://avatars.githubusercontent.com/u/815865?v=4)[Artem Henvald](/maintainers/fre5h)[@fre5h](https://github.com/fre5h)

![](https://www.gravatar.com/avatar/52ac157d7ad90620e4f2fc4b01c5f6c3de7669b95ae5bd3e07418beb7254d804?d=identicon)[wbrframe](/maintainers/wbrframe)

---

Top Contributors

[![fre5h](https://avatars.githubusercontent.com/u/815865?v=4)](https://github.com/fre5h "fre5h (30 commits)")[![rela589n](https://avatars.githubusercontent.com/u/41589422?v=4)](https://github.com/rela589n "rela589n (1 commits)")[![wbrframe](https://avatars.githubusercontent.com/u/4079553?v=4)](https://github.com/wbrframe "wbrframe (1 commits)")

---

Tags

bundleopenapiswaggerswagger-uisymfonysymfonybundleswaggeropenapi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stfalcon-studio-swagger-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/stfalcon-studio-swagger-bundle/health.svg)](https://phpackages.com/packages/stfalcon-studio-swagger-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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