@seinopsys-forks/openapi-to-typescript
v0.0.11
Published
Generate TypeScript typings based on an OpenAPI schema object.
Downloads
5
Readme
@seinopsys-forks/openapi-to-typescript
Generate TypeScript typings based on an OpenAPI 3 schema definition.
Install
Run npm install @seinopsys-forks/openapi-to-typescript
or yarn add @seinopsys-forks/openapi-to-typescript
Usage in JavaScript
const { GenerateTypings } = require('@seinopsys-forks/openapi-to-typescript')
const generatedTypescriptCode = await GenerateTypings(openapiSchema)
fs.writeFileSync('out.ts', generatedTypescriptCode)
CLI Usage
yarn cli --help
For development
const { GenerateTypings } = require('./dist/index')
GenerateTypings(require('./fixtures/petstore.json')).then((generatedTypescriptCode: string) => {
fs.writeFileSync('out.ts', generatedTypescriptCode)
})
Releasing new versions
Run npm run release
, it will lint and build the project before running np
to actually publish the new version. Follow the prompts to create the release.