OCM-API icon indicating copy to clipboard operation
OCM-API copied to clipboard

create new share: indicate resource type

Open moscicki opened this issue 8 years ago • 5 comments

POST /shares

Shouldn't we possibly include a type of the shared resource so the receiver may interpret correctly what is shared? Which should or could be enumerated value in the set “file”, “folder”.

moscicki avatar Feb 16 '17 09:02 moscicki

I agree. But, in the case of a file, would you also like to know what kind of file it is? E.g. the mime-type of the file to be able to show an Excel logo if it's an Excel file?

dvh avatar Feb 16 '17 15:02 dvh

I agree that a share type would make a lot of sense

Which should or could be enumerated value in the set “file”, “folder”.

At Nextcloud we want to extend federated sharing beyond files in the future, e.g sharing a address book, a calendar, etc. So a type would be really useful and I wouldn't limit it to "file" and "folder". The server then can just reject share types it doesn't know.

schiessle avatar Feb 20 '17 14:02 schiessle

So we should introduce a non-enumerated filetype field?

dvh avatar Feb 21 '17 12:02 dvh

At a minimum we should introduce this field, with at least the possibility for file and folder. The problem with accepting other values is will we then end up with a fragmented set of share options for each of the types between vendors?

tomneedham avatar Apr 11 '18 08:04 tomneedham

At a minimum we should introduce this field, with at least the possibility for file and folder.

In good Unix tradition just 'file' might be enough. In order to know how to handle the share a distinction between files and folder might not be necessary. As for other share types I would follow the XMPP example and allow extensions to the standard. For example if we at Nextcloud implement calendar sharing we will provide a definition of the share type "calendar". We can then discuss it, agree on it in order to make it a "official" extension and improve/enhance it if necessary. All extensions will be optional. If a solution receives a share with a share type it doesn't know/implements it just returns 501 and done.

But I would suggest to hold this discussion a little bit back for now. We at Nextcloud making good progress implementing OCM and will soon come back to you with some suggestions based on a real world implementation so we don't have to discuss in theory but based on stuff which we know that it works.

schiessle avatar Apr 20 '18 08:04 schiessle

This is effectively the case in the specs, already as of v1.0

glpatcern avatar Jul 24 '23 08:07 glpatcern