{"id":15286071,"url":"https://github.com/mako-framework/open-api","last_synced_at":"2025-04-13T03:07:52.087Z","repository":{"id":62522964,"uuid":"306419407","full_name":"mako-framework/open-api","owner":"mako-framework","description":"Generate routes based on OpenAPI specifications and OpenAPI specifications from code.","archived":false,"fork":false,"pushed_at":"2025-03-04T22:57:47.000Z","size":86,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T03:07:47.065Z","etag":null,"topics":["mako-framework","mako-package","openapi","redoc","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mako-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-10-22T18:00:20.000Z","updated_at":"2025-03-04T22:57:51.000Z","dependencies_parsed_at":"2024-01-31T21:34:41.666Z","dependency_job_id":"685a9596-5930-4e0a-a37b-c50614d3f69f","html_url":"https://github.com/mako-framework/open-api","commit_stats":{"total_commits":68,"total_committers":2,"mean_commits":34.0,"dds":"0.044117647058823484","last_synced_commit":"8f320dbe7d05a7773b2ce03d9e0c7df9a68c9de9"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mako-framework%2Fopen-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mako-framework%2Fopen-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mako-framework%2Fopen-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mako-framework%2Fopen-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mako-framework","download_url":"https://codeload.github.com/mako-framework/open-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657918,"owners_count":21140846,"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":["mako-framework","mako-package","openapi","redoc","swagger","swagger-ui"],"created_at":"2024-09-30T15:10:22.696Z","updated_at":"2025-04-13T03:07:52.066Z","avatar_url":"https://github.com/mako-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenApi\n\n[![Static analysis](https://github.com/mako-framework/open-api/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/mako-framework/open-api/actions/workflows/static-analysis.yml)\n\nThe `mako/open-api` package allows you to generate a [OpenApi](https://www.openapis.org) specification using [attributes](https://www.php.net/manual/en/language.attributes.php) or docblock annotations and to generate routes based on the specification.\n\n## Requirements\n\nMako 11.0 or greater.\n\n## Installation\n\nFirst you'll need to install the package as a dependency to your project.\n\n```\ncomposer require mako/open-api\n```\n\nNext you'll need to add the package to the `cli` section of the `packages` configuration array in the `application.php` config file.\n\n```\n'cli' =\u003e [\n\tmako\\openapi\\OpenApiPackage::class,\n]\n```\n\nAnd finally replace the contents of your `routes.php` file with the following:\n\n```php\n\u003c?php\n\nuse mako\\openapi\\http\\routing\\Registrar;\n\nRegistrar::register(\n\t$routes,\n\tcachedRoutes: __DIR__ . '/openapi.php',\n\topenApiSpec: __DIR__ . '/openapi.yml',\n);\n```\n\n## Usage\n\nYou can build an OpenApi specification using a tool like [Apicurito](https://www.apicur.io/apicurito/pwa/) or by documenting your code using attributes or docblock annotations. To check out the syntax head over to the [zircote/swagger-php](https://github.com/zircote/swagger-php) documentation.\n\nIf you want to generate a specification file based on your documentation then you can do so by running the `open-api:generate-spec` command.\n\nTo generate a cached route file for production then you'll have to run the `open-api:generate-routes` command.\n\n\u003e Note that you have to set the `operationId` parameter to the fully qualified method name (e.g. app\\controllers\\Index::welcome) of your controller action for the route generator to work.\n\n```\nopenapi: 3.0.2\ninfo:\n    title: Mako\n    version: 1.0.0\n    description: Mako example application.\npaths:\n    '/':\n        summary: Displays a welcome page.\n        get:\n            operationId: 'app\\controllers\\Index::welcome'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmako-framework%2Fopen-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmako-framework%2Fopen-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmako-framework%2Fopen-api/lists"}