PHPackages                             cm2-tech/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. cm2-tech/swagger-bundle

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

cm2-tech/swagger-bundle
=======================

Reusable Symfony bundle for generating OpenAPI (Swagger) JSON output with basic protection

1.0.8(1y ago)0152MITPHPPHP &gt;=8.1

Since May 27Pushed 1y agoCompare

[ Source](https://github.com/CM2-Tech/swagger-bundle)[ Packagist](https://packagist.org/packages/cm2-tech/swagger-bundle)[ RSS](/packages/cm2-tech-swagger-bundle/feed)WikiDiscussions master Synced today

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

CM2 Swagger Bundle
==================

[](#cm2-swagger-bundle)

Bundle para gerar e servir automaticamente a documentação OpenAPI (`swagger.json`) com base em anotações do pacote [`zircote/swagger-php`](https://github.com/zircote/swagger-php), para projetos Symfony.

Instalação
----------

[](#instalação)

1. Adicione o bundle via `composer`:

composer require cm2-tech/swagger-bundle:^1.0

2. Habilite o bundle (se necessário):

Symfony Flex já deve fazer isso automaticamente. Caso contrário, edite config/bundles.php:

return \[ // ... CM2\\SwaggerBundle\\CM2SwaggerBundle::class =&gt; \['all' =&gt; true\], \];

3. Adicione a variável de ambiente SWAGGER\_TOKEN no seu arquivo .env ou .env.local:

SWAGGER\_TOKEN=seu\_token\_secreto

Esta variável é obrigatória para proteger o acesso ao endpoint /\_swagger. Sem ela, o acesso será negado.

4. Importe os endpoints do bundle, só tem 1 (/\_swagger):

swagger\_bundle: resource: '@SwaggerBundle/Controller/' type: annotation

5. O controller precisa de argumentos, importe-os no services.yaml:

services: CM2\\SwaggerBundle\\Controller\\SwaggerController: arguments: $sources: - '%kernel.project\_dir%/src/Controller' - '%kernel.project\_dir%/src/Entity' tags: \['controller.service\_arguments'\]

Uso
---

[](#uso)

Acesse a URL:

/\_swagger?token=seu\_token\_secreto

Ela retornará o conteúdo do swagger.json com base nas anotações presentes em:

- src/Controller
- src/Entity

Requisitos
----------

[](#requisitos)

- PHP &gt;= 8.1
- Symfony &gt;= 6.4
- zircote/swagger-php

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance46

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~0 days

Total

9

Last Release

401d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56365681?v=4)[cm2tech](/maintainers/cm2tech)[@cm2tech](https://github.com/cm2tech)

### Embed Badge

![Health badge](/badges/cm2-tech-swagger-bundle/health.svg)

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

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k67.4M263](/packages/nelmio-api-doc-bundle)[sylius/sylius

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

8.5k5.9M736](/packages/sylius-sylius)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M134](/packages/darkaonline-l5-swagger)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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