Skip to content

fix: move JSONResponse import to module top-level in errors.py - #325

Merged
smaramwbc merged 1 commit into
smaramwbc:mainfrom
Vignesh-P-C:fix/error-json-toplevel-import-296
Aug 5, 2026
Merged

fix: move JSONResponse import to module top-level in errors.py#325
smaramwbc merged 1 commit into
smaramwbc:mainfrom
Vignesh-P-C:fix/error-json-toplevel-import-296

Conversation

@Vignesh-P-C

Copy link
Copy Markdown
Contributor

Closes #296

Description

Related Issue

Closes #296

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Maintenance (refactoring, dependencies, CI, etc.)
  • 🧪 Test improvement

Changes Made

Testing

  • Unit tests pass locally
  • Integration tests pass locally
  • Manual testing completed
  • New tests added for new functionality

Test Commands Run

# e.g., pytest tests/ or npm test

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have updated documentation as needed
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix/feature works
  • All existing tests pass
  • I have checked for breaking changes

Screenshots / Recordings

Additional Notes

@Vignesh-P-C
Vignesh-P-C requested a review from smaramwbc as a code owner August 5, 2026 16:55
@smaramwbc
smaramwbc merged commit 120c6a8 into smaramwbc:main Aug 5, 2026
6 checks passed
@smaramwbc

Copy link
Copy Markdown
Owner

Thanks — merged.

I checked the usual reason a deferred import exists (breaking a circular import) and that isn't the case here: errors.py already imports fastapi and fastapi.exceptions at module level, and fastapi.responses can't import back into server.*, so there's no cycle to avoid. The deferred form also looks incidental rather than deliberate — no rationale comment, and it was the only function-local import in server/core/.

So this is a clean consistency fix. CI was green including the container smoke test, which boots the real image. Appreciated!

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.

[Bug]: JSONResponse imported inside _error_json instead of at module top-level

2 participants