Generate NgRx Signal Stores with httpResource and httpMutation from OpenAPI specifications.
npm install -g ngrx-toolkit-openapi-genOr use directly with npx:
npx ngrx-toolkit-openapi-gen -i api.yaml -o src/generatedngrx-openapi-gen -i <openapi-file> -o <output-dir> [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 |
ngrx-openapi-gen -i swagger.json -o src/app/stores --zod📚 Full documentation: https://coderabbit-gmbh.github.io/ngrx-toolkit-openapi-gen/
Generated stores require these peer dependencies in your Angular project:
npm install @angular-architects/ngrx-toolkit @ngrx/signalsIf using --zod:
npm install zodThis 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:startMIT