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/data | |
| 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/data')
| -rw-r--r-- | test/data/search_alcohol_phenotype.json | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/data/search_alcohol_phenotype.json b/test/data/search_alcohol_phenotype.json new file mode 100644 index 0000000..11efe64 --- /dev/null +++ b/test/data/search_alcohol_phenotype.json @@ -0,0 +1 @@ +[{"additive":0.377068891450584,"authors":["Mulligan MK","Adler A","Ingles J","Roy S","Weerasekera L","Lu L","Williams R"],"dataset":"C57BL-6JxC57BL-6NJF2Publish","dataset_fullname":"C57BL/6JxC57BL/6NJ F2 CROSS Phenotypes","description":"Central nervous system, behavior: Alcohol consumption, 5% alcohol consumption in the two-bottle choice paradigm measured alcohol consumed per kilogram body weight over 4 days [g/kg]","geno_chr":"14","geno_mb":90.847095,"group":"C57BL-6JxC57BL-6NJF2","inbredsetcode":"BRC","lrs":6.62875131299756,"mean":3.0200798533775886,"name":"10199","species":"mouse","year":2013},{"additive":0.606294259223918,"authors":["Mulligan MK","Adler A","Ingles J","Roy S","Weerasekera L","Lu L","Williams R"],"dataset":"C57BL-6JxC57BL-6NJF2Publish","dataset_fullname":"C57BL/6JxC57BL/6NJ F2 CROSS Phenotypes","description":"Central nervous system, behavior: Alcohol consumption, 10% alcohol consumption in the two-bottle choice paradigm measured alcohol consumed per kilogram body weight over 4 days [g/kg]","geno_chr":"6","geno_mb":145.24671,"group":"C57BL-6JxC57BL-6NJF2","inbredsetcode":"BRC","lrs":4.23305670639656,"mean":6.60806072090307,"name":"10200","species":"mouse","year":2013},{"additive":-1.10100209590788,"authors":["Mulligan MK","Adler A","Ingles J","Roy S","Weerasekera L","Lu L","Williams R"],"dataset":"C57BL-6JxC57BL-6NJF2Publish","dataset_fullname":"C57BL/6JxC57BL/6NJ F2 CROSS Phenotypes","description":"Central nervous system, behavior: Alcohol consumption, 15% alcohol consumption in the two-bottle choice paradigm measured alcohol consumed per kilogram body weight over 4 days [g/kg]","geno_chr":"4","geno_mb":65.944235,"group":"C57BL-6JxC57BL-6NJF2","inbredsetcode":"BRC","lrs":5.39335471040695,"mean":9.884343530334856,"name":"10201","species":"mouse","year":2013},{"additive":0.465560827479829,"authors":["Mulligan MK","Adler A","Ingles J","Roy S","Weerasekera L","Lu L","Williams R"],"dataset":"C57BL-6JxC57BL-6NJF2Publish","dataset_fullname":"C57BL/6JxC57BL/6NJ F2 CROSS Phenotypes","description":"Central nervous system, behavior: Alcohol consumption, 5% alcohol consumption in the two-bottle choice paradigm measured alcohol consumed per kilogram body weight over 4 days in females [g/kg]","geno_chr":"15","geno_mb":71.802121,"group":"C57BL-6JxC57BL-6NJF2","inbredsetcode":"BRC","lrs":4.60811099782063,"mean":3.418857609574822,"name":"10210","species":"mouse","year":2013},{"additive":0.932973708033573,"authors":["Mulligan MK","Adler A","Ingles J","Roy S","Weerasekera L","Lu L","Williams R"],"dataset":"C57BL-6JxC57BL-6NJF2Publish","dataset_fullname":"C57BL/6JxC57BL/6NJ F2 CROSS Phenotypes","description":"Central nervous system, behavior: Alcohol consumption, 10% alcohol consumption in the two-bottle choice paradigm measured alcohol consumed per kilogram body weight over 4 days in females [g/kg]","geno_chr":"17","geno_mb":26.854246,"group":"C57BL-6JxC57BL-6NJF2","inbredsetcode":"BRC","lrs":3.72495597970754,"mean":7.78438614240323,"name":"10211","species":"mouse","year":2013}] |
