-
Notifications
You must be signed in to change notification settings - Fork 51
Clean up API codebase by using idiomatic DRF and removing boilerplate #194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is HUGE. The separation of documentation from the app code is really appreciated, and though seems like the extra layers of DRF make the curve steeper for new contributors, I believe the benefits should pay off in the long run, given your exposed points.
I also want to highlight this quote of yours for future PRs:
Preferably make individual atomic PRs addressing one issue at a time, so that they can be reviewed and merged faster.
That said, thanks for all this good work!
Really sorry about the size @krysal, and thanks for the review. I tried making small PRs but all the changes were so interdependent on each other. I'll definitely try harder in the next one. |
@obulat and/or @sarayourfriend we could use 👀 on this PR; thank you! |
I've tried to review this PR a couple times but I really can't comment on its changes, they're just too many for me to keep track of especially with how little knowledge I have of the pre-existing code. Hopefully @obulat is in a better position to help than I am, sorry! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great cleanup, and tests pass :) I've learned a lot by reviewing, thank you!
@@ -0,0 +1,116 @@ | |||
# Introduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these docs go to the make handbook, just like the Catalog and Frontend docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because they kind of have to live here: https://api.openverse.engineering/v1/ and I don't see a strong reason to duplicate the information. We should however add a link and reference to the API docs in the handbook.
Fixes
Fixes #181 by @dhruvkb
Partially addresses WordPress/openverse#747 by @dhruvkb
Description
This PR consolidates API endpoints into an inheritance based model using DRF viewsets. This vastly reduces the amount of boilerplate code.
This PR
APIView
s with code repetition into highly abstractedViewSet
sRouter
to automatically setup URL mappings forAPIView
endpointsChecklist
Update index.md
).main
ormaster
).Developer Certificate of Origin
Developer Certificate of Origin