Skip to content

minskiter/axios-swagger-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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?

  1. Automatically export from swagger.json(OPEN API 3)

  2. The example of file:

    • dir

      image

    • api file (auto generate)

    Snipaste 2021 10 02 21 31 59

    • custom config(config.js)

      image

    • global types(Vue):

      image

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

Issues

Template:

Problem: something decode fail... [image]

CHANGE LOG

[2021-3-20] v0.0.44

  1. UploadProgress Callback Function
  2. DownloadProgress Callback Function

[2021-3-6] v0.0.42

  1. Import userModel
  2. Format parameter type {userModel.*}

[2021-3-5] v0.0.41

  1. Add model classes file
  2. Rename axios.js config.js
  3. Add import models resolve
  4. [Update Warning] Model.js will change the old parameters, please use the class instead

About

Vue Axios Open Api Json 自动生成axios.js脚本

Resources

License

Stars

Watchers

Forks

Packages

No packages published