Skip to content
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

"Edit bookmark" API docs do not mention required fields correctly #769

Open
msfjarvis opened this issue Oct 27, 2023 · 0 comments
Open

"Edit bookmark" API docs do not mention required fields correctly #769

msfjarvis opened this issue Oct 27, 2023 · 0 comments

Comments

@msfjarvis
Copy link

Data

  • Shiori version: v1.5.5
  • Database Engine: SQLite
  • Operating system: Linux
  • CLI/Web interface/Web Extension: API

Describe the bug / actual behavior

The API docs for the edit bookmark action say that you need to provide an id to identify the bookmark being edited, and then provide the modified fields.

After creating a bookmark, if I try to edit it via the API and introduce a tag with the following JSON body

{
  "id": 1,
  "tags": [
    {
      "name": "examples"
    }
  ]
}

The server returns a HTTP 500 error with the message: title must not be empty.
After I add the title, I still get an HTTP 500 error but with the message: failed to clean URL: URL is not valid

After both title and url are added to the JSON, API request succeeds

{
  "id": 1,
  "title": "Example Domain",
  "url": "https://example.com",
  "tags": [
    {
      "name": "examples"
    }
  ]
}

This is in disagreement with the documentation since in this situation neither the title nor url were being modified, and hence should not have been required.

Expected behavior

The API docs either mention that the title and URL fields are always required, or the server is modified to match the documentation.

Notes

I discovered the problem from integration testing while trying to write an API client for Shiori to use in my Android app

I've gotten rid of the "Steps to reproduce" heading since it seemed tedious and unnecessary to note down all the steps I did in httpie, but I can do it if it helps, just ask.

@msfjarvis msfjarvis added the type:bug Something isn't working label Oct 27, 2023
@fmartingr fmartingr added type:documentation and removed type:bug Something isn't working labels Oct 29, 2023
@fmartingr fmartingr added this to the 1.6.3 milestone Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

2 participants