Skip to content

fix: canonical trailing-slash URLs for subresource ID routes (#13) - #108

Merged
ngjunsiang merged 1 commit into
mainfrom
fix/13-trailing-slashes
Oct 11, 2026
Merged

ngjunsiang merged 1 commit into
mainfrom
fix/13-trailing-slashes

Conversation

@ngjunsiang

Copy link
Copy Markdown
Contributor

Closes #13. Companion to the server-side sweep (nyjc-computing/campus#407, PR campus#910).

What

  • Submissions.by_assignment()/by_student() f-string paths now end in /
  • Credentials.Provider.User get/delete/new/update: make_path(end_slash=True)
  • Vaults key ops: make_path(key, end_slash=True)
  • All other item-method call sites listed in Route trailing slash compliance: Add trailing slashes to subresource ID paths #13 (assignments/circles/users items, Credentials.Provider, Vault.keys) now pass end_slash=True explicitly — a no-op today because paths built through ResourceCollection parents already end in /, but it keeps the convention visible and guards against path-construction drift
  • Verb routes (submit, activate, add/remove) and subresource-name routes (links, responses, feedback) stay unslashed per convention
  • Two unit-test assertions updated to the slashed /auth/v1/credentials/campus/user1/ path

Tests

poetry run pytest: 291 passed.

Companion to nyjc-computing/campus#407 (server PR campus#910). Item
paths built through ResourceCollection parents already ended in '/',
but paths assembled through Resource parents or f-strings did not:

- Submissions.by_assignment/by_student f-strings
- Credentials.Provider.User get/delete/new/update
- Vaults key ops (make_path(key, end_slash=True))

The remaining call sites now pass end_slash=True explicitly per the
issue checklist — a no-op today, but it keeps the intent visible and
guards against path-construction changes. Verb routes (submit,
activate, add/remove) and subresource-name routes (links, responses,
feedback) stay unslashed per convention. Two unit-test assertions
updated to the slashed credentials user path.
@ngjunsiang
ngjunsiang merged commit 364dd30 into main Oct 11, 2026
4 checks passed
@ngjunsiang
ngjunsiang deleted the fix/13-trailing-slashes branch October 11, 2026 08:13
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.

Route trailing slash compliance: Add trailing slashes to subresource ID paths

1 participant