-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: Move all parameters from query to JSON body #105
Conversation
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.
Tested on security_guard and looks promising.
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.
Needs at least more documentation
cd537bc
to
6b02989
Compare
Signed-off-by: provokateurin <[email protected]>
71cfaff
to
826eaf2
Compare
I will still have to do some testing to ensure the updated specs are correct. |
My API unit test suite from https://github.com/nextcloud/neon/tree/main/packages/nextcloud/test confirms that these specs work exactly as intended. From my side this is ready to be merged. |
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.
Does this work fine with ocs_api_viewer
app?
It should, but let me give it a try |
Oof, it seems like ocs_api_viewer is broken in that regard because it doesn't send the body at all. This has to be a bug in the library as the body is also not added to the code examples, but I couldn't find an issue about it 🤔 |
After another quick check it makes somewhat sense: GET requests are "not allowed" to have request bodies, so this is likely why it is omitted. This is not really true though, as the spec does not forbid and it is just considered undefined behavior while most web servers just handle it right (See the note at the top of https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET). All other endpoints are fine, I was just unlucky to select a GET endpoint when I quickly tested it (or rather lucky because this way I found the problem). @come-nc @nickvergessen what do you think? |
Sounds okay. |
I’m fine with both solutions, either putting parameters into body only for non-GET requests, or for all of them. |
@nickvergessen do you want to do a final review or can I go ahead and merge? |
Go ahead, still having more than 700 unread emails and this is not a prio for me atm. |
Closes #88
This fixes a lot of cases where the query parameters was just typed as string because it was not possible to correctly set the type.