-
Notifications
You must be signed in to change notification settings - Fork 103
LCORE-4230: Deprecate v1 conversations OGX endpoints #2734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
asimurka
wants to merge
1
commit into
lightspeed-core:main
Choose a base branch
from
asimurka:LCORE-4230-deprecate-v1-conversations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 11607
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 5492
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 33206
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 50389
🌐 Web query:
FastAPI 0.141.1 APIRouter add_api_route endpoint callable registration APIRoute official source💡 Result:
<search_synthesis>
In FastAPI, including version 0.141.1, the APIRouter.add_api_route method is the official programmatic way to register a path operation (endpoint) [1][2][3]. This method allows you to define a route dynamically without using the standard path operation decorators (e.g.,
@router.get) [1][3]. The official implementation resides in the fastapi.routing module within the APIRouter class [4][5]. When called, add_api_route instantiates the router's route_class (which defaults to APIRoute) using the provided path, endpoint callable, and other metadata, then appends this route object to the router's internal list of routes [4][5]. Key characteristics of add_api_route include: Programmatic Registration: It accepts the same parameters as the standard decorators (e.g., path, endpoint, methods, status_code, dependencies, etc.), making it suitable for scenarios where routes are generated dynamically or defined within classes [1][2][3]. Endpoint Callable: The endpoint argument expects a Callable that acts as the path operation function [3][6]. FastAPI handles this callable by inspecting its signature to inject dependencies and parse HTTP request data [3]. APIRoute Integration: The method ensures that the endpoint is wrapped in an APIRoute instance, which manages the request-response lifecycle, dependency injection, and OpenAPI schema generation for that specific endpoint [4][7]. For custom behavior, you can specify a custom route class when initializing the APIRouter (using the route_class parameter), and add_api_route will use that class to instantiate the routes [7]. You can view the authoritative source code in the official FastAPI GitHub repository: - Core routing logic: fastapi/routing.py [4] - Application-level wrapper: fastapi/applications.py [6]</search_synthesis>
<source_evidence>
Citations:
Avoid warning-as-error failures on v1 handlers. FastAPI registers the
@authorizeresult as the endpoint. After authorization, that wrapper awaits the innertyping_extensions.deprecatedwrapper, which callswarnings.warn(..., DeprecationWarning)before the handler runs. The default filter ignores this warning, but-W errororPYTHONWARNINGS=errorconverts it to an exception and fails the request. Setcategory=Noneor remove these handler decorators; the router already provides OpenAPI deprecation metadata.🤖 Prompt for AI Agents