Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md with --custom-config #550

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Options:
--another-array-type generate array types as Array<Type> (by default Type[]) (default: false)
--sort-types sort fields and types (default: false)
--extract-enums extract all enums from inline interface\type content to typescript enum construction (default: false)
--custom-config <string> allow to pass config file into CLI and not need to define nodejs
-h, --help display help for command

Commands:
Expand Down Expand Up @@ -200,8 +201,23 @@ generateTemplates({
rewrite: false,
})

```
You can also use --custom-config. Define your config file: `my-config.js`
```js
...
primitiveTypeConstructs: (constructs) => ({
...constructs,
string: {
'date-time': 'Date'
}
}),
...
```

`command:`
```bash
npx swagger-typescript-api --custom-config my-config.js -p ./swagger.json -o ./src -n myApi.ts
```

## 💎 options
### **`--templates`**
Expand Down