-
Notifications
You must be signed in to change notification settings - Fork 106
[API 2.0] - Unexpected response in "Create folder" #906
Comments
I see, the misunderstanding here is due to the fact that for error cases, only the HTTP status codes should be considered. So to rephrase your request: Basically you want the POST method to return the same response as in a GET request if it exists? |
Yes 👍 (But return the information only for the requested folder - do not return infos about all folders) I mean it's not a "real" error that the folder already exists. So returning the id and name seems appropriate. |
Makes sense (also according to #rubyonrails) but would cause an API break. We should schedule this for API 2.0 ;) For now I'd recommend to just fetch all folders via GET /folders and only create non existent folders ;) |
Btw. I think it's the same issue in the "Create a feed" method. |
Yep, and also in all updates (which should become PATCH instead of PUT) and deletions |
I've added this issue to the initial proposal in #862, let's keep the API stuff together ;) |
I'm currently working on an import tool for opml files.
For simplicity reasons I'm just creating every folder (even if it exists). The doc (https://github.com/owncloud/news/wiki/Folders-1.2#create-a-folder) states that the result contains the folder id and name. But the result only contains "{"message":"Can not add folder: Exists already"}".
I think the result should be the id and the folder name (as described in the doc). Because the status code indicates that it already exists.
The text was updated successfully, but these errors were encountered: