Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_nested_router (0.07 sec)

  1. tests/test_annotated.py

        assert response.json() == {"foo": "bar"}
    
        response = client.get("/test2", params={"var": "baz"})
        assert response.status_code == 200
        assert response.json() == {"foo": "baz"}
    
    
    def test_nested_router():
        app = FastAPI()
    
        router = APIRouter(prefix="/nested")
    
        @router.get("/test")
        async def test(var: Annotated[str, Query()] = "bar"):
            return {"foo": var}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top