Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 233 for 422 (0.47 sec)

  1. tests/test_multi_query_errors.py

        assert response.status_code == 200, response.text
        assert response.json() == {"q": [5, 6]}
    
    
    def test_multi_query_incorrect():
        response = client.get("/items/?q=five&q=six")
        assert response.status_code == 422, response.text
        assert response.json() == {
            "detail": [
                {
                    "type": "int_parsing",
                    "loc": ["query", "q", 0],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  2. tests/test_enforce_once_required_parameter.py

                        "200": {
                            "content": {"application/json": {"schema": {}}},
                            "description": "Successful Response",
                        },
                        "422": {
                            "content": {
                                "application/json": {
                                    "schema": {
                                        "$ref": "#/components/schemas/HTTPValidationError"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 16 17:21:48 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  3. docs_src/custom_request_and_route/tutorial002_py39.py

                except RequestValidationError as exc:
                    body = await request.body()
                    detail = {"errors": exc.errors(), "body": body.decode()}
                    raise HTTPException(status_code=422, detail=detail)
    
            return custom_route_handler
    
    
    app = FastAPI()
    app.router.route_class = ValidationErrorLoggingRoute
    
    
    @app.post("/")
    async def sum_numbers(numbers: list[int] = Body()):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 926 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_model/test_tutorial004.py

                                            "schema": {"$ref": "#/components/schemas/Item"}
                                        }
                                    },
                                },
                                "422": {
                                    "description": "Validation Error",
                                    "content": {
                                        "application/json": {
                                            "schema": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.3K bytes
    - Viewed (0)
  5. tests/test_regex_deprecated_body.py

    
    @needs_py310
    def test_query_nonregexquery():
        client = get_client()
        response = client.post("/items/", data={"q": "nonregexquery"})
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "string_pattern_mismatch",
                    "loc": ["body", "q"],
                    "msg": "String should match pattern '^fixedquery$'",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_query_params_str_validations/test_tutorial004.py

            "q": "fixedquery",
        }
    
    
    def test_query_params_str_validations_q_nonregexquery(client: TestClient):
        response = client.get("/items/", params={"q": "nonregexquery"})
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "string_pattern_mismatch",
                    "loc": ["query", "q"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 12:45:20 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  7. tests/test_request_params/test_body/test_optional_str.py

        assert response.json() == {"p": None}
    
    
    def test_model_optional_str_missing():
        client = TestClient(app)
        response = client.post("/model-optional-str")
        assert response.status_code == 422, response.text
        assert response.json() == {
            "detail": [
                {
                    "input": None,
                    "loc": ["body"],
                    "msg": "Field required",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 11.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py

            "q": "fixedquery",
        }
    
    
    def test_query_params_str_validations_q_fixedquery_too_short(client: TestClient):
        response = client.get("/items/", params={"q": "fa"})
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "string_too_short",
                    "loc": ["query", "q"],
                    "msg": "String should have at least 3 characters",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py

        assert response.json() == {"id": "isbn-nope", "name": None}
    
    
    def test_get_invalid_item(client: TestClient):
        response = client.get("/items?id=wtf-yes")
        assert response.status_code == 422, response.text
        assert response.json() == snapshot(
            {
                "detail": [
                    {
                        "type": "value_error",
                        "loc": ["query", "id"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 5K bytes
    - Viewed (0)
  10. docs_src/custom_request_and_route/tutorial002_an_py39.py

                except RequestValidationError as exc:
                    body = await request.body()
                    detail = {"errors": exc.errors(), "body": body.decode()}
                    raise HTTPException(status_code=422, detail=detail)
    
            return custom_route_handler
    
    
    app = FastAPI()
    app.router.route_class = ValidationErrorLoggingRoute
    
    
    @app.post("/")
    async def sum_numbers(numbers: Annotated[list[int], Body()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 947 bytes
    - Viewed (0)
Back to top