{"id":15287294,"url":"https://github.com/stfalcon-studio/swaggerbundle","last_synced_at":"2025-11-06T19:04:02.566Z","repository":{"id":37818425,"uuid":"179246704","full_name":"stfalcon-studio/SwaggerBundle","owner":"stfalcon-studio","description":":package: Creates a Swagger-ui page in Symfony application.","archived":false,"fork":false,"pushed_at":"2024-05-31T15:55:02.000Z","size":607,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-13T05:08:20.325Z","etag":null,"topics":["bundle","openapi","swagger","swagger-ui","symfony"],"latest_commit_sha":null,"homepage":"","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/stfalcon-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-03T08:36:23.000Z","updated_at":"2024-06-29T09:04:01.000Z","dependencies_parsed_at":"2024-01-12T13:26:11.845Z","dependency_job_id":"46a6a44d-76f7-4601-ba2c-32d143881bdc","html_url":"https://github.com/stfalcon-studio/SwaggerBundle","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"19d0c91d22cd958209cf71a6e5985f0de070a950"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FSwaggerBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FSwaggerBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FSwaggerBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FSwaggerBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stfalcon-studio","download_url":"https://codeload.github.com/stfalcon-studio/SwaggerBundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665747,"owners_count":21142123,"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":["bundle","openapi","swagger","swagger-ui","symfony"],"created_at":"2024-09-30T15:27:29.571Z","updated_at":"2025-11-06T19:03:57.529Z","avatar_url":"https://github.com/stfalcon-studio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwaggerBundle\n\n:package: Creates a [Swagger-ui](https://github.com/wordnik/swagger-ui) page (something like [this](https://petstore.swagger.io/)) in Symfony application.\n\n## Description\n\nIf you’re writing a Swagger API spec and it’s becoming too large, you can split it into multiple files.\nThis bundle allows a simple way to split specification files and generate static `index.html` with Swagger UI.\n\n\n## Installation\n\n```composer req stfalcon-studio/swagger-bundle```\n\n### Check the `config/bundles.php` file\n\nBy 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.\n\n```php\n# config/bundles.php\n\nreturn [\n    // other bundles\n    StfalconStudio\\SwaggerBundle\\SwaggerBundle::class =\u003e ['all' =\u003e true],\n    // other bundles\n];\n```\n\n## Using\n\nFirst all we need to set up the folder where the spec is be storing.\nThis is the base folder relative for which we will structure the specification files.\n```yaml\nswagger:\n    config_folder: '%kernel.project_dir%/docs/api/'\n```\n\nImagine you have a Swagger spec like this:\n\n```yaml\nopenapi: \"3.0.0\"\ninfo:\n  title: Simple API overview\n  version: 2.0.0\npaths:\n  \"/users\":\n    get:\n      operationId: CreateUser\n      summary: Create user\n      responses:\n        '201':\n          description: |-\n            201 response\n  \"/orders\":\n    post:\n      operationId: CreateOrder\n      summary: Create Order\n      responses:\n        '201':\n          description: |-\n            201 response        \n```\n\nHere is our desired folder structure:\n\n```yaml\n/docs/api/\n     ├── index.yaml\n     ├── paths\n     │   └── user\n     |       └── create-user.yaml\n     │   └── order\n     |       └── create-order.yaml\n     ├── responses\n     │   └── created.yaml\n```\n\nRoot file is `index.yaml`. Using `index.yaml` as file name for your root file is a convention. \n\nHere is list of files with their contents:\n### index.yaml\n\n```yaml\nopenapi: \"3.0.0\"\ninfo:\n  title: Simple API overview\n  version: 2.0.0\npaths:\n  \"$paths\"\n```\n\n### paths/user/create-user.yaml\n\n```yaml\n\"/users\":\n  get:\n    operationId: CreateUser\n    summary: Create user\n    responses:\n      \"$responses/created.yaml\"\n```\n\n### paths/order/create-order.yaml\n\n```yaml\n\"/orders\":\n  post:\n    operationId: CreateOrder\n    summary: Create Order\n    responses:\n      \"$responses/created.yaml\"\n```\n\n### paths/responses/created.yaml\n\n```yaml\n'201':\n  description: |-\n    201 response\n```\n\nAs you can see from the example, in order to specify a folder or file for the include we use the symbol `$` and name.\n\n* `$paths` - include all `.yaml` files from folder `paths` (recursively);\n* `$responses/created.yaml` - include the file `created.yaml` that storing in `responses` folder.\n\n## Generate Swagger UI\n\nFor generating Swagger UI static file use console command:\n\n```bash\nbin/console assets:install \u0026\u0026 bin/console swagger:generate-docs\n```\n\nThe file will be saved in the `%kernel.publid_dic%/public/api/index.html` folder and shared at `http://\u003cproject\u003e/api/index.html`.\n\n## Contributing\n\nRead the [CONTRIBUTING](https://github.com/stfalcon-studio/SwaggerBundle/blob/master/.github/CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfalcon-studio%2Fswaggerbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstfalcon-studio%2Fswaggerbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfalcon-studio%2Fswaggerbundle/lists"}