Skip to content

Rename Router.get() param endpoint -> action - #180

Merged
tmgbedu merged 1 commit into
mainfrom
task/router-endpoint-to-action-1057
Jul 16, 2026
Merged

Rename Router.get() param endpoint -> action#180
tmgbedu merged 1 commit into
mainfrom
task/router-endpoint-to-action-1057

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renamed the second positional parameter of Router.get, post, put, patch, delete, head, options, and the internal _add_route helper from endpoint to action for a consistent public API naming.
  • Updated all internal references within each method body accordingly.

Test plan

  • uv run pytest fastapi_startkit/tests/fastapi/ -v — 117 passed
  • Grepped the whole package for endpoint= keyword call sites against Router methods — none found; existing callers pass the handler positionally

Consistently rename the second positional parameter across get, post,
put, patch, delete, head, options, and _add_route so the public API
uses action instead of endpoint for the route handler callable.

@tmgbedu tmgbedu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Code Reviewer verdict: APPROVE — posting as a comment; gh blocks formal --approve since the reviewing account is also the PR author.]

Verified this is a pure, mechanical rename with no behavior change:

  • Full diff (16 additions / 16 deletions, single file router.py) only touches the parameter name endpoint -> action on get, post, put, patch, delete, head, options, and _add_route, plus every internal reference to that parameter inside each method body. No logic, defaults, types, or call order changed.
  • _add_route still calls self.router.add_api_route(path, action, methods=..., ...) — passed positionally, so FastAPI's own endpoint parameter name is irrelevant; behavior identical to before.
  • resource() is unaffected: it calls self.get/post/put/delete(...) with the handler positional (e.g. self.get(f"/{name}", fn("index"), name=...)), never via endpoint= keyword, so the rename doesn't touch it.
  • Grepped the entire monorepo (not just this package) for endpoint= keyword call sites against these Router methods — none found. The only endpoint= hits in the repo are unrelated S3 storage config (AWS_ENDPOINT) in storage/config/storage.py and the pingcrm example, not Router calls.
  • Checked docs (*.md) for Router usage examples using an endpoint= keyword — none found; existing examples all pass the handler positionally, so no doc drift.
  • No .pyi stub exists for Router that would also need updating.
  • No docstrings/comments reference endpoint elsewhere in the file — nothing missed.

Test evidence checks out — reran independently on the PR branch (not just trusting the PR description):

  • uv run pytest tests/fastapi/ -v117 passed, matches engineer's claim exactly.
  • tests/fastapi/test_router.py calls all renamed methods positionally (e.g. r.get("/items", endpoint) where endpoint is just a local fixture name, not a keyword arg) — confirms no test relies on the old keyword name.
  • Ran the full suite for good measure: uv run pytest --ignore=tests/masoniteorm/postgres -q1833 passed, 7 skipped, 4 subtests passed, no regressions anywhere else.

No issues found. Approving — safe to merge.

@tmgbedu tmgbedu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Code Reviewer verdict: APPROVE — posting as a comment; gh blocks formal --approve since the reviewing account is also the PR author.]

Verified this is a pure, mechanical rename with no behavior change:

  • Full diff (16 additions / 16 deletions, single file router.py) only touches the parameter name endpoint -> action on get, post, put, patch, delete, head, options, and _add_route, plus every internal reference to that parameter inside each method body. No logic, defaults, types, or call order changed.
  • _add_route still calls self.router.add_api_route(path, action, methods=..., ...) — passed positionally, so FastAPI's own endpoint parameter name is irrelevant; behavior identical to before.
  • resource() is unaffected: it calls self.get/post/put/delete(...) with the handler positional (e.g. self.get(f"/{name}", fn("index"), name=...)), never via endpoint= keyword, so the rename doesn't touch it.
  • Grepped the entire monorepo (not just this package) for endpoint= keyword call sites against these Router methods — none found. The only endpoint= hits in the repo are unrelated S3 storage config (AWS_ENDPOINT) in storage/config/storage.py and the pingcrm example, not Router calls.
  • Checked docs (*.md) for Router usage examples using an endpoint= keyword — none found; existing examples all pass the handler positionally, so no doc drift.
  • No .pyi stub exists for Router that would also need updating.
  • No docstrings/comments reference endpoint elsewhere in the file — nothing missed.

Test evidence checks out — reran independently on the PR branch (not just trusting the PR description):

  • uv run pytest tests/fastapi/ -v117 passed, matches engineer's claim exactly.
  • tests/fastapi/test_router.py calls all renamed methods positionally (e.g. r.get("/items", endpoint) where endpoint is just a local fixture name, not a keyword arg) — confirms no test relies on the old keyword name.
  • Ran the full suite for good measure: uv run pytest --ignore=tests/masoniteorm/postgres -q1833 passed, 7 skipped, 4 subtests passed, no regressions anywhere else.

No issues found. Approving — safe to merge.

@tmgbedu
tmgbedu merged commit ecd7332 into main Jul 16, 2026
5 checks passed
@tmgbedu
tmgbedu deleted the task/router-endpoint-to-action-1057 branch July 16, 2026 06:53
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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