docs(planning): record decision to keep version as a function decorator#19
Merged
Merged
Conversation
Architecture-review candidate 2 proposed folding set_api_version into a version= kwarg on the router verb methods. Rejected: FastAPI 0.139's verb methods forward a closed, explicit parameter list to api_route (no **kwargs), so version= is impossible without overriding the verb methods and collapsing their explicit signatures into **kwargs. Records the constraint and revisit triggers so future reviews don't re-suggest it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Records the first entry in
planning/decisions/— the outcome of architecture-review candidate 2 (foldset_api_versioninto aversion=route kwarg).Decision: rejected. Per-route version stays on the endpoint function (
set_api_version/ theversionattribute).Why
Verified against FastAPI 0.139.0 / Starlette 1.3.1: the
APIRouterverb methods (.get,.post, …) forward a closed, explicit parameter list toapi_routewith no**kwargs, andapi_route's signature is likewise closed. So@router.get("/x", version=(2,0))raisesTypeErrorunless the verb methods are overridden — which would collapse their explicitresponse_model=/status_code=/… signatures into**kwargs, costing library users their autocomplete to delete a 3-line pass-through. That fails the deletion test. The alternative (a separateversioned()idiom) fragments the routing API for marginal gain.The decision file captures the constraint, the rejected options, and concrete revisit triggers (FastAPI adding
**kwargs/a metadata slot, or dropping eager route registration) so a future architecture review doesn't re-suggest the same thing.No code changes.
just check-planning→planning: OK; the decision appears under## Decisionsinjust index.