---
estimated_steps: 1
estimated_files: 2
skills_used: []
---

# T01: Add GET /topics/{category_slug}/{subtopic_slug} endpoint with integration test

Add a new endpoint to routers/topics.py that returns paginated techniques filtered by sub-topic tag. The endpoint matches the subtopic_slug against the topic_tags ARRAY column (case-insensitive). Also normalizes category_slug to verify the technique belongs to the correct category. Returns PaginatedResponse with TechniquePageRead items, eager-loading the creator relation for creator_name/creator_slug fields. Add integration test to test_public_api.py covering: happy path with known tags, empty result for nonexistent sub-topic, pagination params.

## Inputs

- ``backend/routers/topics.py` — existing topics router with list_topics and get_topic_techniques endpoints`
- ``backend/models.py` — TechniquePage model with topic_tags ARRAY(String) column (line 215)`
- ``backend/schemas.py` — PaginatedResponse and TechniquePageRead schemas`
- ``backend/tests/test_public_api.py` — existing test file with topic test fixtures (technique pages with known tags)`
- ``backend/tests/conftest.py` — test database fixtures`

## Expected Output

- ``backend/routers/topics.py` — new get_subtopic_techniques endpoint added`
- ``backend/tests/test_public_api.py` — new test_get_subtopic_techniques, test_get_subtopic_techniques_empty, test_get_subtopic_techniques_pagination tests`

## Verification

cd backend && python -m pytest tests/test_public_api.py -k 'subtopic' -v --timeout=30
