1.0.16 • Published 2 years ago

swagger-axios-converter v1.0.16

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

使用

const { Extractor, Generator, FileWriter } = require("swagger-axios-converter");

Extractor.measure(
  "https://app.swaggerhub.com/apiproxy/registry/wangyf/Cable/1.0.0"
).then((res) => {
  FileWriter.write(
    Generator.run(Extractor.parse(res), {
      /**
       * api公共路径
       */
      api_base: "/api/",
      /**
       * 代码风格
       */
      code_style: "class",
      /**
       * 类单一文件声明
       */
      single_class_declare: true,
      /**
       * 是否内嵌模型声明
       */
      inline_model_declare: false,
      /**
       * 类文件路径模板
       */
      class_file_path_tpl: "{group_name}/index.ts",
      /**
       * 分组名
       */
      group_name: "common",
    }),
    {
      /**
       * 输出位置
       */
      output: "./dist",
      /**
       * 是否先清空目录
       */
      clear: true,
      /**
       * 是否格式化
       */
      format: true,
    }
  );
});
1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago