<div align="center">
<a href="https://tsoa-community.github.io/docs/" target="blank">
<h1>tsoa</h1>
</a>
Pronounced so路uh
OpenAPI-compliant REST APIs using TypeScript and Node
[![Codeship Status for lukeautry/tsoa](https://codeship.com/projects/cdce38d0-1f6b-0134-258e-1ed679ae6c9d/status?branch=master)](https://codeship.com/projects/160322)
[![npm version](https://img.shields.io/npm/v/tsoa/latest)](https://www.npmjs.com/package/tsoa)
</div>
## Goal
- TypeScript controllers and models as the single source of truth for your API
- A valid OpenAPI (formerly Swagger) spec (2.0 or 3.0 if you choose 馃槏) is generated from your controllers and models, including:
- Paths (e.g. GET /users)
- Definitions based on TypeScript interfaces (models)
- Parameters/model properties marked as required or optional based on TypeScript (e.g. myProperty?: string is optional in the OpenAPI spec)
- jsDoc supported for object descriptions (most other metadata can be inferred from TypeScript types)
- Routes are generated for middleware of choice
- Express, Hapi, and Koa currently supported, other middleware can be supported using a simple handlebars template
- Validate request payloads
## Philosophy
- Rely on TypeScript type annotations to generate API metadata if possible
- If regular type annotations aren't an appropriate way to express metadata, use decorators
- Use jsdoc for pure text metadata (e.g. endpoint descriptions)
- Minimize boilerplate
- Models are best represented by interfaces (pure data structures), but can also be represented by classes
- Runtime validation of tsoa should behave as closely as possible to the specifications that the generated OpenAPI 2/3 schema describes. Any differences in validation logic are clarified by logging warnings during the generation of the OpenAPI Specification (OAS) and/or the routes.
- Please note that by enabling OpenAPI 3 you minimize the chances of divergent validation logic since OpenAPI 3 has a more expressive schema syntax.
## Getting Started
- [Documentation](https://tsoa-community.github.io/docs/index)
- [API Reference](https://tsoa-community.github.io/reference)
- [Getting started guide](https://tsoa-community.github.io/docs/getting-started)
## Examples
Check out the [guides](https://tsoa-community.github.io/docs/getting-started)
See example controllers in [the tests](tests/fixtures/controllers)
See example models in [the tests](tests/fixtures/testModel.ts)
## Help wanted
### Contributing code
To contribute (via a PR), please first see the [Contributing Guide](https://github.com/lukeautry/tsoa/tree/master/docs/CONTRIBUTING.md)
### Becoming a maintainer
tsoa wants additional maintainers! The library has increased in popularity and has quite a lot of pull requests and issues. [Please post in this issue](https://github.com/lukeautry/tsoa/issues/236) if you're willing to take on the role of a maintainer.
没有合适的资源?快使用搜索试试~ 我知道了~
tsoa:使用TypeScript和Node构建与OpenAPI兼容的REST API
共212个文件
ts:174个
json:16个
md:5个
需积分: 12 1 下载量 151 浏览量
2021-04-27
14:20:06
上传
评论
收藏 420KB ZIP 举报
温馨提示
佐阿 发音为so·uh 使用TypeScript和Node的符合OpenAPI的REST API 目标 TypeScript控制器和模型是API真实性的唯一来源 有效的OpenAPI(以前称为Swagger)规范(2.0或3.0,如果您选择 :smiling_face_with_heart-eyes: )是根据您的控制器和模型生成的,包括: 路径(例如GET /用户) 基于TypeScript接口(模型)的定义 参数/模型属性根据TypeScript标记为必需或可选(例如,myProperty ?:字符串在OpenAPI规范中为可选) jsDoc支持对象描述(大多数其他元数据可以从TypeScript类型推断出来) 为选择的中间件生成路由 当前支持Express,Hapi和Koa,可以使用简单的把手模板来支持其他中间件 验证请求有效负载 哲学 如果可能,依靠TypeScript类型注释生成API元数据 如果常规类型注释不是表达元数据的适当
资源详情
资源评论
资源推荐
收起资源包目录
tsoa:使用TypeScript和Node构建与OpenAPI兼容的REST API (212个子文件)
.editorconfig 185B
.eslintignore 31B
.gitignore 107B
hapi.hbs 14KB
koa.hbs 12KB
express.hbs 11KB
custom-tsoa-template.ts.hbs 5KB
.eslintrc.js 3KB
ensureYarn.js 1016B
package.json 2KB
launch.json 2KB
package.json 2KB
package.json 2KB
package.json 996B
package.json 952B
tsconfig.json 849B
tsoa.json 832B
tsconfig.json 793B
tsconfig.json 732B
tsconfig.json 689B
tasks.json 485B
lerna.json 200B
tsconfig.build.json 166B
.prettierrc.json 132B
settings.json 125B
LICENSE 1KB
yarn.lock 317KB
yarn.lock 95KB
ExternalInterfacesExplanation.MD 5KB
CONTRIBUTING.md 5KB
README.MD 3KB
ISSUE_TEMPLATE.md 2KB
PULL_REQUEST_TEMPLATE.md 1KB
.npmignore 46B
.prettierignore 14B
schemaDetails3.spec.ts 98KB
definitions.spec.ts 86KB
express-server.spec.ts 55KB
hapi-server.spec.ts 50KB
koa-server.spec.ts 50KB
dynamic-controllers-express-server.spec.ts 47KB
templateHelpers.spec.ts 44KB
typeResolver.ts 43KB
metadata.spec.ts 36KB
templateHelpers.ts 29KB
openapi3-express.spec.ts 23KB
specGenerator3.ts 22KB
schemaDetails.spec.ts 21KB
templateHelpers.spec.ts 19KB
testModel.ts 18KB
koa-server-no-additional-allowed.spec.ts 18KB
specGenerator2.ts 16KB
parameterGenerator.ts 15KB
cli.ts 12KB
methodGenerator.ts 11KB
routeGenerator.ts 11KB
getRoutes.spec.ts 10KB
metadataGenerator.ts 9KB
swagger.ts 9KB
parameterController.ts 8KB
prepare.ts 7KB
getController.ts 7KB
specGenerator.ts 7KB
tsoa.ts 6KB
validatorUtils.ts 6KB
config.ts 5KB
paths.spec.ts 5KB
controllerGenerator.ts 5KB
methodController.ts 4KB
validateController.ts 4KB
specMerge.spec.ts 4KB
config.spec.ts 4KB
koa-success-code.spec.ts 4KB
express-success-code.spec.ts 3KB
hapi-success-code.spec.ts 3KB
inversify-server.spec.ts 3KB
routeGenerator.spec.ts 3KB
duplicatePathParamController.ts 3KB
postController.ts 3KB
postRoutes.spec.ts 3KB
base64image.ts 3KB
exampleController.ts 3KB
routeDuplicates.spec.ts 2KB
parameterDetails3.spec.ts 2KB
initializer-value.ts 2KB
deleteRoutes.spec.ts 2KB
headRoutes.spec.ts 2KB
defaultOptions.ts 2KB
securityController.ts 2KB
tsoa-route.ts 2KB
patchRoutes.spec.ts 2KB
decoratorUtils.ts 2KB
verifyParameter.ts 2KB
putRoutes.spec.ts 2KB
securityRoutes.spec.ts 2KB
subResourceRoutes.spec.ts 2KB
jsDocUtils.ts 2KB
inversify-glob.spec.ts 2KB
generate-spec.ts 2KB
parameter.ts 2KB
共 212 条
- 1
- 2
- 3
leeloodeng
- 粉丝: 25
- 资源: 4699
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Arduino和Firebase的智能家庭管理系统NodeSmartHome.zip
- (源码)基于C++的East Zone DSTADSO Robotics Challenge 2019机器人控制系统.zip
- (源码)基于Arduino平台的焊接站控制系统.zip
- (源码)基于ESPboy系统的TZXDuino WiFi项目.zip
- (源码)基于Java的剧场账单管理系统.zip
- (源码)基于Java Swing的船只资料管理系统.zip
- (源码)基于Python框架的模拟购物系统.zip
- (源码)基于C++的图书管理系统.zip
- (源码)基于Arduino的简易温度显示系统.zip
- (源码)基于Arduino的智能电动轮椅系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0