{"id":14983889,"url":"https://github.com/open-solid/open-api-bundle","last_synced_at":"2025-07-05T22:40:51.329Z","repository":{"id":197440694,"uuid":"698653652","full_name":"open-solid/open-api-bundle","owner":"open-solid","description":"OpenAPI Symfony Bundle","archived":false,"fork":false,"pushed_at":"2025-01-13T18:45:29.000Z","size":434,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T20:08:19.986Z","etag":null,"topics":["api-first","openapi","restful-api","symfony-bundle"],"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/open-solid.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-30T15:01:49.000Z","updated_at":"2025-02-19T16:09:37.000Z","dependencies_parsed_at":"2023-12-01T23:22:24.629Z","dependency_job_id":"bce0fd23-e34c-4375-9270-9bb710e88bcb","html_url":"https://github.com/open-solid/open-api-bundle","commit_stats":{"total_commits":121,"total_committers":1,"mean_commits":121.0,"dds":0.0,"last_synced_commit":"be5a7f50f8b03d6d8ecc87c8d1cdb371ed4dbfd0"},"previous_names":["yceruto/open-api-bundle","open-solid/open-api-bundle"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/open-solid/open-api-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fopen-api-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fopen-api-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fopen-api-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fopen-api-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-solid","download_url":"https://codeload.github.com/open-solid/open-api-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-solid%2Fopen-api-bundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263818954,"owners_count":23516092,"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":["api-first","openapi","restful-api","symfony-bundle"],"created_at":"2024-09-24T14:08:07.934Z","updated_at":"2025-07-05T22:40:51.278Z","avatar_url":"https://github.com/open-solid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenApiBundle\n\nProvides a tight integration of the famous [`zircote/swagger-php`](https://github.com/zircote/swagger-php) library into the Symfony full-stack framework for generating \nOpenAPI spec and building Restful APIs quickly.\n\nThis bundle is especially created for API-First development.\n\n## Installation\n\n```bash\ncomposer require open-solid/open-api-bundle\n```\n\nImport the bundle's routes in `config/routes.yaml` to show the Swagger API documentation:\n```yaml\nopenapi:\n    resource: '@OpenApiBundle/config/routes.php'\n```\n\n## Basic Sample\n\nDefine your OpenAPI spec and endpoint at the same time:\n\n```php\n\u003c?php\n\nnamespace Api\\Catalog\\Controller\\Post;\n\nuse Api\\Catalog\\Model\\Product;\nuse OpenSolid\\OpenApiBundle\\Attribute\\Payload;\nuse OpenSolid\\OpenApiBundle\\Routing\\Attribute\\Post;\n\nclass PostProductAction\n{\n    #[Post('/products')]\n    public function __invoke(#[Payload] PostProductPayload $payload): Product\n    {\n        return new Product($payload-\u003ename, $payload-\u003eprice);\n    }\n}\n```\n\n## Main Features\n\n- [x] Generate OpenAPI spec from PHP attributes (Mainly based on `zircote/swagger-php`)\n  - Automatic `Operation`, `Schema` and `Property` guessing from PHP classes and methods\n- [x] Expose Swagger UI to explore the OpenAPI spec and test API endpoints\n- [x] Export OpenAPI spec in JSON or YAML format (via HTTP and console command)\n- [x] Import OpenAPI spec in JSON or YAML format (via config file)\n- [x] Define Symfony routes and OpenAPI Paths using the same attributes:\n  - `#[Post]`, `#[Get]`, `#[Put]`, `#[Patch]`, `#[Delete]`\n- [x] Conditional OpenAPI Path/Route definition:\n  - Example: `#[Get('/me', when: 'service(\"toggle_me\").isEnabled()')]`\n- [x] Symfony attributes abbreviations:\n  - `#[Payload]` instead of `#[MapRequestPayload]`\n  - `#[Query]` instead of `#[MapQueryString]`\n- [x] OpenAPI attributes abbreviations:\n  - `#[Path]` instead of `#[PathParameter]`\n  - `#[Param]` instead of `#[QueryParameter]`\n- [x] Symfony's validation constraints definition using OpenAPI attributes:\n  - Example: `#[Property(minLength: 3, maxLength: 255)]`\n- [x] Automatic controller response serialization (JSON format by default)\n- [ ] Generate new endpoints from API spec (WIP) (based on `open-solid/open-api-assistant-bundle`)\n\n## License\n\nThis software is published under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-solid%2Fopen-api-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-solid%2Fopen-api-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-solid%2Fopen-api-bundle/lists"}