@breadstone-tools/openapi-app
v0.0.206
Published
Open API Model generator cli
Readme
📦 @breadstone-tools/openapi-app
| Package Status | Source |
|----------------|--------|
| | tools/openapi/app |
CLI and programmatic entrypoint for OpenAPI model and service generation. Generates TypeScript models and Angular services from OpenAPI 3.x specifications.
📁 Project Structure
Part of the monorepo mosaik
Package path: tools/openapi/app
Version: see npm
License: MIT
📦 Installation
yarn add -D @breadstone-tools/openapi-app🔧 Usage
CLI
npx openapi-app run --endpoints <path/to/openapi.json> --output <output/dir>Programmatic
import { run } from '@breadstone-tools/openapi-app';
await run({
cwd: process.cwd(),
output: './src/app/api',
endpoints: './api/openapi.json',
parser: {
// Optional: override TypeScript options
modelRoot: 'models',
serviceRoot: 'services'
},
debug: false
});⚙️ Features
- Parses OpenAPI 3.x (JSON/YAML) files, local or remote
- Generates TypeScript interfaces, classes, enums, and type aliases for models
- Generates Angular-compatible services for API endpoints
- Supports custom templates (EJS)
- Configurable naming conventions for models and services
- Handles enums, unions, inheritance, request/response bodies, parameters, security, etc.
- Generates index files for easy imports
- CLI and programmatic usage
- Integrates with Nx workspaces and Yarn
🛠 Recommendations
- Use with Nx for code generation in monorepos.
- Override templates for custom code style or framework integration.
📦 Publishing
yarn nx run openapi-app:publish📄 License
MIT © Breadstone
