django-react-boilerplate
django-react-boilerplate copied to clipboard
Set up client API code generation
Description
We will use the openapi-ts
tool to generate TypeScript client code for the frontend based on the backend schema generated by DRF-Spectacular
.
Motivation and Context
Screenshots (if appropriate):
Screencast from 14-05-2024 17:39:51.webm
Steps to reproduce (if appropriate):
- The project should be running properly.
- With docker
- Without docker
- Deployed (e.g.: Render)
- The API documentation pages should be working properly.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [X] My code follows the code style of this project.
- [X] My change requires documentation updates.
- [X] I have updated the documentation accordingly.
- [X] My change requires dependencies updates.
- [X] I have updated the dependencies accordingly.
Note: the security/snyk
step is failing due to an Uncontrolled resource consumption
issue on https://github.com/micromatch/braces. The issue was reported yesterday and there isn't a patch yet.
Overall LGTM, but can we add client generation to pre-commit?
I already added it to pre-commit
. See:
The frontend client generation script is triggered whenever the backend schema changes.
Nice @pamella , then all we need to merge here is passing snyk and explaining the pre-commit client generation on README.
I've made the fixes. I guess we will just have to wait for braces
to fix the vulnerability now. Hopefully, the will merge the in-progress PR soon :crossed_fingers:
I think we need to remove redux mentions from README. @pamella
I think we need to remove redux mentions from README. @pamella
Sorry, I missed it. Done (commit 37d8ba0)