0.11.13 • Published 10 months ago

@cqfe/generate-api v0.11.13

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

generate-api

Description

Generate api for axios, based on swagger json.support Swagger2.0&OpenAPI3.0.

Useage

  1. Install npm install @cqfe/generate-api

  2. Create a script file, and write the following code:

// scripts/gen-api.mjs
import generateApi from '@cqfe/generate-api';
import path from 'path';

generateApi.default({
  // path of swagger json file (can be http(s)://xxx)
  url: path.resolve(process.cwd(), './mocks/v2.json'),
  // output api js file path
  outPut: path.resolve(process.cwd(), './apis.js'),
  // basic service path, used for string writing template, content should be an instance of axios
  servicePath: 'import service from "@/utils/request"',
  // be true if you want to generate jsDoc for request body
  generateRequestDoc: true,
  // be true if you want to generate jsDoc for response body, not work still now
  generateResponseDoc: false,
});
0.11.13

10 months ago

0.11.12

11 months ago

0.11.11

11 months ago

0.11.10

11 months ago

0.11.9

12 months ago

0.11.8

12 months ago

0.11.7-beta.4

12 months ago

0.11.7-beta.3

12 months ago

0.11.7-beta.2

12 months ago

0.11.7-beta.1

12 months ago

0.11.7

12 months ago

0.11.6

12 months ago

0.11.5

12 months ago

0.11.4

1 year ago

0.11.3

1 year ago

0.11.2

1 year ago

0.11.0

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago