diff options
| author | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-04 11:31:28 +0300 |
|---|---|---|
| committer | Alexander_Kabui <alexanderkabua@gmail.com> | 2026-10-05 21:53:57 +0300 |
| commit | a6a4a0efd270e8aa32a8f45eb6cc0203af240528 (patch) | |
| tree | daaa47fc651f534482c4160f832d022b5788a93d /test/python/test_openapi.py | |
| parent | a96a50963a7830cdc257a7452f15a6964262b947 (diff) | |
| download | genenetwork4-a6a4a0efd270e8aa32a8f45eb6cc0203af240528.tar.gz | |
* src/routes/search.rs (search): add GET /search, the phase-A gn3
search proxy.
Validates q/type/limit at the boundary (400 with suggestions; limit
capped at 100), forwards to {GN3_URL}/search/ with proper
percent-encoding, and re-wraps hits in the descriptive envelope.
Hits are typed as SearchHit (all 14 gn3 fields optional, unknown
fields preserved via serde flatten) so /openapi.json documents a
real schema while staying transparent to gn3 shape changes. gn3's
400+parsererror becomes 422 invalid_query carrying gn3's own
diagnostic; every other backend failure is one 502 shape
distinguished by code.
* src/lib.rs, src/routes/mod.rs (routes): register the search route.
* tests/search.rs, test/data/search_alcohol_phenotype.json (tests):
in-process gn3 stub replays the recorded production fixture; four
scenarios run offline -- passthrough+envelope, validation, 422
forwarding, limit cap.
Diffstat (limited to 'test/python/test_openapi.py')
0 files changed, 0 insertions, 0 deletions
