Skip to content

Short list of bugs #9

@ricardo-maestas

Description

@ricardo-maestas

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions