Fix taxa2tree: send link as a boolean, request the HTML route - #11
Open
bmesuere wants to merge 1 commit into
Open
Fix taxa2tree: send link as a boolean, request the HTML route#11bmesuere wants to merge 1 commit into
bmesuere wants to merge 1 commit into
Conversation
`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>
bmesuere
force-pushed
the
fix/taxa2tree-link-parameter
branch
from
August 18, 2026 12:53
b702099 to
834beeb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
umgap taxa2treereturnsInvalid request bodyfor every input. It has been completely broken against the live API.Cause. The request sends
args.url.to_string()forlink, 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: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.htmlroute (routes.rs:108), so this now requests that one unless--urlwas given.Also switched to
https; the endpoint was still being called over plainhttp.This fixes
scripts/umgap-visualize.sh -wtoo, which is built on this command — it was printingInvalid request bodyinto the output file.Still broken, but not ours
--urlruns but does not produce a usable link. unipept-api returns a hardcoded placeholder for the link option: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 --checkclean, andumgap taxa2treenow emits the HTML page for real input.