{"id":16149199,"url":"https://github.com/nicofuma/swaggerbundle","last_synced_at":"2026-03-12T19:14:04.937Z","repository":{"id":57026779,"uuid":"66479652","full_name":"Nicofuma/SwaggerBundle","owner":"Nicofuma","description":"A bundle integrating swagger to validate Requests and Responses","archived":false,"fork":false,"pushed_at":"2017-02-06T14:13:32.000Z","size":218,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T18:50:04.903Z","etag":null,"topics":["behat","bundle","php","swagger","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nicofuma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-24T16:13:54.000Z","updated_at":"2020-11-01T19:51:36.000Z","dependencies_parsed_at":"2022-08-23T16:11:06.868Z","dependency_job_id":null,"html_url":"https://github.com/Nicofuma/SwaggerBundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Nicofuma/SwaggerBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicofuma%2FSwaggerBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicofuma%2FSwaggerBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicofuma%2FSwaggerBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicofuma%2FSwaggerBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nicofuma","download_url":"https://codeload.github.com/Nicofuma/SwaggerBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicofuma%2FSwaggerBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263314159,"owners_count":23447294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["behat","bundle","php","swagger","symfony","symfony-bundle"],"created_at":"2024-10-10T00:37:29.803Z","updated_at":"2026-03-12T19:14:04.887Z","avatar_url":"https://github.com/Nicofuma.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"NicofumaSwaggerBundle\n===============\n\n[![Latest Stable Version](https://poser.pugx.org/nicofuma/swagger-bundle/v/stable.png)](https://packagist.org/packages/nicofuma/swagger-bundle \"Latest Stable Version\")\n[![Latest Unstable Version](https://poser.pugx.org/nicofuma/swagger-bundle/v/unstable.png)](https://packagist.org/packages/nicofuma/swagger-bundle \"Latest Unstable Version\")\n[![License](https://poser.pugx.org/nicofuma/swagger-bundle/license)](https://packagist.org/packages/nicofuma/swagger-bundle)\n[![Travis Build Status](https://api.travis-ci.org/Nicofuma/SwaggerBundle.png?branch=master)](https://travis-ci.org/Nicofuma/SwaggerBundle \"Build status\")\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c960afc9-f67d-464b-9c0a-351864e86e7e/mini.png)](https://insight.sensiolabs.com/projects/c960afc9-f67d-464b-9c0a-351864e86e7e \"SensioLabsInsight\")\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Nicofuma/SwaggerBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Nicofuma/SwaggerBundle/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/Nicofuma/SwaggerBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Nicofuma/SwaggerBundle/?branch=master)\n\nDescription\n-----------\n\nThis bundle integrates [Swagger](http://swagger.io/) in Symfony.\n\nCurrently, it supports the following features:\n - Automatic validation of all incoming requests based on the Swagger definition (including headers and query string)\n - Configuring multiple API with different swagger files using configuration\n - FOSRestBundle integration: automatic configuration of the ParamFetcher\n - Behat integration: context to validate the response\n\nInstallation\n------------\n\nAdd the required package using composer.\n\n### Stable version\n\n```bash\ncomposer require nicofuma/swagger-bundle:^1.0\n```\n\n### Bleeding-edge version\n\n```bash\ncomposer require nicofuma/swagger-bundle:@dev\n```\n\n### Enabling the bundle\n\nAdd the bundle to your AppKernel.\n\n```php\n// in %kernel.root_dir%/AppKernel.php\n$bundles = array(\n    // ...\n    new Nicofuma\\SwaggerBundle\\NicofumaSwaggerBundle(),\n    // ...\n);\n```\n\nConfiguration\n-------------\n\n```yml\nnicofuma_swagger:\n    definition:\n        pattern: '/api/v1'\n        swagger_file: swagger/swagger.json\n        strict: true\n```\n\n`pattern` any url matching this pattern will be tested against the `swagger_file`\n`swagger_file` swagger file to use for this API. Can be either an bsolute path, a path relative to `%kernel.root_dir%/Resources/` or a bundle resource `@MyBundle/Dir/swagger.json`\n`strict` whether or not an exception must be thrown if the path does not match any definition in the swagger file\n\nConfiguration reference\n-----------------------\n\n```yml\n# Default configuration for extension with alias: \"swagger\"\nnicofuma_swagger:\n    definitions:\n        -\n            pattern:\n                # use the urldecoded format\n                path:                 ^/api/public/\n                host:                 null\n                ips:                  []\n                methods:              []\n            swagger_file:         swagger-public.json\n            strict:               true\n        -\n            pattern:\n                # use the urldecoded format\n                path:                 ^/api/private/\n                host:                 null\n                ips:                  []\n                methods:              []\n            swagger_file:         swagger-private.json\n            strict:               true\n\n```\n\nBehat integration\n-----------------\n\nAdd the following context in your behat.yml file\n```\n- Nicofuma\\SwaggerBundle\\Tests\\Behat\\Context\\SwaggerContext: {map: '@swagger.validator_map'}\n```\n\nContributing\n------------\n\nNicofumaSwaggerBundle is an open source project. If you'd like to contribute, please do.\n\nLicense\n-------\n\nThis library is under the MIT license. For the full copyright and license information, please view the [LICENSE]() file that was distributed with this source code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicofuma%2Fswaggerbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicofuma%2Fswaggerbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicofuma%2Fswaggerbundle/lists"}