You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Usage section of the documentation says that "put-link" "Updates an existing link or note". This is not true. What it does is to transform a link into a private note with a different title. Even the example ("shaarli put-link --private 3252") in the documentation itself shows this.
Also, the inline help says:
(shaarli) [root@fima-01-hetzner ~]# shaarli -c /root/scripts/shaarli.conf put-link --help
usage: shaarli put-link [-h] [--description DESCRIPTION [DESCRIPTION ...]]
[--private] [--tags TAGS [TAGS ...]]
[--title TITLE [TITLE ...]] [--url URL]
resource
positional arguments:
resource Link ID
optional arguments:
-h, --help show this help message and exit
--description DESCRIPTION [DESCRIPTION ...]
Link description
--private Link visibility
--tags TAGS [TAGS ...]
List of tags associated with the link
--title TITLE [TITLE ...]
Link title
--url URL Link URL
but if add and then I try to update a link, it gets changed title, and URL, just like in the docs. But why should they change, if one only sets status to private?:
As we've haven't had much feedback on the REST API, there are some rough edges remaining on both the API itself, as well as the provided Python client.
I had NOT understood how the --private switch needs to be used, my bad!
As for the other issues... if every time I have to update a bookmark I have to pass to shaarli-client ALL its fields, even if only one changed, that is not ideal, but no big deal either, really. In my tests here, however, I noticed that sometimes shaarli-client did not return anything at all on STDOUT, even when it had succceeded. It should return the full json record of the updated bookmark, right? And when it returns nothing, can it be the memory issues of the php application mentioned at shaarli/Shaarli#1223, or should be worry about something else?
Which is indeed not ideal as it does not allow for atomic operations on relevant fields.
I think that would be a PATCH request. It can be added if it's needed.
@mfioretti I'm not really familiar with this client, but if the PHP API exhausts its memory, you will find an error in the PHP/webserver logs.
nodiscc
changed the title
wrong documentation about put-link?
put-link should update only specified fields instead of overwriting all fields
Apr 1, 2021
The Usage section of the documentation says that "put-link" "Updates an existing link or note". This is not true. What it does is to transform a link into a private note with a different title. Even the example ("shaarli put-link --private 3252") in the documentation itself shows this.
Also, the inline help says:
but if add and then I try to update a link, it gets changed title, and URL, just like in the docs. But why should they change, if one only sets status to private?:
Besides: "put-link --private true 2" , or e.g "put-link --title 'new title' does not work at all:
The text was updated successfully, but these errors were encountered: