Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 106 for requiere (0.08 sec)

  1. fastapi/dependencies/utils.py

        BodyModel = create_body_model(
            fields=flat_dependant.body_params, model_name=model_name
        )
        required = any(True for f in flat_dependant.body_params if f.required)
        BodyFieldInfo_kwargs: dict[str, Any] = {
            "annotation": BodyModel,
            "alias": "body",
        }
        if not required:
            BodyFieldInfo_kwargs["default"] = None
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  2. tests/test_request_params/test_cookie/test_required_str.py

        "path",
        ["/required-str", "/model-required-str"],
    )
    def test_required_str_schema(path: str):
        assert app.openapi()["paths"][path]["get"]["parameters"] == [
            {
                "required": True,
                "schema": {"title": "P", "type": "string"},
                "name": "p",
                "in": "cookie",
            }
        ]
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-str", "/model-required-str"],
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  3. tests/test_request_params/test_file/test_required.py

                    "loc": ["body", "p"],
                    "msg": "Field required",
                    "input": None,
                }
            ]
        }
    
    
    @pytest.mark.parametrize(
        "path",
        [
            "/required-bytes",
            "/required-uploadfile",
        ],
    )
    def test_required(path: str):
        client = TestClient(app)
        response = client.post(path, files=[("p", b"hello")])
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.8K bytes
    - Viewed (0)
  4. tests/test_request_params/test_form/test_list.py

                    "type": "array",
                },
            },
            "required": ["p"],
            "title": body_model_name,
            "type": "object",
        }
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-list-str", "/model-required-list-str"],
    )
    def test_required_list_str_missing(path: str):
        client = TestClient(app)
        response = client.post(path)
        assert response.status_code == 422
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  5. tests/test_request_params/test_body/test_list.py

                    "type": "array",
                },
            },
            "required": ["p"],
            "title": body_model_name,
            "type": "object",
        }
    
    
    @pytest.mark.parametrize("json", [None, {}])
    @pytest.mark.parametrize(
        "path",
        ["/required-list-str", "/model-required-list-str"],
    )
    def test_required_list_str_missing(path: str, json: Union[dict, None]):
        client = TestClient(app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

                {
                    "type": "missing",
                    "loc": ["body", "file"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
                    "loc": ["body", "fileb"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  7. tests/test_openapi_query_parameter_extension.py

    app = FastAPI()
    
    
    @app.get(
        "/",
        openapi_extra={
            "parameters": [
                {
                    "required": False,
                    "schema": {"title": "Extra Param 1"},
                    "name": "extra_param_1",
                    "in": "query",
                },
                {
                    "required": True,
                    "schema": {"title": "Extra Param 2"},
                    "name": "extra_param_2",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  8. tests/test_extra_routes.py

                        "summary": "Get Items",
                        "operationId": "get_items_items__item_id__get",
                        "parameters": [
                            {
                                "required": True,
                                "schema": {"title": "Item Id", "type": "string"},
                                "name": "item_id",
                                "in": "path",
                            }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 13.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_header_param_models/test_tutorial003.py

                                    "required": True,
                                    "schema": {"type": "string", "title": "Host"},
                                },
                                {
                                    "name": "save_data",
                                    "in": "header",
                                    "required": True,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  10. tests/test_security_oauth2.py

                {
                    "type": "missing",
                    "loc": ["body", "grant_type"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
                    "loc": ["body", "username"],
                    "msg": "Field required",
                    "input": None,
                },
                {
                    "type": "missing",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9K bytes
    - Viewed (0)
Back to top