Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 4 of 4 for add_route (0.06 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. fastapi/applications.py

                    )
    
                self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)
    
                if self.swagger_ui_oauth2_redirect_url:
    
                    async def swagger_ui_redirect(req: Request) -> HTMLResponse:
                        return get_swagger_ui_oauth2_redirect_html()
    
                    self.add_route(
                        self.swagger_ui_oauth2_redirect_url,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Apr 01 16:16:24 GMT 2026
    - 178.6K bytes
    - Click Count (0)
  2. tests/test_extra_routes.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float | None = None
    
    
    @app.api_route("/items/{item_id}", methods=["GET"])
    def get_items(item_id: str):
        return {"item_id": item_id}
    
    
    def get_not_decorated(item_id: str):
        return {"item_id": item_id}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 14.7K bytes
    - Click Count (0)
  3. tests/test_application.py

    from inline_snapshot import snapshot
    
    from .main import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/api_route", 200, {"message": "Hello World"}),
            ("/non_decorated_route", 200, {"message": "Hello World"}),
            ("/nonexistent", 404, {"detail": "Not Found"}),
        ],
    )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 56.9K bytes
    - Click Count (0)
  4. fastapi/.agents/skills/fastapi/SKILL.md

    instead of this:
    
    ```python
    # DO NOT DO THIS
    from fastapi import FastAPI, Request
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
    
    
    @app.api_route("/items/", methods=["GET", "POST"])
    async def handle_items(request: Request):
        if request.method == "GET":
            return []
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 10.1K bytes
    - Click Count (0)
Back to Top