axios-swagger-helper
v0.0.56
Published
swagger.json 自动生成axios 示例,实现自动化生成,并支持前后对比,节省前端写api代码的时间
Downloads
11
Readme
This repository is no longer maintained
see typescript https://github.com/minskiter/auto-openapi
Open Api 3.0 Auto Gen Js Axios Client Code
What is axios-swagger-helper?
Automatically export from swagger.json(OPEN API 3)
The example of file:
dir
api file (auto generate)
custom config(config.js)
global types(Vue):
INSTALL
yarn global add axios-swagger-helper
# npm install -g axios-swagger-helper
use single project
yarn add -D axios-swagger-helper
# npm install -D axios-swagger-helper
package.json
{
"scripts":{
"api":"api-cli get https://example.com/swagger/v1/swagger.json -d ./api"
}
}
USAGE
# Global
api-cli get {url} -d {output_dir}
Devlopment
- git clone https://github.com/minskiter/openapijs.git # clone this repo
- yarn # install dependencies
- yarn dev # debug
Issues
Template:
Problem: something decode fail... [image]
CHANGE LOG
[2021-3-20] v0.0.44
- UploadProgress Callback Function
- DownloadProgress Callback Function
[2021-3-6] v0.0.42
- Import userModel
- Format parameter type {userModel.*}
[2021-3-5] v0.0.41
- Add model classes file
- Rename axios.js config.js
- Add import models resolve
- [Update Warning] Model.js will change the old parameters, please use the class instead