MPT-20733 expand API router usage docs#191
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✅ Files skipped from review due to trivial changes (8)
📝 WalkthroughWalkthroughThis PR moves agreement routes into a dedicated ChangesAuthenticated API Handler Implementation and Documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
643ab39 to
c54cad3
Compare
c54cad3 to
20b11f5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/usage.md (1)
124-125: ⚡ Quick winUse the current router module paths in this wiring example.
This snippet still points to legacy/ambiguous imports; align it with the updated app wiring so copy-paste examples stay accurate.
Suggested doc fix
-from mock_app.api.routes import orders_router -from mock_app.api.api_routes import api_router +from mock_app.api.routes.event import orders_router +from mock_app.api.routes.api import api_router🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/usage.md` around lines 124 - 125, The example imports in the docs use outdated module paths for the routers (orders_router, api_router); update the import lines to match the current application wiring by replacing the legacy paths with the app's current router modules (use the same module locations where orders_router and api_router are now defined), ensuring the example imports reference the real symbols orders_router and api_router from their current modules so copy-paste works for users.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mock_app/docs/example.http`:
- Line 9: The HTTP example contains a hard-coded JWT in the Authorization header
which must be removed; replace the literal value after "Authorization: Bearer"
with a placeholder (e.g. {{BEARER_TOKEN}} or {{API_TOKEN}}) and update all other
occurrences mentioned (lines 35, 42, 49, 56, 63, 79) to use the same placeholder
so no real token is committed in mock_app/docs/example.http.
---
Nitpick comments:
In `@docs/usage.md`:
- Around line 124-125: The example imports in the docs use outdated module paths
for the routers (orders_router, api_router); update the import lines to match
the current application wiring by replacing the legacy paths with the app's
current router modules (use the same module locations where orders_router and
api_router are now defined), ensuring the example imports reference the real
symbols orders_router and api_router from their current modules so copy-paste
works for users.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0347f17c-a8a5-4755-a231-b6e34ea6aad5
📒 Files selected for processing (9)
.env.demodocs/usage.mdmock_app/api/api_routes.pymock_app/api/routes/__init__.pymock_app/api/routes/api.pymock_app/api/routes/event.pymock_app/app.pymock_app/docs/example.httpmock_app/sync/agreements.py
20b11f5 to
252c3bc
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
mock_app/docs/example.http (1)
1-1:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove the committed JWT literal from
@auth_token.The token value is still embedded in the file. Replace it with a non-secret placeholder to avoid leaking credentials in-repo.
Suggested fix
-@auth_token = eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJodHRwczovL2NsYWltcy5zb2Z0d2FyZW9uZS5jb20vZXh0ZW5zaW9uSWQiOiJFWFQtMjM0NS0zNTU0IiwiaHR0cHM6Ly9jbGFpbXMuc29mdHdhcmVvbmUuY29tL2FjY291bnRJZCI6IkFDQy0wMDAwLTM0NTMiLCJodHRwczovL2NsYWltcy5zb2Z0d2FyZW9uZS5jb20vbW9kdWxlcyI6eyJhY2Nlc3MtbWFuYWdlbWVudCI6WyJlZGl0Il0sImFjY291bnQtbWFuYWdlbWVudCI6WyJlZGl0Il0sImJpbGxpbmciOlsiZWRpdCJdfSwiaHR0cHM6Ly9jbGFpbXMuc29mdHdhcmVvbmUuY29tL2FjY291bnRUeXBlIjoiQ2xpZW50IiwiaXNzIjoiaHR0cHM6Ly9tcHQtZXh0ZW5zaW9ucy5zb2Z0d2FyZW9uZS5jb20iLCJzdWIiOiJFWFQtMjM0NS0zNTU0IiwiYXVkIjpbImh0dHBzOi8vYXBpLnB5cmFjbG91ZC5jb20vIl0sImlhdCI6MTg3NzUxMjc3OCwiZXhwIjoxODc3NTE2Mzc4fQ. +@auth_token = <paste-non-prod-jwt-here>As per coding guidelines: "For each subsequent commit in this PR, explicitly verify if previous review comments have been resolved".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mock_app/docs/example.http` at line 1, The file contains a committed JWT literal assigned to the `@auth_token` variable; replace the literal value for `@auth_token` in mock_app/docs/example.http with a non-secret placeholder (e.g. a clearly named template or env variable like {{AUTH_TOKEN}} or ${AUTH_TOKEN}) and remove the real token from the file, then commit the change and ensure you verify this previous review comment is resolved in subsequent commits; locate the assignment by the symbol "`@auth_token`" to update it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@mock_app/docs/example.http`:
- Line 1: The file contains a committed JWT literal assigned to the `@auth_token`
variable; replace the literal value for `@auth_token` in
mock_app/docs/example.http with a non-secret placeholder (e.g. a clearly named
template or env variable like {{AUTH_TOKEN}} or ${AUTH_TOKEN}) and remove the
real token from the file, then commit the change and ensure you verify this
previous review comment is resolved in subsequent commits; locate the assignment
by the symbol "`@auth_token`" to update it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 920a83a7-e646-43b8-9e61-4735bba29ac0
📒 Files selected for processing (9)
.env.demodocs/usage.mdmock_app/api/api_routes.pymock_app/api/routes/__init__.pymock_app/api/routes/api.pymock_app/api/routes/event.pymock_app/app.pymock_app/docs/example.httpmock_app/sync/agreements.py
✅ Files skipped from review due to trivial changes (2)
- .env.demo
- docs/usage.md
252c3bc to
d15f348
Compare
Document authenticated API route context, request helpers, response helpers, pagination, and error behavior.
d15f348 to
b8f9b95
Compare
|



🤖 AI-generated PR — Please review carefully.
Summary
APIRouterusage documentation.ctx.Testing
make checkCloses MPT-20733