Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 13 for add_route (0.08 seconds)

  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. fastapi/routing.py

            name: str | None = None,
            include_in_schema: bool = True,
        ) -> Callable[[DecoratedCallable], DecoratedCallable]:
            def decorator(func: DecoratedCallable) -> DecoratedCallable:
                self.add_route(
                    path,
                    func,
                    methods=methods,
                    name=name,
                    include_in_schema=include_in_schema,
                )
                return func
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
  3. tests/main.py

    external_docs = {
        "description": "External API documentation.",
        "url": "https://docs.example.com/api-general",
    }
    
    app = FastAPI(openapi_external_docs=external_docs)
    
    
    @app.api_route("/api_route")
    def non_operation():
        return {"message": "Hello World"}
    
    
    def non_decorated_route():
        return {"message": "Hello World"}
    
    
    app.add_api_route("/non_decorated_route", non_decorated_route)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 4.5K bytes
    - Click Count (0)
  4. 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)
  5. 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)
  6. 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)
  7. api/go1.13.txt

    pkg syscall (netbsd-arm64-cgo), const AF_OSI ideal-int
    pkg syscall (netbsd-arm64-cgo), const AF_PUP = 4
    pkg syscall (netbsd-arm64-cgo), const AF_PUP ideal-int
    pkg syscall (netbsd-arm64-cgo), const AF_ROUTE = 34
    pkg syscall (netbsd-arm64-cgo), const AF_ROUTE ideal-int
    pkg syscall (netbsd-arm64-cgo), const AF_SNA = 11
    pkg syscall (netbsd-arm64-cgo), const AF_SNA ideal-int
    pkg syscall (netbsd-arm64-cgo), const ARPHRD_ARCNET = 7
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Thu Aug 08 18:44:16 GMT 2019
    - 452.6K bytes
    - Click Count (0)
  8. api/go1.2.txt

    pkg syscall (freebsd-386-cgo), const AF_NETGRAPH ideal-int
    pkg syscall (freebsd-386-cgo), const AF_OSI ideal-int
    pkg syscall (freebsd-386-cgo), const AF_PUP ideal-int
    pkg syscall (freebsd-386-cgo), const AF_ROUTE ideal-int
    pkg syscall (freebsd-386-cgo), const AF_SCLUSTER ideal-int
    pkg syscall (freebsd-386-cgo), const AF_SIP ideal-int
    pkg syscall (freebsd-386-cgo), const AF_SLOW ideal-int
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Fri Oct 18 04:36:59 GMT 2013
    - 1.9M bytes
    - Click Count (1)
  9. api/go1.1.txt

    pkg syscall (darwin-386), const AF_OSI = 7
    pkg syscall (darwin-386), const AF_PPP = 34
    pkg syscall (darwin-386), const AF_PUP = 4
    pkg syscall (darwin-386), const AF_RESERVED_36 = 36
    pkg syscall (darwin-386), const AF_ROUTE = 17
    pkg syscall (darwin-386), const AF_SIP = 24
    pkg syscall (darwin-386), const AF_SNA = 11
    pkg syscall (darwin-386), const AF_SYSTEM = 32
    pkg syscall (darwin-386), const B0 = 0
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Thu Mar 31 20:37:15 GMT 2022
    - 2.6M bytes
    - Click Count (0)
  10. api/go1.14.txt

    pkg syscall (freebsd-arm64), const AF_OSI ideal-int
    pkg syscall (freebsd-arm64), const AF_PUP = 4
    pkg syscall (freebsd-arm64), const AF_PUP ideal-int
    pkg syscall (freebsd-arm64), const AF_ROUTE = 17
    pkg syscall (freebsd-arm64), const AF_ROUTE ideal-int
    pkg syscall (freebsd-arm64), const AF_SCLUSTER = 34
    pkg syscall (freebsd-arm64), const AF_SCLUSTER ideal-int
    pkg syscall (freebsd-arm64), const AF_SIP = 24
    Created: Tue Apr 07 11:13:11 GMT 2026
    - Last Modified: Fri Feb 17 20:31:46 GMT 2023
    - 508.9K bytes
    - Click Count (0)
Back to Top