You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FETCH_MIGRATION.md
+21-22Lines changed: 21 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,13 @@ Fetch was selected as the new HTTP request library for this project due to its w
8
8
9
9
For more details see the initial discussion ([#754](https://github.com/kubernetes-client/javascript/issues/754)).
10
10
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
+
11
18
## Release cycle
12
19
13
20
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.
40
47
### Other repositories
41
48
42
49
-[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>
44
51
45
52
### Kubernetes-client repository
46
53
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
-
importfetchfrom'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)
0 commit comments