@forge-ts/api
v0.19.5
Published
OpenAPI spec and API reference generator for forge-ts
Readme
@forge-ts/api
OpenAPI 3.2 spec and API reference generator for the forge-ts toolchain.
When to use this package
Most users should install @forge-ts/cli instead and use npx forge-ts build. This package is for programmatic use.
npm install @forge-ts/apiWhat it generates
- OpenAPI 3.2 JSON from your exported interfaces, types, classes, and enums
- Typed schema mapping - TypeScript signatures mapped to OpenAPI schemas
- Visibility filtering -
@internalsymbols never appear in specs - Structured API Reference with full TSDoc metadata
Example
import { loadConfig, createWalker } from "@forge-ts/core";
import { generateOpenAPISpec, extractSDKTypes } from "@forge-ts/api";
const config = await loadConfig();
const walker = createWalker(config);
const symbols = walker.walk();
const sdkTypes = extractSDKTypes(symbols);
const spec = generateOpenAPISpec(config, sdkTypes);
// spec is a fully typed OpenAPIDocument
console.log(JSON.stringify(spec, null, 2));Part of forge-ts
See the main repo for full documentation.
License
MIT
