0.1.4 • Published 11 months ago

limited-swagger-typescript-codegen v0.1.4

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

typescript api codegen tool, but limited

  • supports openapi v2 only
  • supports json only
  • templates not configurable
  • handles Chinese

Node Version Requirement

Node >= 18

Install

npm install limited-swagger-typescript-codegen --save-dev

Usage

import { gen } from 'limited-swagger-typescript-codegen'
import { resolve } from 'path'

gen({
  /**
   * swagger json object
   * or url that fetches it
   * */
  input: await import('/path/to/json.json'),
  /** output directory */
  output: resolve(import.meta.__dirname, './generated'),
  /**
   * path of client.ts file that exports an instance who sends requests
   * it wraps an AxiosInstance
   * */
  clientPath: '@/client',
  /** url prefix, will be removed in outputs */
  prefix: '/dev-api',
})
0.1.4

11 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.1.0

1 year ago