Wire GWAS Catalog REST API: studies, single study, count#1
Merged
Conversation
Replace scaffold boilerplate in gwas/ with a real implementation against https://www.ebi.ac.uk/gwas/rest/api. Three operations: recent (paginated study list), study (single fetch by accession), count (total studies). Wire types decode the Spring HATEOAS HAL envelope; exported Study and Count carry kit struct tags for CLI/MCP output. Five gwas_test.go cases cover search, single get, count, 503 retry timing, and backoff formula; five domain_test.go cases cover scheme, classify, empty-input error, locate, and unknown-type error.
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.
Summary
gwas/with a working implementation against the GWAS Catalog REST API (https://www.ebi.ac.uk/gwas/rest/api)gwas recent(paginated studies),gwas study <accession>(single fetch),gwas count(total studies)StudyandCountexported types carrykitstruct tags for CLI/MCP/API outputTest plan
go test ./...passes — 10 tests, no live network calls (all httptest)go build ./...passes — clean buildTestSearchStudies— mock HAL response with 2 studies, verify IDs and traits, total countTestGetStudy— mock single-study response, verify accession and PubMedIDTestGetCount— verifypage.totalElementsread correctly (1142122)TestRetryOn503— 2x503 then success, timing >500msTestBackoff— backoff(1)=500ms, backoff(10)=5sTestDomainInfo— scheme="gwas"TestClassify/TestClassifyEmpty— accession round-trip and empty-input errorTestLocate/TestLocateUnknown— correct URL and unknown-type error