{"id":35214508,"url":"https://github.com/jdifool/tempest-openapi-tools","last_synced_at":"2026-01-20T16:26:18.090Z","repository":{"id":330420052,"uuid":"1121945534","full_name":"jdifool/tempest-openapi-tools","owner":"jdifool","description":"OpenAPI specification generator and interactive documentation UI for the Tempest framework.","archived":false,"fork":false,"pushed_at":"2025-12-25T09:41:58.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T22:53:07.135Z","etag":null,"topics":["openapi","php","scalar","swagger-ui","tempest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdifool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-23T20:38:59.000Z","updated_at":"2025-12-25T12:40:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jdifool/tempest-openapi-tools","commit_stats":null,"previous_names":["jdifool/tempest-openapi-tools"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jdifool/tempest-openapi-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdifool%2Ftempest-openapi-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdifool%2Ftempest-openapi-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdifool%2Ftempest-openapi-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdifool%2Ftempest-openapi-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdifool","download_url":"https://codeload.github.com/jdifool/tempest-openapi-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdifool%2Ftempest-openapi-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["openapi","php","scalar","swagger-ui","tempest"],"created_at":"2025-12-29T21:20:17.535Z","updated_at":"2026-01-20T16:26:18.081Z","avatar_url":"https://github.com/jdifool.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI tools for Tempest PHP\n\nOpenAPI specification generator and interactive documentation UI for the Tempest framework.\n\n## Requirements\n\n- PHP 8.4+\n- Tempest framework v2.0\n\n## Installation\n\n```bash\ncomposer require jdifool/tempest-openapi-tools\n```\n\n## Features\n\n- Generate OpenAPI specification from PHP code annotations using [zircote/swagger-php](https://github.com/zircote/swagger-php)\n- Serve OpenAPI spec dynamically via HTTP endpoint\n- Interactive API documentation with Swagger UI or Scalar\n\n## Usage\n\n### Command Line\n\nGenerate an OpenAPI specification file:\n\n```bash\n./tempest openapi:generate\n./tempest openapi:generate --path=src --output=public/openapi.json\n```\n\n### HTTP Endpoints\n\nThe package registers two routes (configurable):\n\n| Route | Description |\n|-------|-------------|\n| `/documentation/openapi.json` | OpenAPI specification (JSON) |\n| `/documentation/openapi` | Interactive API documentation UI |\n\n## Configuration\n\nCreate `openapi.config.php` in your project:\n\n```php\n\u003c?php\n\nuse Jdifool\\Tempest\\Openapi\\Config\\OpenApiConfig;\nuse Jdifool\\Tempest\\Openapi\\Config\\OpenApiUiTool;\n\nreturn new OpenApiConfig(\n    scanPath: 'app',                                    // Directory to scan for annotations\n    routePath: '/documentation/openapi.json',           // OpenAPI spec endpoint\n    outputFile: 'openapi.json',                         // Output file for CLI command\n    uiTool: OpenApiUiTool::Scalar,                      // UI tool: Scalar or SwaggerUi\n    uiRoutePath: '/documentation/openapi',              // UI endpoint\n    uiTitle: 'API Documentation',                       // Page title\n    enabled: true,                                      // Enable OpenAPI spec endpoint\n    uiEnabled: true,                                    // Enable documentation UI endpoint\n);\n```\n\n**Note:** Both `enabled` and `uiEnabled` default to `false`. The endpoints return 404 until explicitly enabled.\n\n## Adding OpenAPI Annotations\n\nUse [swagger-php attributes](https://zircote.github.io/swagger-php/) in your controllers:\n\n```php\n\u003c?php\n\nuse OpenApi\\Attributes as OA;\n\n#[OA\\Info(title: 'My API', version: '1.0.0')]\nclass MyController\n{\n    #[OA\\Get(path: '/users', summary: 'List users')]\n    #[OA\\Response(response: 200, description: 'Success')]\n    public function index(): Response\n    {\n        // ...\n    }\n}\n```\n\n## Custom UI Renderer\n\nImplement the `OpenApiUiRenderer` interface to add a custom documentation UI:\n\n```php\n\u003c?php\n\nuse Jdifool\\Tempest\\Openapi\\Ui\\OpenApiUiRenderer;\n\nclass MyCustomRenderer implements OpenApiUiRenderer\n{\n    public function render(string $specUrl, string $title): string\n    {\n        return \u003c\u003c\u003cHTML\n        \u003c!DOCTYPE html\u003e\n        \u003chtml\u003e\n            \u003c!-- Your custom UI --\u003e\n        \u003c/html\u003e\n        HTML;\n    }\n}\n```\n\n## Custom Route Attributes\n\nThis package provides custom Tempest route attributes that read their paths from `OpenApiConfig`:\n\n| Attribute | Description |\n|-----------|-------------|\n| `#[OpenApiSpecRoute]` | Route for OpenAPI JSON specification |\n| `#[OpenApiUiRoute]` | Route for interactive documentation UI |\n\nYou can use these attributes in your own controllers if needed:\n\n```php\n\u003c?php\n\nuse Jdifool\\Tempest\\Openapi\\Routes\\OpenApiSpecRoute;\nuse Tempest\\Http\\Response;\n\nclass MyController\n{\n    #[OpenApiSpecRoute]\n    public function openapi(): Response\n    {\n        // Custom OpenAPI handling\n    }\n}\n```\n\nThe attributes implement `Tempest\\Router\\Route` and resolve their URIs from `OpenApiConfig` at discovery time.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdifool%2Ftempest-openapi-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdifool%2Ftempest-openapi-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdifool%2Ftempest-openapi-tools/lists"}