revanced-api icon indicating copy to clipboard operation
revanced-api copied to clipboard

fix: properly abstract the backend from the frontend

Open oSumAtrIX opened this issue 2 years ago • 1 comments

Issue

Currently, the API returns keywords such as "repository" or "login" propagating the backend naming schema (GitHub) but it does not make sense in the sense of the frontend of the API to mention them. ReVanced API clients don't have anything to do with GitHub.

  • /v2/team/members mentions "login".
  • /v2/{repo}/contributors mentions "repo" in the path as well as "GitHub" in the documentation

Solution

Properly transform the backend and abstract it in the API. As an example /v2/team/members can mention "name" instead of "login" and /v2/{repo}/contributors can mention "product" instead of "repo".

oSumAtrIX avatar Jul 13 '23 16:07 oSumAtrIX

This is primarily a documentation issue; not much has to be done refactor-wise. The propagation happened because as I built the main backend on top of GitHub's REST API, the automatic generation of docstrings picked up their API terms. I've put this in the backlog with a low priority because this effort is better done once we have all the endpoints structured adequately so I don't have too much rework.

alexandreteles avatar Jul 13 '23 16:07 alexandreteles