From 21d5607013c1733ca6cd76fd00f9b727fccd316a Mon Sep 17 00:00:00 2001 From: Brian To Date: Fri, 14 Jul 2023 14:20:40 +0700 Subject: [PATCH] Update README.md with --custom-config --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 12994d4f..1a5060c4 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Options: --another-array-type generate array types as Array (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 allow to pass config file into CLI and not need to define nodejs -h, --help display help for command Commands: @@ -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`**