Skip to content

refactor lists_json_get in prep for fastapi#11990

Merged
RayBB merged 1 commit intomasterfrom
fastapi-prep/lists_json_get
Mar 3, 2026
Merged

refactor lists_json_get in prep for fastapi#11990
RayBB merged 1 commit intomasterfrom
fastapi-prep/lists_json_get

Conversation

@RayBB
Copy link
Copy Markdown
Collaborator

@RayBB RayBB commented Mar 3, 2026

No description provided.

@RayBB
Copy link
Copy Markdown
Collaborator Author

RayBB commented Mar 3, 2026

AI review

Summary: Refactors lists_json_get in openlibrary/plugins/openlibrary/lists.py to prepare for FastAPI migration.
Changes:

  1. Renamed get_lists → get_lists_data and made it a @staticmethod
  2. Changed from using web.ctx.path to accepting path as a parameter
  3. Cleaned up input validation to use local variables instead of modifying i object
    Risks: LOW
  • No breaking changes: The old get_lists method wasn't called externally - only internally in this class (lines 507, 510). Other get_lists references in the file (lines 258, 288, 298, 516, 1045) are different methods on user, mb.user, doc objects.
  • Functional equivalence: The new static method does the exact same thing, just with better separation of concerns.
  • Input validation preserved: The limit cap (max 100) and offset floor (min 0) logic remains intact.
    This is a clean refactor - no functional changes, just code organization improvements for future FastAPI compatibility.

@RayBB RayBB merged commit 87332eb into master Mar 3, 2026
8 checks passed
@RayBB RayBB deleted the fastapi-prep/lists_json_get branch March 3, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant