README
ts-to-openapi
This package is not heavily maintained, and will be replaced with typeconv
This package converts TypeScript interfaces and types to OpenAPI/Swagger YAML.
It can detect what looks like GraphQL-to-TypeScript converted files, and clean them up (e.g. auto-expanding Scalar
and Maybe
).
The result is a set of schema components which can be referred to in OpenAPI/Swagger routes (or from other components).
Example
The following converts types MyTypeA
and MyTypeB
in my-file.ts
into OpenAPI YAML and writes to stdout: