-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
404 not implemented on PUT /api/tags/{unknown} #672
Comments
…Is the problem that you're expecting the PUT method to return 404 if the tag doesn't exist? The PUT method of There are, however, some issues I've noticed while researching this one:
|
Also this:
|
Yes exactly
Ok I had not realized it was the expected behaviour (I have not spent much time exploring the CLI). From an API perspective I find it disturbing to receive a |
This behavior also surprised me a lot but it seemed to be the expected one as is shown in the test_tag_api:
|
Problem is, it's a) unintuitive, and b) doesn't match CLI behaviour ( |
I agree it would be cleaner to accept a list of strings instead of a single comma-separated string on and the use of |
You mean like |
I think that “if you want to pass the list |
If you want to minimize logic changes, it could be changed the other way around: making the function accept a string (joined with spaces in case of CLI), and then the space/comma behaviour won't get in the way of comprehending the API contract. The "wrap in a single-item list" workaround can be done within the function then. |
Look i totally agree that 'awkward' is an understatement. All I have done was following what was done here. I am completely new to this project and was hoping to build off the API (which I started documenting manually using swagger), not rewriting inner workings that could potentially affect other features, especially since I haven't played with the CLI. I was also very confused from the get go by the way the tests were written (e.g., which brought me sideways. Thank you for taking the time to clarify all this with me and pointing out what needed to be changed. I think I get a better sense now that the API might not yet do exactly what it's supposed to do and it's not just documentation that is lacking. |
[#672] [bukuserver API] improve tag replacement/deletion
PUT
/api/tags/{unknown}
does indeed return a 400 response when no data is passed, which is tested in test_valid_idHowever, when passing valid data to the request, the response is 200 even when the tag doesn't exist. It should be 404 instead.
To reproduce, add these lines to test_tag_api and it should pass:
In curl:
I'd be happy to work on this. The
get
method in ApiTagView already raises the 404 so i would rely on it.The text was updated successfully, but these errors were encountered: