-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: first steps towards removing unnecessary APIv3 abstractions
We intentionally left a huge mess and a lot of magic in `fields.py`, `schemas.py`, and `docs.py` because it made the migration to Flask-RESTX a lot easier and we didn't know the correct abstractions beforehand. In this patch, I am proposing several refactors to simplify the code: - Schemas duplicated file types that were already-defined in `fields.py`. I am using the already defined ones to avoid duplication - There seems to be no need for separately defining schemas and models now. In the end, we care only about models and schemas were IIRC only an implementation detail. I am showing how to remove some schemas and define models directly. - Having every field defined as a variable in one giant pile in `fields.py` was a temporary measure. We can define the fields within models and then point to them to avoid duplication. See `project_fork_input_model` and its `ownername`.
- Loading branch information
Showing
2 changed files
with
69 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters