While working through the API workshop iterations with an AI agent in Warp terminal, I discovered several minor bugs.
Bug Fixes Applied to API Workshop Iterations
Rate Limiting Iteration (library-api-with-ratelimiting)
Bug: Incorrect function names in books router
- File:
app/routers/books.py
- Issue: Function named
create_authors_router instead of create_books_router
- Fix: Renamed function to
create_books_router on line 12
Bug: Incorrect function call in main.py
- File:
app/main.py
- Issue: Called
books.create_authors_router(limiter) instead of books.create_books_router(limiter)
- Fix: Updated function call on line 30
Sustainable Evolution Iteration (library-api-with-sustainable-evolution)
Bug: Incorrect function names in v1 books router
- File:
app/routers/v1/books.py
- Issue: Function named
create_authors_router instead of create_books_router
- Fix: Renamed function to
create_books_router on line 12
Bug: Incorrect function names in v2 books router
- File:
app/routers/v2/books.py
- Issue: Function named
create_authors_router instead of create_books_router
- Fix: Renamed function to
create_books_router on line 12
Bug: Incorrect function calls in main.py (2 instances)
- File:
app/main.py
- Issue 1: Called
v1_books.create_authors_router(v1_limiter) instead of v1_books.create_books_router(v1_limiter)
- Fix: Updated function call on line 42
- Issue 2: Called
v2_books.create_authors_router(v2_limiter) instead of v2_books.create_books_router(v2_limiter)
- Fix: Updated function call on line 50
Root Cause
All function naming bugs appear to stem from copy-paste errors where the books router was based on the authors router template but the function name wasn't updated appropriately. This pattern suggests the need for better code review or automated testing to catch such naming inconsistencies.
Files Modified
app/routers/books.py (rate limiting iteration)
app/routers/v1/books.py (sustainable evolution)
app/routers/v2/books.py (sustainable evolution)
app/main.py (both iterations)
While working through the API workshop iterations with an AI agent in Warp terminal, I discovered several minor bugs.
Bug Fixes Applied to API Workshop Iterations
Rate Limiting Iteration (
library-api-with-ratelimiting)Bug: Incorrect function names in books router
app/routers/books.pycreate_authors_routerinstead ofcreate_books_routercreate_books_routeron line 12Bug: Incorrect function call in main.py
app/main.pybooks.create_authors_router(limiter)instead ofbooks.create_books_router(limiter)Sustainable Evolution Iteration (
library-api-with-sustainable-evolution)Bug: Incorrect function names in v1 books router
app/routers/v1/books.pycreate_authors_routerinstead ofcreate_books_routercreate_books_routeron line 12Bug: Incorrect function names in v2 books router
app/routers/v2/books.pycreate_authors_routerinstead ofcreate_books_routercreate_books_routeron line 12Bug: Incorrect function calls in main.py (2 instances)
app/main.pyv1_books.create_authors_router(v1_limiter)instead ofv1_books.create_books_router(v1_limiter)v2_books.create_authors_router(v2_limiter)instead ofv2_books.create_books_router(v2_limiter)Root Cause
All function naming bugs appear to stem from copy-paste errors where the books router was based on the authors router template but the function name wasn't updated appropriately. This pattern suggests the need for better code review or automated testing to catch such naming inconsistencies.
Files Modified
app/routers/books.py(rate limiting iteration)app/routers/v1/books.py(sustainable evolution)app/routers/v2/books.py(sustainable evolution)app/main.py(both iterations)