For original usage read - original README
npm install saddleback-openapi-typescript-codegen --save-dev - install the package
- create config files for every microservice that you need (put it in the root project folder for example openapiEvents.config.json)
- inside the config file you need to specify - output folder (for Events it would be ./src/shared/api/events)
- microservice that you're specifying ("Events")
- environment that using for fetch ("feature")
- if you don't want to generate whole microservices, you can specify filterMethod and filterArray
 
- create utility files that used in services - 'baseAxios' should export axios instance that be used for fetch
- 'getBaseConfig' and 'serviceError' described here https://github.com/saddlebackdev/church-management/wiki/Services
 
- run the command where you should pass your login and pass from saddleback identity server saddlebackApi --config openapiEvents.config.json --login login --password password
- same as above
- same as above
- addition specify the input path to the swagger.json file
- same as above
- run the command saddlebackApi --config openapiEvents.config.json
Generated folders should be untouchable. Because every generate action will delete and put generated files into the output folder.
$ saddlebackOpenapi --help Usage: saddlebackOpenapi [options] Options: -V, --version output the version number -i, --input <value> OpenAPI specification, can be a path, url or string content -o, --output <value> Output directory should end with service name workflows | events | notifications | core | journey | giving | smallGroup -c, --config <value> Path to the config file -l, --login <value> Login -p, --password <value> Password -e, --environment <value> Environment dev | stage | stage2 -s, --service <value> Service Service Workflows | Events | Notifications | Core | Journey | Giving | SmallGroup -h, --help display help for command -m, --filterMethod Filter method include(default) | exclude') -f, --filterArray Filter array Examples $ saddlebackOpenApi --input ./spec.json --output ./generated $ saddlebackOpenApi --config ./openapi.config.json $ saddlebackOpenApi -o "./folderPath" -l "Login" -p "Password" -e "dev" -s "core" extends original OPTIONS
 input required in the config or cmd arguments output required in the config or cmd arguments additionalModelFileExtension optional additionalServiceFileExtension optional removeLodashPrefixes optional - Default: undefined
- Type: string
OpenAPI specification, can be a path, url or string content (required in the config or cmd arguments)
- Default: undefined
- Type: string
Output directory (required in the config or cmd arguments)
- Default: undefined
- Type: string
Login to saddleback identity server
- Default: undefined
- Type: string
Password to saddleback identity server
- Default: undefined
- Type: 'dev' | 'stage' | 'stage2'
Which Environment should be used for swagger.json
- Default: undefined
- Type: 'workflows' | 'event' | 'notifications' | 'core'
Which service should be fetched
- Default: include
- Type: 'include' | 'exclude'
Which method of sort should be applied to the filter array
- Default: undefined
- Type: string[]
Which services should be included or excluded to/from generated list
- Default: true
- Type: boolean
Apply *.models.* extension to model files.
For example (myModel.ts -> myModel.models.ts)
- Default: true
- Type: boolean
Apply *.service.* extension to service files.
For example (myService.ts -> myService.service.ts)
- Default: true
- Type: boolean
Remove special prefixes that are separated by _ at the start of names.
For example (Custom_Prefix_Name -> Name)