You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): CircleMembers add/remove target the wrong endpoints; members.list() unwraps a key the API does not send #42
The circle members sub-resource (campus_python/api/v1/circles.py) does not conform to the Campus API for membership mutations. After #41 fixed the nested-path construction, members now resolves to /api/v1/circles/<id>/members, but add()/remove() still hit the wrong endpoints with a wrong payload key, and list() unwraps a response key the API does not send.
Per the Campus API routes (campus-suite, weekly branch, campus/api/routes/circles.py):
GET /api/v1/circles/<id>/members/ — returns the flat {member_id: access_value} mapping directly
POST /api/v1/circles/<id>/members/add — request body {"member_id": ..., "access_value": ...}
DELETE /api/v1/circles/<id>/members/remove — request body {"member_id": ...}
Actual Behavior
add() POSTs to /api/v1/circles/<id>/members with {"member_id": ..., "access": ...} — the trailing-slash redirect lands on /members/ which only allows GET/PATCH (405), and the payload uses "access" where the API expects "access_value"
remove() DELETEs /api/v1/circles/<id>/members — same 405
list() does resp.json()["members"], but the API returns the flat member mapping as the body, so this raises KeyError
list(): return resp.json() directly, requesting self.make_path(end_slash=True) to hit the canonical /members/ route
Regression tests for these request targets already exist as a pattern in tests/unit/test_nested_resources.py (see test_members_list_gets_members_endpoint) and should be updated to the corrected endpoints.
changed the title [-]CircleMembers add/remove target the wrong endpoints; members.list() unwraps a key the API does not send[/-][+]fix(api): CircleMembers add/remove target the wrong endpoints; members.list() unwraps a key the API does not send[/+]on Oct 3, 2026
Activity
[-]CircleMembers add/remove target the wrong endpoints; members.list() unwraps a key the API does not send[/-][+]fix(api): CircleMembers add/remove target the wrong endpoints; members.list() unwraps a key the API does not send[/+]