-
Notifications
You must be signed in to change notification settings - Fork 2
Route trailing slash compliance: Add trailing slashes to subresource ID paths #407
Copy link
Copy link
Open
Description
Problem
Per campus API conventions, subresource paths with ID parameters should have trailing slashes (e.g., /assignments/{assignment_id}/ instead of /assignments/{assignment_id}).
Routes to Fix
campus/api/routes/assignments.py
# Line 103
@bp.get('/<string:assignment_id>') # → @bp.get('/<string:assignment_id>/')
# Line 119
@bp.patch('/<string:assignment_id>') # → @bp.patch('/<string:assignment_id>/')
# Line 166
@bp.delete('/<string:assignment_id>') # → @bp.delete('/<string:assignment_id>/')campus/api/routes/submissions.py
# Line 106
@bp.get('/by-assignment/<string:assignment_id>') # → @bp.get('/by-assignment/<string:assignment_id>/')
# Line 124
@bp.get('/by-student/<string:student_id>') # → @bp.get('/by-student/<string:student_id>/')
# Line 142
@bp.get('/<string:submission_id>') # → @bp.get('/<string:submission_id>/')
# Line 158
@bp.patch('/<string:submission_id>') # → @bp.patch('/<string:submission_id>/')
# Line 202
@bp.delete('/<string:submission_id>') # → @bp.delete('/<string:submission_id>/')campus/api/routes/circles.py
# Line 109
@bp.delete('/<string:circle_id>') # → @bp.delete('/<string:circle_id>/')
# Line 149
@bp.get('/<string:circle_id>') # → @bp.get('/<string:circle_id>/')
# Line 198
@bp.patch('/<string:circle_id>') # → @bp.patch('/<string:circle_id>/')campus/auth/routes/credentials.py
# Line 52
@bp.delete("/<provider>/<user_id>") # → @bp.delete("/<provider>/<user_id>/")
# Line 70
@bp.get("/<provider>/<user_id>") # → @bp.get("/<provider>/<user_id>/")
# Line 91
@bp.patch("/<provider>/<user_id>") # → @bp.patch("/<provider>/<user_id>/")
# Line 115
@bp.post("/<provider>/<user_id>") # → @bp.post("/<provider>/<user_id>/")campus/auth/routes/users.py
# Line 69
@bp.delete("/<user_id>") # → @bp.delete("/<user_id>/")
# Line 82
@bp.get("/<user_id>") # → @bp.get("/<user_id>/")
# Line 98
@bp.patch("/<user_id>") # → @bp.patch("/<user_id>/")campus/auth/routes/vaults.py
# Line 39
@bp.delete("/<label>/<key>") # → @bp.delete("/<label>/<key>/")
# Line 52
@bp.get("/<label>/<key>") # → @bp.get("/<label>/<key>/")
# Line 70
@bp.post("/<label>/<key>") # → @bp.post("/<label>/<key>/")Tasks
- Add trailing slashes to all 19 routes listed above
- Update
create_blueprint()functions in affected files (where routes are manually registered) - Update any tests that reference these routes
- Update API documentation if needed
Notes
- Routes ending in verbs (e.g.,
/activate,/submit,/move) do NOT need trailing slashes - Routes ending in subresource names (e.g.,
/links,/responses,/metadata) do NOT need trailing slashes - the trailing slash is only needed on the ID segment itself
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels