Skip to content

Commit c43473a

Browse files
committed
update README
1 parent 62c5173 commit c43473a

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@
55
## Install
66

77
```
8-
npm install [gitUrl] --save-dev
8+
npm install saddleback-openapi-typescript-codegen --save-dev
99
```
1010

11+
## Step-by-step guide based on ME app
12+
### auto fetch
13+
1. install the package
14+
2. create config files for every microservice that you need (put it in the root project folder for example openapiEvents.config.json)
15+
3. inside the config file you need to specify
16+
1. output folder (for Events it would be ./src/shared/api/events)
17+
2. microservice that you're specifying ("Events")
18+
3. environment that using for fetch ("feature")
19+
4. if you don't want to generate whole microservices, you can specify filterMethod and filterArray
20+
4. run the command where you should pass your login and pass from saddleback identity server `saddlebackApi --config openapiEvents.config.json --login login --password password`
21+
### local swagger
22+
1. same as above
23+
2. same as above
24+
3. addition specify the input path to the swagger.json file
25+
4. run the command `saddlebackApi --config openapiEvents.config.json`
26+
1127
## Usage
1228

29+
Generated folders should be untouchable. Because every generate action will delete and put generated files into the output folder.
30+
1331
```
1432
$ saddlebackOpenapi --help
1533
@@ -81,6 +99,18 @@ Which Environment should be used for swagger.json
8199

82100
Which service should be fetched
83101

102+
### `filterMethod` (autofetch)
103+
- Default: `include`
104+
- Type: `'include' | 'exclude'`
105+
106+
Which method of sort should be applied to the filter array
107+
108+
### `filterArray` (autofetch)
109+
- Default: `undefined`
110+
- Type: `string[]`
111+
112+
Which services should be *included* or *excluded* to/from generated list
113+
84114
### `additionalModelFileExtension`
85115
- Default: `true`
86116
- Type: `boolean`

bin/saddleback.cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ if (OpenAPI) {
4848
...config,
4949
input: params.input || config.input,
5050
output: params.output || config.output,
51-
username: params.login || config.username,
51+
username: params.login || config.login,
5252
password: params.password || config.password,
53-
useEnvironment: params.environment || config.useEnvironment,
54-
useService: params.service || config.useService,
53+
useEnvironment: params.environment || config.environment,
54+
useService: params.service || config.service,
5555
filterMethod: params.filterMethod || config.filterMethod || 'include',
5656
filterArray: params.filterArray || config.filterArray || [],
5757
})

0 commit comments

Comments
 (0)