Skip to content

Fix taxa2tree: send link as a boolean, request the HTML route - #11

Open
bmesuere wants to merge 1 commit into
phase1/ci-and-test-fixfrom
fix/taxa2tree-link-parameter
Open

Fix taxa2tree: send link as a boolean, request the HTML route#11
bmesuere wants to merge 1 commit into
phase1/ci-and-test-fixfrom
fix/taxa2tree-link-parameter

Conversation

@bmesuere

@bmesuere bmesuere commented Aug 18, 2026

Copy link
Copy Markdown
Member

umgap taxa2tree returns Invalid request body for every input. It has been completely broken against the live API.

Cause. The request sends args.url.to_string() for link, which puts the string "false" in the JSON where the API expects a boolean. The API deserializes the body through an untagged enum, so the type mismatch makes both variants fail to match and the whole request is rejected:

{"counts":{"562":2},"link":"false"}   ->  Invalid request body
{"counts":{"562":2},"link":false}     ->  {"id":1,"name":"Organism",...}

Second problem. With that fixed the command returned JSON, while its own docs say umgap taxa2tree < input.txt > output.html. The API serves the interactive page from a separate .html route (routes.rs:108), so this now requests that one unless --url was given.

Also switched to https; the endpoint was still being called over plain http.

This fixes scripts/umgap-visualize.sh -w too, which is built on this command — it was printing Invalid request body into the output file.

Still broken, but not ours

--url runs but does not produce a usable link. unipept-api returns a hardcoded placeholder for the link option:

if link {
    return TreeInformation::Link { gist: "test".to_string() };
}

so it answers {"gist":"test"} regardless of input. Worth an issue on that repo; nothing UMGAP can do about it.

Verification

Locally, with the toolchains CI uses: 38 tests pass, cargo +nightly fmt --check clean, and umgap taxa2tree now emits the HTML page for real input.

Copilot AI lite review requested due to automatic review settings August 18, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bmesuere
bmesuere changed the base branch from master to phase1/ci-and-test-fix August 18, 2026 12:52
`umgap taxa2tree` has been returning "Invalid request body" for every input.

The request sends `args.url.to_string()` for the `link` field, which puts the
string "false" in the JSON where the API expects a boolean. Since the API
deserializes the body through an untagged enum, the type mismatch makes both
variants fail to match and the whole request is rejected.

    {"counts":{"562":2},"link":"false"}  -> Invalid request body
    {"counts":{"562":2},"link":false}    -> the tree

With that fixed, the command returned JSON where it documents an HTML page.
The API serves the interactive page from a separate `.html` route, so request
that one unless `--url` was given.

Also switched to https, the endpoint was still being called over plain http.

This also fixes `scripts/umgap-visualize.sh -w`, which is built on this
command.

Note that `--url` still does not produce a usable link, but that one is not
ours to fix: the API returns a hardcoded placeholder for the link option
(`TreeInformation::Link { gist: "test".to_string() }` in unipept-api), so it
answers `{"gist":"test"}` regardless of input.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants