SublimeCT / swagger-toolkit

serialize swagger API JSON file and generate/update local Model class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swagger-toolkit

分析 swaggerapi.json 并在本地生成或更新 definitions 对应的 Model class

Install

In your project, package.json

{
    "dependencies": {
        "swagger-toolkit": "git+ssh://git@github.com:SublimeCT/swagger-toolkit.git",
    }
}

To install

yarn

Usage

⚠️ Only the download function is currently completed

In command line

./node_modules/.bin/swagger-toolkit --help

In javascript / typescript file

import { ConfigOptions, SwaggerTool } from 'swagger-toolkit'
const config = new ConfigOptions({
    site: 'http://api.lynee.cn',
    docJSONPath,
})
const tool = new SwaggerTool('', null, null, config)
await tool.run()

Test

In this project

yarn test # use mocha
yarn test-command # just use command

About

serialize swagger API JSON file and generate/update local Model class

License:GNU General Public License v3.0


Languages

Language:TypeScript 60.0%Language:JavaScript 40.0%