@opusdns/api-spec-ts-generator
v0.18.0
Published
Generator for TypeScript types from OpenAPI specification.
Readme
OpenAPI generator of TypeScript Types, Constants and other Helpers
This repository contains the scripts used to generate TypeScript types, constants and other helpers based on an OpenAPI specification.
It's what powers our api-spec repository at OpusDNS!
Installation
npm install @opusdns/api-spec-ts-generatorUsage
import { generateAllHelpers, generateSchema } from '@opusdns/api-spec-ts-generator';
const schemaPath = new URL("openapi.yaml", import.meta.url);
const openApiSchema = await generateSchema(schemaPath);
generateAllHelpers(schemaPath); // helpers are generated to `/src/helpers`