Skip to content

Commit b9e7532

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 b9e7532

File tree

89 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.

89 files changed

+2280
-1575
lines changed

workspaces/frontend/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,25 @@ 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, first update the `swagger.version` file in the `scripts` directory to the desired commit hash of the backend's `swagger.json` file.
94+
95+
Then run the following command to update the generated code:
96+
97+
```bash
98+
npm run generate:api
99+
```
100+
101+
Finally, make any necessary adaptations based on the changes in the generated code.

0 commit comments

Comments
 (0)