openapi-cg
v1.1.0
Published
Generate code from an OpenAPI spec
Downloads
4
Maintainers
Readme
Open Api Code Generator
Yet another openapi codegen but using https://generator3.swagger.io/api/generate service directly
Install
# use npm
npm install openapi-cg
# use yarn
yarn add openapi-cg
# use pnpm
pnpm install openapi-cg
Usage
const { openapiCodegen } = require('openapi-cg');
openapiCodegen(
'http://127.0.0.1:8000/openapi.json',
path.resolve(__dirname, '../src/service/__generated__'),
);
openapiCodegen(
'http://127.0.0.1:8000/openapi.json',
path.resolve(__dirname, '../src/service/__generated__'),
{
type: 'CLIENT',
include: '**/*.ts'
},
);
License
MIT