about summary refs log tree commit diff
path: root/test/python/test_openapi.py
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-10 12:34:53 +0000
committerPjotr <wrk@bosa.lan>2026-11-10 12:34:53 +0000
commit2b41fc94a5e2b33a411d22721a6ee2a97ac9ae60 (patch)
tree6292c0b625e616c08bbb767bc986c0b0646ab94f /test/python/test_openapi.py
parente0bbc56324cc7a6bd563f0dadd7163a93b8b4ad8 (diff)
downloadgenenetwork4-2b41fc94a5e2b33a411d22721a6ee2a97ac9ae60.tar.gz
api: every response suggests where to go next
A caller that knows only /version should be able to reach anything by
following links. Until now `next` was thin and uneven: the genotype
subtree offered none at all, the group record offered one, /version
offered nothing, and two links it did offer could not be followed.

  * suggest:: now builds the graph: root_links (groups, species,
    mapping-methods, openapi), genotype_version_links (frequencies,
    marker names, a marker's location and tally, the group, the scanning
    actions), unlisted_genotype_links, marker_links (location, tally,
    marker list, panel tally, PheWAS at that marker), group_links and
    trait_links. Envelope::with_links / with_links_except add them,
    deduplicating and never suggesting the response the caller is
    already reading.
  * Wired through the genotype surface (listing, version detail, markers,
    location), both frequencies routes, the compute endpoints, groups,
    traits, both value routes, species, datasets, publications,
    accessions, search, mapping methods, phewas, correlation and
    /version.
  * Fixed what was not followable, because `next` promises a GET that
    returns 200 and a client is the one that finds out otherwise:
    - /groups/{g}/phewas without a locus is a 422. Bare PheWAS links are
      gone; comput endpoints now link ?locus=<their strongest marker>
      (suggest::peak_marker_of, computed before the rows move).
    - /datasets and /publications are not routes; root_links offers the
      listings that exist (/groups, /species, /mapping-methods) and
      /openapi.json.
    - /search?q= with an empty query is a 400, so it is not a link.
    - the correlation endpoint's "/compute/correlation" was a POST in
      `next`; it is in `actions` now.
    - marker_links pointed at /markers/{marker}, which is not a route;
      it points at /markers/{marker}/location.

tests/links.rs walks the graph two hops from a dozen seeds and fails on
any link that does not answer 200, plus a check that a tally leads to the
marker list and to a marker's location, and a location to that marker's
tally and its PheWAS.
Diffstat (limited to 'test/python/test_openapi.py')
0 files changed, 0 insertions, 0 deletions