Skip to content

[api] Clean up route naming inconsistencies#1157

Merged
frankrousseau merged 3 commits into
cgwire:mainfrom
frankrousseau:route-naming-cleanup
Jul 10, 2026
Merged

[api] Clean up route naming inconsistencies#1157
frankrousseau merged 3 commits into
cgwire:mainfrom
frankrousseau:route-naming-cleanup

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problems

  • /data/entities/guess_from_path and /import/shotgun/projectconnections were the only routes not in kebab-case
  • 21 route definitions carried a trailing slash while the rest of the API does not
  • Some path parameters were abbreviated or misleading: attachment_id, descriptor_id, template_id, and /data/user/entities/<sequence_id>/... which only handles sequences

Solutions

  • Add kebab-case canonical routes and keep the old paths as deprecated aliases (gazu still posts guess_from_path); route registration now reuses the view when a resource appears on several paths
  • Drop the trailing slashes: strict_slashes is already disabled globally, so both forms keep responding
  • Rename the path parameters to the full model names and add /data/user/sequences/<sequence_id>/task-types/<task_type_id>/subscribed, keeping the old entities path as a deprecated alias

frankrousseau and others added 3 commits July 10, 2026 15:11
Register /data/entities/guess-from-path and
/import/shotgun/project-connections as canonical kebab-case routes.
The old paths stay registered as aliases because gazu and old sync
scripts still post them. Route registration now reuses the view
function when a resource class appears on several paths.

Tests: files route tests cover both paths, shotgun teams test moved
to the new path while fixtures keep covering the alias.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
19 CRUD collection routes plus the year-table and create-tasks routes
were declared with a trailing slash while the rest of the API is not.
strict_slashes is already disabled globally, so both forms keep
responding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rename attachment_id to attachment_file_id, descriptor_id to
metadata_descriptor_id and template_id to project_template_id so path
parameters match the model they identify. Add
/data/user/sequences/<sequence_id>/task-types/<task_type_id>/subscribed
aligned with its subscribe/unsubscribe siblings; the old entities path
stays as a deprecated alias. URL shapes are unchanged for clients.

Tests: sequence subscribe test asserts the subscribed status through
both the new route and the deprecated alias.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frankrousseau
frankrousseau merged commit c8e4145 into cgwire:main Jul 10, 2026
2 checks passed
@frankrousseau
frankrousseau deleted the route-naming-cleanup branch July 10, 2026 13:29
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.

1 participant