Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for get_model_c (0.17 sec)

  1. tests/test_filter_pydantic_sub_model/app_pv1.py

            if not name.endswith("A"):
                raise ValueError("name must end in A")
            return name
    
    
    async def get_model_c() -> ModelC:
        return ModelC(username="test-user", password="test-password")
    
    
    @app.get("/model/{name}", response_model=ModelA)
    async def get_model_a(name: str, model_c=Depends(get_model_c)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 784 bytes
    - Viewed (0)
  2. tests/test_filter_pydantic_sub_model_pv2.py

                    raise ValueError("name must end in A")
                return name
    
        async def get_model_c() -> ModelC:
            return ModelC(username="test-user", password="test-password")
    
        @app.get("/model/{name}", response_model=ModelA)
        async def get_model_a(name: str, model_c=Depends(get_model_c)):
            return {"name": name, "description": "model-a-desc", "foo": model_c}
    
        client = TestClient(app)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
Back to top