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

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

kleijnweb/swagger-bundle
========================

Makes your Swagger definition into a routing and validation spec

v3.1.8(7y ago)2416.3k↓50%9[4 PRs](https://github.com/kleijnweb/swagger-bundle/pulls)LGPL-3.0PHPPHP &gt;=5.4.0

Since Sep 14Pushed 2y ago3 watchersCompare

[ Source](https://github.com/kleijnweb/swagger-bundle)[ Packagist](https://packagist.org/packages/kleijnweb/swagger-bundle)[ RSS](/packages/kleijnweb-swagger-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (31)Versions (24)Used By (0)

This project is no longer maintained
====================================

[](#this-project-is-no-longer-maintained)

KleijnWeb\\SwaggerBundle
========================

[](#kleijnwebswaggerbundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/ee68f667885931851ce125eb3c190f40b439cd88cecb844c368b31b665d68944/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64636430333637612d303337312d343433612d623235382d3563393335366362633935332f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/dcd0367a-0371-443a-b258-5c9356cbc953)

[![Build Status](https://camo.githubusercontent.com/da319c84a98642262e0b4e882e3545cc20493813cbc4f82026c85e1a9b179251/68747470733a2f2f7472617669732d63692e6f72672f6b6c65696a6e7765622f737761676765722d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kleijnweb/swagger-bundle)[![Coverage Status](https://camo.githubusercontent.com/90e09b1dc456270bf7ae88958d8eee7e623bd3b0d1f9661f7f164515ad1bd0dd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b6c65696a6e7765622f737761676765722d62756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/kleijnweb/swagger-bundle?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e2b62a97cf378b1a490698945b43f50732daf5f51681a9c79fc74ee1fa7f24c0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6c65696a6e7765622f737761676765722d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kleijnweb/swagger-bundle/?branch=master)[![Latest Unstable Version](https://camo.githubusercontent.com/89c4b8fbd0ba63adf385e0dfd8552e23e3c27c34c029b93aed3ed50cea1a44b8/68747470733a2f2f706f7365722e707567782e6f72672f6b6c65696a6e7765622f737761676765722d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/kleijnweb/swagger-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/c67c36d62a791651f34b3906891be7a64a7804ffd045e8fbfcf9735a9c07f760/68747470733a2f2f706f7365722e707567782e6f72672f6b6c65696a6e7765622f737761676765722d62756e646c652f762f737461626c65)](https://packagist.org/packages/kleijnweb/swagger-bundle)

Invert your workflow (contract first) using Swagger ([Open API](https://openapis.org/)) specs and set up a Symfony REST app with minimal config.

Aimed to be lightweight, this bundle does not depend on FOSRestBundle or Twig.

**HEADS UP:** *You are looking at the main (4.0 BETA) development line, which is PHP 7 only. SwaggerBundle 3.x is stable, maintained, and works with PHP 5.4+.*

For a working example, check out .

Contract First
--------------

[](#contract-first)

We say your OpenAPI definition *is* your config, and strive towards 'minimal additional config'. At the core, SwaggerBundle does three things:

1. Configure Symfony routing
2. Validate input
3. Coerce/transform in- and output

Usage
-----

[](#usage)

1. Create an OpenAPI document, for example using .
2. Install and configure this bundle
3. Create one or more controllers (as services)

Check out the [User Documentation](docs.md) for more details.

What's new in 4.0?
------------------

[](#whats-new-in-40)

SwaggerBundle 4.0 is currently in the beta stage. Much of the behavior dealing with OpenAPI documents has been moved to [KleijnWeb\\PhpApi\\Descriptions](https://github.com/kleijnweb/php-api-descriptions).

### Routing

[](#routing)

Now using [kleijnweb/php-api-routing-bundle](https://github.com/kleijnweb/php-api-routing-bundle) with a number of small improvements.

### Security Integration

[](#security-integration)

Request matching, voting, OpenAPI configured RBAC. See [docs](docs.md#security).

### Serialization/Hydration

[](#serializationhydration)

Support for 3rd party serializers has been replaced by a new *API Description Based* (de-)hyrator. Hydrating of untyped data is expected to be `stdClass|stdClass[]`, not a combination of arrays and associative arrays as was the `
