workspace icon indicating copy to clipboard operation
workspace copied to clipboard

API is inconsistent in itself and compared to other apps and core

Open donquixote opened this issue 2 years ago • 1 comments

Hello, I notice some inconsistencies in the API of the workspace app. https://github.com/arawa/workspace/blob/main/appinfo/routes.php (I don't know where else to look for documentation)

  • Some urls are like /spaces, others like /workspaces, and sometimes /api/workspace/*. In some cases these do the same, in others not. In other apps or core, there is usually one main path (e.g. apps/groupfolders/folders), and the main difference is just method POST vs GET vs PUT vs DELETE etc, and a minimal suffix to target a specific id.
  • Responses from workspace have all the info at the top level. In other apps or core, there is ocs: {meta: {..}, data: {..}}.
  • Seems like page#index is a leftover?
  • Property names are inconsistent. E.g. sometimes we have 'folderId', other times 'folder_id' or 'groupfolder_id'
  • 'groups' sometimes is an array of group ids, another time it is an array of arrays each with id and display name.

Do you have any plans to change this?

donquixote avatar Jan 25 '23 02:01 donquixote

Hello,

Yes, I created an issue on this subject : https://github.com/arawa/workspace/issues/647. I would like the route POST workspace/spaces with spacename as a variable to be able to do these steps backend side :

  • Create a groupfolder
  • Enable ACL
  • Add groups in the groupfolder
  • Add one group in the Advanced Permissions

We are studying how to implement it while respecting the Nextcloud's guidelines.

zak39 avatar Aug 04 '23 11:08 zak39