Skip to content

CodeRabbit-GmbH/ngrx-toolkit-openapi-gen

Repository files navigation

ngrx-toolkit-openapi-gen

Generate NgRx Signal Stores with httpResource and httpMutation from OpenAPI specifications.

npm version License: MIT

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

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors