0.11.13 • Published 8 months ago

@cqfe/generate-api v0.11.13

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

0.11.12

9 months ago

0.11.11

9 months ago

0.11.10

9 months ago

0.11.9

10 months ago

0.11.8

10 months ago

0.11.7-beta.4

10 months ago

0.11.7-beta.3

10 months ago

0.11.7-beta.2

10 months ago

0.11.7-beta.1

10 months ago

0.11.7

10 months ago

0.11.6

10 months ago

0.11.5

10 months ago

0.11.4

10 months ago

0.11.3

10 months ago

0.11.2

10 months ago

0.11.0

10 months ago

0.10.0

10 months ago

0.9.0

10 months ago

0.8.0

10 months ago

0.7.0

10 months ago

0.6.0

10 months ago

0.5.3

10 months ago

0.5.2

10 months ago

0.5.1

10 months ago

0.5.0

10 months ago

0.4.2

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.0

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago