Open mfioretti opened 6 years ago
Hi @mfioretti,
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.
From the API documentation for the PUT link
endpoint:
Update an existing link with provided request data. Keep in mind that all link’s fields will be updated.
Which is indeed not ideal as it does not allow for atomic operations on relevant fields.
Besides: "put-link --private true 2" , or e.g "put-link --title 'new title' does not work at all:
--private
sets the link visibility flag, and does not expect a boolean argument, e.g.:
shaarli put-link <parameters> 4
to update a link and set its visibility to publicshaarli put-link <parameters> --private 4
to update a link and set its visibility to privateHello @virtualtam .
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 https://github.com/shaarli/Shaarli/issues/1223, or should be worry about something else?
Thanks
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.
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: