Invert your workflow (contract first) using Swagger (Open API) specs and set up a Symfony REST app with minimal config.
Aimed to be lightweight, this bundle does not depend on FOSRestBundle or Twig.
SwaggerBundle is built around the idea of "contract first". Other "Swagger Bundles" see an OpenAPI definition as documentation, that you generate using config and annotations.
We say your OpenAPI definition is your config, and strive towards 'minimal additional config'. At the core, SwaggerBundle does three things:
- Configure Symfony Routing
- Validate input
- Coerce/transform in- and output
- Create a Swagger file, for example using http://editor.swagger.io/.
- Install and configure this bundle
- Create one or more controllers (as services), doing the actual work, whatever that may be.
- Installation and configuration
- Routing
- Controllers
- Errors and validation
- Serialization
- Responses
- Caching
- API Development
- Contributing
- Will SwaggerBundle do
x
?
If x
is any of these, the answer will probably stay 'no':
- Handle Form posts.
- Generate API documentation.
- Mix well with GUI bundles. The bundle is biased towards lightweight API-only apps.
- Support XML.
For a pretty complete example, see swagger-bundle-example. A minimal example is also available.
This bundle is currently actively maintained. Go to the release page to find details about the latest release.
KleijnWeb\SwaggerBundle is made available under the terms of the LGPL, version 3.0.