-
-
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
[bukuserver API] improve tag replacement/deletion #676
Conversation
To clarify:
It's better to make the input format straightforward instead of working around a tricky one whenever you use the function. A simple "accepting a list & processing it as-is" is a much better behaviour for a function API than "accepting a list and mashing its contents together in a way that takes effort to describe".
Since this API appears to be going for RESTful approach, it's probably better to make deletion a separate operation, instead of combining it with edit operation. (…The reasoning is the same here, come to think of it: web/library API doesn't have the same limitations as CLI so there's no need to complicate it by imposing them anyway.) P.S. You may want to amend existing commits & force-push your changes instead of adding new commits; the repo owner prefers to avoid having multiple small commits (but he doesn't want to use squash-merge). |
@LeXofLeviafan can you have a look at the build failure on master? |
@jarun the only thing that fails to pass on current master is |
Why can't we remove the else? What is this syntax |
@2ynn try doing a rebase on |
Hi @LeXofLeviafan, I checked out the
|
3a80c36
to
1b4ef86
Compare
…I've looked it over, and found that the cause here is likely twofold:
In other words, what should be changed isn't the value check but the db setup section. (…As for exact reason why you're not getting back a webpage when fetching |
Hi @LeXofLeviafan, thanks for your review and sorry again for disappearing :/
|
You may want to run the tests locally (possibly on freshly reinstalled venv if you're not using |
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.
These and the nonexistent-variable one are causing the flake8
check to fail.
The unit tests are failing on master as well, so I reported a bug regarding the error (#698).
Tests were fixed in upstream; your branch should be passing once you rebase and fix |
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.
…Incidentally, here's a quote from the very first comment:
P.S. You may want to amend existing commits & force-push your changes instead of adding new commits; the repo owner prefers to avoid having multiple small commits (but he doesn't want to use squash-merge).
(Multiple commits can be squashed together using soft-reset + amend)
@LeXofLeviafan please merge when this is ready. |
…Merging as requested. |
…Incidentally, I suggest referencing the issue in commit name next time (not the pull-request) 😅 Also linking the pull-request to the issue is generally a good idea (happens automatically if its description is worded accordingly). |
Addresses most comments made by @LeXofLeviafan in issue #672
ApiTagView.put()
(PUT/api/tags/<tag>
) now expects a list of strings as arguments instead of a comma-separated string. Passing an empty list results in bad response 400.A separate
ApiTagView.delete()
method was added to delete an existing tag (DELETE/api/tags/<tag>
).A trailing slash is now permitted on
GET /api/tags/
route.ORIGINAL DESCRIPTION
_0. Clarify the expected data type received in ApiTagView.put:
PUT /api/tags/ now returns 400 if no string is passed as input data
ApiTagView.put()
to update an existing tag with multiple ones by passing a single, comma-separated string. Instead of modifying the behavior ofreplace_tag()
, which in my opinion would come with too many side effects, I have decided to wrap thenew_tags
comma-separated string into a list, in the same way as it is done in the TagModelView.update_model() method.Passing
{tags: ''}
as data toPUT /api/tags/<tag>
now makes it possible to delete an existing tag.The
delete_tag_at_index()
function is now called withchatty=False
to bypass confirmation. To do so, an additional optional argumentchatty
had to be added to thereplace_tag()
function.strict_slashes=False
to all api endpointstest_bookmark_range_api
was not passing on master due to bookmark titles not matching between parametrization and assertion._