1.5.1 • Published 1 year ago

@nest-toolbox/open-api-spec-to-ts v1.5.1

Weekly downloads
89
License
MIT
Repository
github
Last release
1 year ago

Open API spec to TS

Generate Typescript interfaces and enums in a specified folder, from you Open API specifications. Depends on json-schema-to-typescript.

Installation

npm i @nest-toolbox/open-api-spec-to-ts

Usage

Inside a module

import { generate } from '@nest-toolbox/open-api-spec-to-ts';

const openApiFilePath = './openapi.json';
const interfacesDirPath = './interfaces';

generate(openApiFilePath, interfacesDirPath);

As a CLI tool

import { generate, LogLevel } from '@nest-toolbox/open-api-spec-to-ts';
import { argv } from 'yargs';

const openApiFilePath = argv.openApiPath || './openapi.json';
const interfacesDirPath = argv.interfacesPath || './interfaces';
const verbosity = argv.verbosity || LogLevel.INFO;

generate(openApiFilePath, interfacesDirPath, { verbosity });
node ./<your-file>.js --openApiPath='./openapi.json' --interfacesPath='./interfaces'"
1.5.1

1 year ago

1.4.19

2 years ago

1.4.17

2 years ago

1.4.9

2 years ago

1.4.8

2 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago