{"id":23824535,"url":"https://github.com/speedphp/typespeed-swagger","last_synced_at":"2026-06-25T07:31:09.439Z","repository":{"id":174940275,"uuid":"652980532","full_name":"speedphp/typespeed-swagger","owner":"speedphp","description":"The Swagger plugin for the TypeSpeed framework.","archived":false,"fork":false,"pushed_at":"2023-12-07T09:22:09.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-12T07:20:33.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/speedphp.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-13T07:15:42.000Z","updated_at":"2023-06-13T07:18:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d31c196-2e12-4b61-a68a-a814cd6019cb","html_url":"https://github.com/speedphp/typespeed-swagger","commit_stats":null,"previous_names":["speedphp/typespeed-swagger"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/speedphp/typespeed-swagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speedphp%2Ftypespeed-swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speedphp%2Ftypespeed-swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speedphp%2Ftypespeed-swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speedphp%2Ftypespeed-swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speedphp","download_url":"https://codeload.github.com/speedphp/typespeed-swagger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speedphp%2Ftypespeed-swagger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34765321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-01-02T11:12:17.915Z","updated_at":"2026-06-25T07:31:09.433Z","avatar_url":"https://github.com/speedphp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typespeed-swagger \n\n[![typescript](https://badgen.net/badge/icon/TypeScript?icon=typescript\u0026label)](https://www.npmjs.com/package/typespeed)\n[![license](https://badgen.net/github/license/speedphp/typespeed)](https://github.com/SpeedPHP/typespeed/blob/main/LICENSE)\n[![GitHub Build Status](https://img.shields.io/github/actions/workflow/status/speedphp/typespeed-swagger/test.yml)](https://github.com/SpeedPHP/typespeed-swagger/commits/main)\n[![Codecov](https://img.shields.io/codecov/c/github/speedphp/typespeed-swagger)\n](https://codecov.io/gh/SpeedPHP/typespeed-swagger)\n\n**The Swagger plugin for the TypeSpeed framework.**\n\n- **NO NEED** to add redundant annotations of methods and variables on existing web applications. \n- **NO NEED** to add redundant definitions to any entity classes.\n- **Simply** modify the import path of some decorators, then the application will have a complete and available swagger document page.\n- Use advanced reflection ([typescript-rtti](https://github.com/typescript-rtti/typescript-rtti)) to get all the type, no extra markup required.\n\n### Install\n\n```\nnpm install typespeed-swagger typescript-rtti reflect-metadata\n```\n\n### How To Use\n\n**First** modify the import path of these decorators from typespeed to typespeed-swagger: `@getMapping`, `@postMapping`, `@requestMapping`, `@reqBody`, `@reqQuery`, `@reqForm`, `@reqParam`.\n\nFor example:\n```\nimport { log, component, getMapping, reqQuery } from \"typespeed\";\n```\nWould change to:\n```\nimport { log, component } from \"typespeed\";\nimport { getMapping, reqQuery } from \"typespeed-swagger\";\n```\n\n**Second**, add swagger middleware to the main.ts entry file, as follows:\n```\nimport { app, log, autoware, ServerFactory } from \"typespeed\";\nimport { swaggerMiddleware } from \"typespeed-swagger\";\n\n@app\nclass Main {\n\n    @autoware\n    public server: ServerFactory;\n\n    public main() {\n        swaggerMiddleware(this.server.app, { path: \"/docs\", \"allow-ip\": [\"127.0.0.1\"] }, \"./package.json\");\n        this.server.start(8081);\n    }\n}\n```\n\nAfter that, start the application, visit http://localhost:8081/docs, and you can see the swagger page.\n\n### Configuration\n\nTypespeed-swagger has three configurations, which are the last two optional parameters of the `swaggerMiddleware` function:\n\n- The `path` property of the second parameter is the address configuration of the swagger page, and the default is `/docs`.\n\n- The `allow-ip` property of the second parameter provides IP restrictions for secure access to the swagger page. Only the client IPs in the `allow-ip` array can access the page normally. Default is `[\"127.0.0.1\", \"::1\"]`.\n\n- The third parameter is the `package.json` file path of the project. Typespeed-swagger use the package.json file and read its name and version information for swagger page.\n\n\n### Link\n\n- **TypeSpeed Framework** \u003chttps://www.npmjs.com/package/typespeed\u003e\n\n- **Swagger UI** \u003chttps://swagger.io\u003e\n\n- **typescript-rtti** \u003chttps://www.npmjs.com/package/typescript-rtti\u003e\n\n### License\n\n- [MIT](LICENSE) © speedphp","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeedphp%2Ftypespeed-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeedphp%2Ftypespeed-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeedphp%2Ftypespeed-swagger/lists"}