Skip to content

Commit 42cce36

Browse files
committed
minor: cleanup parameters
1 parent 854e8c0 commit 42cce36

37 files changed

+14510
-6303
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ updates:
55
schedule:
66
interval: monthly
77
time: "04:00"
8-
open-pull-requests-limit: 10
9-
ignore:
10-
- dependency-name: "@types/node-fetch"
11-
- dependency-name: "node-fetch"
8+
open-pull-requests-limit: 10

README.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
1515
- Quick, lightweight, robust and framework-agnostic 🚀
1616
- Supports generation of TypeScript clients
17-
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support) and XHR http clients
17+
- Supports generations of [Axios](#axios-support) client
1818
- Supports OpenAPI specification v2.0 and v3.0
1919
- Supports JSON and YAML files for input
2020
- Supports generation through CLI, Node.js and NPX
@@ -411,7 +411,7 @@ openapi --input ./spec.json --output ./dist --exportClient true --name DemoAppCl
411411
The generated client will be exported from the `index` file and can be used as shown below:
412412
```typescript
413413
// create the client instance with server and authentication details
414-
const appClient = new DemoAppClient({ BASE: 'http://server-host.com', TOKEN: '1234' });
414+
const appClient = new DemoAppClient({ base: 'http://server-host.com', token: '1234' });
415415

416416
// use the client instance to make the API call
417417
const res: OrganizationResponse = await appClient.organizations.createOrganization({
@@ -488,31 +488,6 @@ npm install [email protected] --save-dev
488488
In order to compile the project and resolve the imports, you will need to enable the `allowSyntheticDefaultImports`
489489
in your `tsconfig.json` file.
490490

491-
492-
### Node-Fetch support
493-
By default, this tool will generate a client that is compatible with the (browser based) Fetch API.
494-
However, this client will not work inside the Node.js environment. If you want to generate the Node.js compatible
495-
client then you can specify `--client node` in the openapi call:
496-
497-
`openapi --input ./spec.json --output ./dist --client node`
498-
499-
This will generate a client that uses [`node-fetch`](https://www.npmjs.com/package/node-fetch) internally. However,
500-
in order to compile and run this client, you might need to install the `[email protected]` dependencies.
501-
502-
> Since version 3.x [`node-fetch`](https://www.npmjs.com/package/node-fetch) switched to ESM only,
503-
> breaking many CommonJS based toolchains (like Jest). Right now we do not support this new version!
504-
505-
```
506-
npm install @types/[email protected] --save-dev
507-
npm install [email protected] --save-dev
508-
npm install [email protected] --save-dev
509-
npm install [email protected] --save-dev
510-
```
511-
512-
In order to compile the project and resolve the imports, you will need to enable the `allowSyntheticDefaultImports`
513-
in your `tsconfig.json` file.
514-
515-
516491
[npm-url]: https://www.npmjs.com/package/@ciptex/openapi-typescript-codegen
517492
[npm-image]: https://img.shields.io/npm/v/@ciptex/openapi-typescript-codegen.svg
518493
[license-url]: LICENSE

bin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const params = program
1010
.name('openapi')
1111
.usage('[options]')
1212
.version(pkg.version)
13-
.requiredOption('-i, --input <value>', 'OpenAPI specification, can be a path, url or string content (required)')
13+
.requiredOption('-i, --input <value>', ' specification, can be a path, url or string content (required)')
1414
.requiredOption('-o, --output <value>', 'Output directory (required)')
1515
.option('-c, --client <value>', 'HTTP client to generate [fetch, xhr, node, axios]', 'fetch')
1616
.option('--useOptions', 'Use options instead of arguments')

0 commit comments

Comments
 (0)