-
Notifications
You must be signed in to change notification settings - Fork 9
Standardize API endpoints by removing trailing slashes #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Standardize API endpoints by removing trailing slashes #577
Conversation
📝 WalkthroughWalkthroughThis change introduces document upload file size validation with a configurable 50MB limit (rejecting oversized files with HTTP 413 and empty files with HTTP 422), alongside standardizing API endpoint paths by removing trailing slashes from routes across login, private, documents, and utility endpoints. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
backend/app/api/routes/utils.py (1)
11-16:⚠️ Potential issue | 🟡 MinorInconsistent:
/test-email/still has a trailing slash.The PR objective is to remove trailing slashes from all API endpoints, but this endpoint still has one. For consistency, update the path to
/test-email.Proposed fix
`@router.post`( - "/test-email/", + "/test-email", dependencies=[Depends(require_permission(Permission.SUPERUSER))], status_code=201, include_in_schema=False, )
🧹 Nitpick comments (2)
backend/app/services/documents/validators.py (2)
4-4: Remove unused import.
Pathis imported but never used in this module.Proposed fix
import logging -from pathlib import Path from fastapi import HTTPException, UploadFile
53-53: Log message should be prefixed with the function name.As per coding guidelines, log messages should be prefixed with the function name in square brackets:
logger.info(f"[function_name] Message").Proposed fix
- logger.info(f"Document file validated: {file.filename} ({file_size} bytes)") + logger.info(f"[validate_document_file] Document file validated: {file.filename} ({file_size} bytes)")
Fixes #561
Summary
Motivation
Standardizing endpoint URLs improves consistency and avoids ambiguity for API clients.
Summary by CodeRabbit
New Features
API Improvements