Skip to content

Commit 2b7ea5f

Browse files
committed
feat(ws): automate generation of types and HTTP client layer from Swagger definitions
Signed-off-by: Guilherme Caponetto <[email protected]>
1 parent 4f0a29d commit 2b7ea5f

File tree

90 files changed

+2280
-1575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2280
-1575
lines changed

.github/workflows/ws-frontend-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
- name: Clean
3636
working-directory: workspaces/frontend
3737
run: npm run build:clean
38+
39+
- name: Regenerate API layer code -- no diff expected
40+
working-directory: workspaces/frontend
41+
run: npm run generate:api
3842

3943
- name: Build
4044
working-directory: workspaces/frontend

workspaces/frontend/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,21 @@ Automatically fix linting issues:
7777
```bash
7878
npm run test:fix
7979
```
80+
81+
### API Types & Client Generation
82+
83+
The TypeScript types and the HTTP client layer for interacting with the backend APIs are automatically generated from the backend's `swagger.json` file. This ensures the frontend remains aligned with the backend API contract at all times.
84+
85+
#### Generated Code Location
86+
87+
All generated files live in the `src/generated` directory.
88+
89+
⚠️ Do not manually edit any files in this folder.
90+
91+
#### Updating the Generated Code
92+
93+
To update the generated code, run the following command:
94+
95+
```bash
96+
npm run generate:api
97+
```

0 commit comments

Comments
 (0)