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
chore: migrate from openapi-typescript-codegen to @hey-api/openapi-ts
Replace the unmaintained openapi-typescript-codegen with @hey-api/openapi-ts
and @hey-api/client-fetch.
- Replace openapi-typescript-codegen with @hey-api/openapi-ts (dev) and
@hey-api/client-fetch (runtime)
- Add openapi-ts.config.ts with @hey-api/client-fetch, @hey-api/typescript,
and @hey-api/sdk plugins
- Switch to flat tree-shakeable functions instead of class-based services
- Update operation_ids to entity-prefixed names (e.g. createTodo, getAllTodos)
- Replace OpenAPI.BASE/TOKEN with client.setConfig({ baseUrl, auth })
- Update useTodoAPI hook to new SDK function signatures
- Add 'generate' npm script for running codegen via pinned dependency
- Update mise task and documentation
To generate the typescript client for the API, run:
4
4
5
5
```shell
6
6
cd web
7
-
./generate-api-client.sh
7
+
yarn generate
8
8
```
9
9
10
-
This will populate `web/src/api/generated` with new typescript files that matches the API OpenAPI specification.
10
+
This uses the configuration in `web/openapi-ts.config.ts` and populates `web/src/api/generated` with new typescript files that match the API's OpenAPI specification.
0 commit comments