【文件属性】:
文件名称:openapi-typescript-validator:根据OpenAPI模式使用AJV验证生成Typescript
文件大小:86KB
文件格式:ZIP
更新时间:2021-04-18 19:29:48
TypeScript
openapi-typescript-validator
根据OpenAPI模式使用AJV验证生成Typescript
这是做什么的?
该软件包会将您的openapi 3.0规范转换为:
打字稿模型
根据JSON模式验证模型的解码器
例子
此架构(注意:也适用于基于JSON的架构)
components :
schemas :
User :
type : object
properties :
id :
type : string
name :
type : string
required : ['id']
将转换为:
export interface User {
id : string ;
name ?: string ;
}
并将生成一个解码器
【文件预览】:
openapi-typescript-validator-main
----.gitignore(2KB)
----tsconfig.json(306B)
----README.md(5KB)
----.github()
--------workflows()
----tests()
--------tsconfig.json(316B)
--------schemas()
--------package.json(430B)
--------src()
--------jest.config.js(178B)
--------package-lock.json(194KB)
----.vscode()
--------launch.json(590B)
--------tasks.json(280B)
----package.json(1KB)
----src()
--------generate.ts(3KB)
--------builder.ts(3KB)
--------parse-schema.ts(2KB)
--------GenerateOptions.ts(1KB)
--------generate()
--------index.ts(118B)
--------templates.ts(3KB)
----package-lock.json(20KB)