Skip to content

elAPI error message is incorrect about supported endpoints (pitfall of supporting backward incompatible eLabFTW versions) #147

@mhxion

Description

@mhxion

Discovered by @alexander-haller and @NicolasCARPi. This is an unfortunate bug. Since elAPI tends to support all eLabFTW versions including and above 4.5, it actually gives incorrect error message about which endpoints are actually supported for a specific version. The following example says it all.

alex@foo:/tmp$ elapi get team\_tags
{
  "code": 400,
  "message": "Bad Request",
  "description": "Use api/v2/teams/current/tags endpoint instead."
}

alex@foo:/tmp$ elapi get tags
Usage: elapi get [OPTIONS] ENDPOINT_NAME
Try 'elapi get --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Endpoint must be one of valid eLabFTW endpoints: apikeys, config, experiments, info, items, experiments_templates, items_types, events, team_tags, teams, todolist, unfinished_steps, users, idps, import, exports.                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

alex@foo:/tmp$ elapi get teams --sub tags -i current -H
<Prints response without error>

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions