@codious/ngrx-generator
v1.7.25
Published
Generates a NgRx store (for Angular) based on a OpenAPI 3.x configuration (i.e. Swagger).
Downloads
573
Readme
Codious.NgRx-Generator
Generates a NgRx store (for Angular) based on a OpenAPI 3.x configuration (i.e. Swagger).
Installation
npm install @codious/ngrx-generator
Usage
npx ngrx-gen -i <input path|url> -o <output path> -s <server name> -t <tag1, tag2>
Options:
[Required] --input, -i
: a path to an OpenAPI specification file. This can also be an URL.[Required] --output, -o
: a path to a folder where the store will be generated.[Optional] --conversions, -c
: conversions from one model to another. (e.a. -c MyObject:any OtherObject:object)[Optional] --format, -f
: ESLint config for formatting the generated files. Add--format false
to skip formatting.[Optional] --server, -s
: the server defined in the description of theservers
section in the OpenAPI file. This value is used as the API base URL in the generated service. If the option is empty or the server couldn't be found in theservers
section, the base URL will be${environment.apiBaseUrl}
. Then, in yourtsconfig.json
add a path"@environments": ["environments/environment"]
, and add the propertyapiBaseUrl
to the files in your Angular environments folder.[Optional] --tags, -t
: only paths with these tags will be generated.