-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
OCS Share API to appframework #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@rullzer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @schiessle, @nickvergessen and @icewind1991 to be potential reviewers |
|
The thing here is that we can't use all (we can use some) of the standard AppFramework responses. Since here we want to add a message often as well (to not change the output of the API). Should we add OCSNotFoundResponse etc? @BernhardPosselt @LukasReschke @icewind1991 @nickvergessen @MorrisJobke |
|
Depends really. You could use a trait like https://github.com/owncloud/app-tutorial/blob/master/controller/errors.php#L13 or implement an afterException hook in a middleware that responds to an OCSNotFoundException, you could add a shortcut function, custom response type etc etc :D |
|
Fair enough. Maybe an OCSMiddleware that lives in core would not be so bad. Then it just catches OCS***Exceptions. |
|
There's definitely a benefit in adding a type for these well defined cases since it makes it harder to make mistakes. Types and Exceptions are sometimes hard to distinguish and other languages actually only have types (e.g. Result<String, Error> where String is the success case and Error the error case) Ultimately I like the exception approach a little bit more than the custom response because I think its more idiomatic. However both approaches can and should work fine :) |
|
After thinking about it I think I prefer the exceptions as well. I'll create a PR soonish and let you know. |
3e9d360 to
78f4a8e
Compare
|
Rebase on #475 once in... |
a4f8e90 to
21a140b
Compare
|
Needs: #480 |
6ef5ec8 to
e067f73
Compare
|
Ok finally time to review. A lot is rewriting the tests. But I think this cleaned up the code alread pretty good. |
| $this->assertFalse($result->succeeded()); | ||
| try { | ||
| $ocs->createShare(); | ||
| $this->fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that one 👍
|
@MorrisJobke ah mmm I get that to. Let me check why. |
e067f73 to
c2c58d2
Compare
|
Rebased on master. @LukasReschke @rullzer Is the above mentioned issue fixed with this then? |
7c328f0 to
55a4d53
Compare
|
@MorrisJobke it is now. |
|
Ah joy this breaks the intergration tests... because we did not set the header there. |
2b216d4 to
6b64109
Compare
|
All fixed. @LukasReschke @schiessle @nickvergessen final review? |
|
6b64109 to
b62510d
Compare
|
Conflicts resolved. |
| * The getShares function. | ||
| * | ||
| * @NoAdminRequired | ||
| d * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
* This will cleanup the locks after each request * Move check for enabled share api to the middleware
b62510d to
dd9f195
Compare
|
Still works 👍 |
|
👍 |
…work OCS Share API to appframework

First OCS API to be ported.
TODO: