Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve coverage of OpenAPI schemas #3444

Closed
Tracked by #3338
brojd opened this issue Nov 28, 2023 · 1 comment
Closed
Tracked by #3338

Improve coverage of OpenAPI schemas #3444

brojd opened this issue Nov 28, 2023 · 1 comment

Comments

@brojd
Copy link
Contributor

brojd commented Nov 28, 2023

Now that we have a simple way of generating TS type definitions based on OpenAPI schemas, in order to proceed with making use of it and improving type-safety of the frontend, we should try to increase coverage of OpenAPI schemas on the backend as much as we can.

This task is for assessing if current solution for OpenAPI schemas generation on the backend is still the way to go. If the answer is 'yes', then we should try to fix it so that OpenAPI schemas reflect real API contract. If the answer is 'no', let's explore alternatives.

Side note is that frontend has the ability to add custom properties to autogenerated types if needed, however, ideally we should aim to reduce usage of it. It should be used just as a temporary workaround to not block frontend progress rather than a target solution.

@vadimkerr
Copy link
Member

Based on the changes in #3629, I think drf-spectacular is still the best option to generate the OpenAPI schema. It has some learning curve to it and adds some maintenance overhead, but still it's pretty good at inferring types automatically for the most part and works reasonably well with our codebase.

Further backend-related action items:

iskhakov pushed a commit that referenced this issue Feb 20, 2024
Improves OpenAPI schema coverage for internal API:

- Fixes/Improves `alert group` and `feature` endpoints
- Adds `integration` and `user` endpoints

#3444

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants