{"id":22730914,"url":"https://github.com/charlzyx/tapi","last_synced_at":"2025-08-10T04:09:56.419Z","repository":{"id":266035927,"uuid":"897179546","full_name":"charlzyx/tapi","owner":"charlzyx","description":"tApi: Define APIs with the power of TypeScript","archived":false,"fork":false,"pushed_at":"2024-12-17T12:34:34.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T01:30:43.013Z","etag":null,"topics":["api-tools","bruno","oas","openapi","openapi-specification","resutful","typescript"],"latest_commit_sha":null,"homepage":"https://tapiapp.pages.dev/","language":"TypeScript","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/charlzyx.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}},"created_at":"2024-12-02T07:13:04.000Z","updated_at":"2024-12-17T12:34:39.000Z","dependencies_parsed_at":"2025-02-05T03:35:37.085Z","dependency_job_id":null,"html_url":"https://github.com/charlzyx/tapi","commit_stats":null,"previous_names":["charlzyx/tapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charlzyx/tapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlzyx%2Ftapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlzyx%2Ftapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlzyx%2Ftapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlzyx%2Ftapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlzyx","download_url":"https://codeload.github.com/charlzyx/tapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlzyx%2Ftapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269673903,"owners_count":24457224,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["api-tools","bruno","oas","openapi","openapi-specification","resutful","typescript"],"created_at":"2024-12-10T19:15:14.731Z","updated_at":"2025-08-10T04:09:56.390Z","avatar_url":"https://github.com/charlzyx.png","language":"TypeScript","readme":"# What's tApi?\n\n# MOVETO [typeto](https://github.com/charlzyx/typeto)\n\n\u003e **!! Work in Progress**\n\n**tApi** 是一个优雅的 API 类型描述规范，借助 TypeScript 强大的类型系统，让 API 定义更自然、更具表现力。完全兼容 OpenAPI 3.0 规范，无缝对接现有工具生态。\n\n## 核心特性\n\n- **TypeScript 语法定义 API**  \n  用 class 定义数据模型，用 type 定义 API 操作。利用 TypeScript 类型系统提供完整的类型检查和推导能力：\n\n  - 更自然的语法：class 定义数据模型，type 定义 API 操作\n  - 完整的类型支持：泛型、联合类型、交叉类型等\n  - 强大的类型推导：编译时类型检查和错误提示\n\n- **元数据注解支持**\n  支持 JSDoc、装饰器和行内注释三种方式添加元数据。可选字段、默认值等特性让 API 定义更加灵活：\n\n  - JSDoc 注释：支持完整的 OpenAPI Schema 属性\n  - 装饰器：提供声明式的元数据定义\n  - 行内注释：简单直观的描述信息\n\n- **站在巨人的肩膀上**  \n  完整支持 OpenAPI 3.0 规范，让您在享受更好的开发体验的同时，还能复用丰富的工具生态：\n\n  - 复用丰富的 OAS 工具生态\n  - 使用现有的代码生成器\n  - 集成已有的文档工具\n  - 对接各类测试平台\n\n- **开发者友好**\n  享受 IDE 的智能提示、类型检查和代码重构能力。纯文本的 .ts 文件让版本控制和团队协作更加自然。\n\n## 快速预览\n\n```typescript\n// 定义数据模型\nclass Pet {\n  /** Pet's id */\n  id: int64 = 0;\n  name: string;\n  status: \"available\" | \"pending\" | \"sold\";\n}\n\n// 定义 API 操作\ntype createPet = {\n  method: \"POST\";\n  url: \"{{SERVER}}/pet\";\n  body: Pet;\n  resp: Resp\u003cPet\u003e | Reason\u003c\"Invalid input\"\u003e;\n};\n```\n\n## 了解更多\n\n- 📖 [完整文档](https://tapiapp.pages.dev)\n- 🚀 [快速开始](https://tapiapp.pages.dev/guide/getting-started)\n- 📋 [API 规范](https://tapiapp.pages.dev/rfc)\n\n## 功能规划\n\n- [ ] **`importer`**  \n       提供从 Postman、Swagger 和 OpenAPI 格式转换到 tApi 的功能，方便与现有工具集成。\n\n- [ ] **`codegen`**  \n       支持自定义代码生成插件，生成不同语言和客户端请求层代码。\n\n- [ ] **`runner`**  \n       支持 Mock 数据和 Test 脚本的运行，帮助开发者快速验证 API 的功能与行为。\n\n- [ ] **`devtools`**  \n       开发 VSCode 插件和 GUI 客户端，进一步优化 API 描述的编辑和可视化体验。\n\n## 灵感来源\n\ntApi 的灵感来源于 [Bruno](https://docs.usebruno.com/introduction/what-is-bruno)。与 Bruno 自定义 DSL 不同，tApi 直接使用 TypeScript 语法描述 API，同时补全了 Bruno 在 Response 类型定义上的不足，提供更完整的 API 设计能力。\n\n---\n\n_润色 by ChatGPT_\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlzyx%2Ftapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlzyx%2Ftapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlzyx%2Ftapi/lists"}