tb1337 / paperless-api

Little api client for paperless(-ngx).
https://pypi.org/p/pypaperless/
MIT License
24 stars 5 forks source link

status API endpoint erroneously found missing #197

Closed madduck closed 1 month ago

madduck commented 1 month ago

I get

Outdated version detected. Missing features: status Consider pulling the latest version of Paperless-ngx.

despite using the latest version. The reason is that /api/status/ does not show up in the browseable API listing served by the Django REST framework. This is due to the framework only including "ViewSets", of which /api/status/ isn't one.

According to the Paperless devs, it would be more effort than worth to expose the endpoint in the browseable listing, and this won't happen any time soon. See the discussion here.

I see three solutions:

  1. Special-case /api/status/ and remove it from the set of missing features, because it's expected to be missing.
  2. Call /api/status/ and inspect the pngx_version field.
  3. Pass v4 into a requests until the API is ready to handle a future v5 and beyond. If run against a pre-v4 API of PNGX, you'll get a 406 response.

Personally, I think the third is the best way forward.