FastAPI route change
Use this skill when adding or modifying a FastAPI route under gtex_link/api/routes/.
Checklist
- Request model. Define or extend a Pydantic model in
gtex_link/models/requests.py. Field aliases map to GTEx Portal query parameters. Set sensible defaults and validators. - Response model. Define or extend the matching response model in
gtex_link/models/responses.py. Match upstream field names. - Service method. Add or update a method on
GTExServiceingtex_link/services/gtex_service.py. Wrap upstream calls in the existing caching/rate-limiting paths. Do not bypassGTExClient. - Route handler. Add the route in the appropriate file under
gtex_link/api/routes/. Reuse FastAPIDependsforGTExService. Return the Pydantic response model. - Tests.
- Route test under
tests/test_api/test_<category>_routes.pyusingrespxto stubhttps://gtexportal.org/api/v2/.... - Service test under
tests/test_services/for the new service method.
- Route test under
- Docs. If the route exposes a new GTEx endpoint, update
docs/README.mdand add per-endpoint markdown viapython docs/generate_endpoint_docs.pywhen the openapi spec is updated. - MCP exposure. Decide if this should be an MCP tool (see
mcp-tool-changeskill if yes). - CI. Run
make ci-localbefore pushing.
Source: berntpopp/gtex-link — distributed by TomeVault.