0.0.8 • Published 4 years ago

@toftcode/swagger-axios-ts-generator v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@toftcode/swagger-axios-ts-generator

npm version

Install

$ npm install @toftcode/swagger-axios-ts-generator
$ yarn add @toftcode/swagger-axios-ts-generator

Example

Example Link

TypeScript

import { generate } from '@toftcode/swagger-axios-ts-generator'

generate({
  // out files path
  out: './testServices',

  // service name suffix
  serviceNameSuffix: 'Service',

  // api json url
  url:
    'https://raw.githubusercontent.com/toftcode/swagger-axios-ts-generator/master/test.json',

  // foreach operationId
  operationIdForeach: (operationId: string) => {
    return operationId.match(/[a-zA-Z]+/g)?.join('') ?? operationId
  },

  // services/index.ts template
  requestTemplateUrl:
    'https://raw.githubusercontent.com/toft-tech/swagger-axios-ts-generator/master/src/template/indexAxiosTemplate.ts',
})

CommonJS

const { generate } = require('@toftcode/swagger-axios-ts-generator')

generate({
  out: './src/testService',
  url:
    'https://raw.githubusercontent.com/toftcode/swagger-axios-ts-generator/master/test.json',
})

Other

Thanks Manweill/swagger-axios-codegen

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago