ngrx-toolkit-openapi-gen
December 24, 2025 ยท View on GitHub
Generate NgRx Signal Stores with httpResource and httpMutation from OpenAPI specifications.
Installation
npm install -g ngrx-toolkit-openapi-gen
Or use directly with npx:
npx ngrx-toolkit-openapi-gen -i api.yaml -o src/generated
Quick Start
ngrx-openapi-gen -i <openapi-file> -o <output-dir> [options]
Options
| Option | Description |
|---|---|
-i, --input <path> | Path to OpenAPI spec (YAML or JSON) required |
-o, --output <path> | Output directory for generated files |
--api-name <name> | Override API name used in generation |
--base-path-token <token> | Angular injection token for base URL |
--zod | Generate Zod schemas for runtime validation |
--prefer-entity-names | Use entity-based mutation names instead of operationId |
--dry-run | Preview without writing files |
Example
ngrx-openapi-gen -i swagger.json -o src/app/stores --zod
Documentation
๐ Full documentation: https://coderabbit-gmbh.github.io/ngrx-toolkit-openapi-gen/
Requirements
Generated stores require these peer dependencies in your Angular project:
npm install @angular-architects/ngrx-toolkit @ngrx/signals
If using --zod:
npm install zod
Development
This is an Nx monorepo. Available commands:
# Run playground app
npm start
# Build the generator
npm run build
# Run tests
npm test
# Run e2e tests
npm run test:e2e
# Start documentation site
npm run docs:start
License
MIT