-
Notifications
You must be signed in to change notification settings - Fork 615
[CHORE]: Remove unused Pydantic schemas in schemas.py (PaginationParams, ObservabilityQueryParams, PerformanceHistoryParams) #3706
Copy link
Copy link
Closed
Labels
COULDP3: Nice-to-have features with minimal impact if left out; included if time permitsP3: Nice-to-have features with minimal impact if left out; included if time permitschoreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chores
Milestone
Description
Description
Three schema classes in mcpgateway/schemas.py are defined but never imported or used by any Python code:
| Schema | Line | Hardcoded bound | Problem |
|---|---|---|---|
PaginationParams |
7367 | le=500 |
Would silently conflict with PAGINATION_MAX_PAGE_SIZE if anyone used it |
ObservabilityQueryParams |
7612 | le=1000 |
Dead code |
PerformanceHistoryParams |
7814 | le=1000 |
Dead code |
Why it matters
PaginationParams.per_page has le=500 hardcoded. If any future code uses this schema instead of Query(... le=settings.pagination_max_page_size), it would reintroduce the 422 bug that #3469 fixed — operators who raise PAGINATION_MAX_PAGE_SIZE above 500 would silently hit a validation mismatch.
Suggested fix
Delete these three unused schemas. All existing endpoints define their own Query params inline and reference settings.pagination_max_page_size directly.
Verification
# Confirm no Python imports exist
grep -rn 'PaginationParams\|ObservabilityQueryParams\|PerformanceHistoryParams' mcpgateway/ --include='*.py'
# Should only show the class definitions in schemas.pyRelated
- Closes nothing (standalone cleanup)
- Discovered during review of ui-pagination-422-response #3641 (fix for [BUG][UI]: Pagination per_page options 200/500 exceed API limit of 100 #3469)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
COULDP3: Nice-to-have features with minimal impact if left out; included if time permitsP3: Nice-to-have features with minimal impact if left out; included if time permitschoreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chores