Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

[API 2.0] - Unexpected response in "Create folder" #906

Closed
David-Development opened this issue Jan 13, 2016 · 6 comments
Closed

[API 2.0] - Unexpected response in "Create folder" #906

David-Development opened this issue Jan 13, 2016 · 6 comments

Comments

@David-Development
Copy link
Contributor

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.

@BernhardPosselt
Copy link
Contributor

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?

@David-Development
Copy link
Contributor Author

Yes 👍 (But return the information only for the requested folder - do not return infos about all folders)
It should be the same response as if the "create" operation succeeded.

I mean it's not a "real" error that the folder already exists. So returning the id and name seems appropriate.

@BernhardPosselt
Copy link
Contributor

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 ;)

@BernhardPosselt BernhardPosselt changed the title [API 1.2] - Unexpected response in "Create folder" [API 2.0] - Unexpected response in "Create folder" Jan 13, 2016
@David-Development
Copy link
Contributor Author

Btw. I think it's the same issue in the "Create a feed" method.

@BernhardPosselt
Copy link
Contributor

Yep, and also in all updates (which should become PATCH instead of PUT) and deletions

@BernhardPosselt
Copy link
Contributor

I've added this issue to the initial proposal in #862, let's keep the API stuff together ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants