Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for add_route (0.11 sec)

  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,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 17 04:52:31 UTC 2024
    - 172.2K bytes
    - Viewed (0)
  2. fastapi/routing.py

            name: Optional[str] = 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
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 172.1K bytes
    - Viewed (0)
  3. tests/main.py

    import http
    from typing import FrozenSet, List, Optional
    
    from fastapi import FastAPI, Path, Query
    
    app = FastAPI()
    
    
    @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)
    
    
    @app.get("/text")
    def get_text():
        return "Hello World"
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  4. tests/test_application.py

    from fastapi.testclient import TestClient
    
    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"}),
        ],
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 52.2K bytes
    - Viewed (0)
  5. tests/test_extra_routes.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: Optional[float] = 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}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 13.7K bytes
    - Viewed (0)
  6. 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
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Mar 31 20:37:15 UTC 2022
    - 2.6M bytes
    - Viewed (0)
  7. 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
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Feb 17 20:31:46 UTC 2023
    - 508.9K bytes
    - Viewed (0)
  8. api/go1.16.txt

    pkg syscall (darwin-arm64), const AF_PUP ideal-int
    pkg syscall (darwin-arm64), const AF_RESERVED_36 = 36
    pkg syscall (darwin-arm64), const AF_RESERVED_36 ideal-int
    pkg syscall (darwin-arm64), const AF_ROUTE = 17
    pkg syscall (darwin-arm64), const AF_ROUTE ideal-int
    pkg syscall (darwin-arm64), const AF_SIP = 24
    pkg syscall (darwin-arm64), const AF_SIP ideal-int
    pkg syscall (darwin-arm64), const AF_SNA = 11
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Dec 02 16:30:41 UTC 2022
    - 479.2K bytes
    - Viewed (0)
  9. api/go1.20.txt

    pkg syscall (freebsd-riscv64), const AF_PUP = 4 #53466
    pkg syscall (freebsd-riscv64), const AF_PUP ideal-int #53466
    pkg syscall (freebsd-riscv64), const AF_ROUTE = 17 #53466
    pkg syscall (freebsd-riscv64), const AF_ROUTE ideal-int #53466
    pkg syscall (freebsd-riscv64), const AF_SCLUSTER = 34 #53466
    pkg syscall (freebsd-riscv64), const AF_SCLUSTER ideal-int #53466
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Feb 17 21:23:32 UTC 2023
    - 602.6K bytes
    - Viewed (0)
Back to top