Skip to content

Commit f274cbf

Browse files
authored
Merge pull request #779 from davidgamero/feb222-update
feb 22 update
2 parents 07ecbb9 + ca49cf2 commit f274cbf

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

FETCH_MIGRATION.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ Fetch was selected as the new HTTP request library for this project due to its w
88

99
For more details see the initial discussion ([#754](https://github.com/kubernetes-client/javascript/issues/754)).
1010

11+
Edit 02/2022:
12+
13+
Since the OpenApiGenerator project is targeting a single `typescript` generator (instead of individual networking flavors eg: typescript-fetch, typescript-axios) that includes node-fetch support, the initial plans to import and inject node-fetch is no longer optimal.
14+
15+
The proposed changes have been implemented on the new `typescript` generator which includes changes to the authentication and authorization interface that now uses a `RequestContext` object instead of directly allowing access to the https request options. In order to bridge the existing javascript client auth methods, additional exposure via custom SecurityAuthentication support has [been merged](https://github.com/OpenAPITools/openapi-generator/pull/11321) into the typescript generator.
16+
17+
1118
## Release cycle
1219

1320
The fetch generator will create breaking changes to this project's API. Consumers will have to make small modifications to their code to upgrade.
@@ -40,31 +47,23 @@ Code will be on the `master` branch.
4047
### Other repositories
4148

4249
- [x] Update [kubernetes-client/gen](https://github.com/kubernetes-client/gen)'s typescript-fetch files to let us pass in the `typescriptThreePlus` config option <sup>[1](https://github.com/OpenAPITools/openapi-generator/issues/9973) [2](https://github.com/OpenAPITools/openapi-generator/issues/3869#issuecomment-584152932)</sub>
43-
- [ ] Update [openapi-generator](https://github.com/OpenAPITools/openapi-generator)'s typescript-fetch flavor to mark parameters as optional if all parameters are optional <sup>[3](https://github.com/OpenAPITools/openapi-generator/issues/6440)</sup>
50+
- [x] Update [openapi-generator](https://github.com/OpenAPITools/openapi-generator)'s typescript-fetch flavor to mark parameters as optional if all parameters are optional <sup>[3](https://github.com/OpenAPITools/openapi-generator/issues/6440)</sup>
4451

4552
### Kubernetes-client repository
4653

47-
- [ ] Increment `OPENAPI_GENERATOR_COMMIT` to be [version 5.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.0) (with the optional parameters addition)
48-
- [ ] `npm install node-fetch` to install node-fetch
49-
- [ ] Switch generate-client script to use typescript-fetch
50-
- [ ] Import and inject node-fetch in `src/api.ts` with the following
51-
52-
```typescript
53-
import fetch from 'node-fetch';
54-
55-
// inject node-fetch
56-
if (!globalThis.fetch) {
57-
// @ts-ignore
58-
globalThis.fetch = fetch;
59-
globalThis.Headers = Headers;
60-
globalThis.Request = Request;
61-
globalThis.Response = Response;
62-
}
63-
```
64-
65-
- [ ] Generate api with `npm run generate`
66-
- [ ] Match src/gen/api.ts to new generated layout (it changes slightly)
67-
- [ ] Fix errors in /src folder (due to new api)
54+
- [x] Increment `OPENAPI_GENERATOR_COMMIT` to be [version 5.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.0) (with the optional parameters addition)
55+
- [x] `npm install node-fetch` to install node-fetch
56+
- [ ] ~~Switch generate-client script to use typescript-fetch~~ (see edit 02/2022)
57+
- [ ] ~~Import and inject node-fetch in `src/api.ts`~~ (see edit 02/2022)
58+
59+
- [x] Generate api with `npm run generate`
60+
- [x] Match src/gen/api.ts to new generated layout (it changes slightly)
61+
62+
- [ ] Fix errors in /src folder (due to new generated api)
63+
- [ ] Migrate watch.ts to use node-fetch
64+
- [ ] Migrate log.ts to use node-fetch
65+
- [ ] Migrate metrics.ts to use node-fetch
66+
- [ ] Migrate HttpError Usage to HttpException (following new OpenApiGen convention)
6867
- [ ] Fix errors in test (due to new api)
6968
- [ ] Test all features
7069
- [ ] Fix examples (due to new api)

0 commit comments

Comments
 (0)