Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 211 for 422 (0.25 sec)

  1. tests/test_required_noneable.py

        assert response.status_code == 422
    
    
    def test_required_noneable_query_value():
        response = client.get("/query", params={"q": "foo"})
        assert response.status_code == 200
        assert response.json() == "foo"
    
    
    def test_required_nonable_explicit_query_invalid():
        response = client.get("/explicit-query")
        assert response.status_code == 422
    
    
    def test_required_nonable_explicit_query_value():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 19:08:31 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  2. docs_src/path_operation_advanced_configuration/tutorial007_pv1.py

        try:
            data = yaml.safe_load(raw_body)
        except yaml.YAMLError:
            raise HTTPException(status_code=422, detail="Invalid YAML")
        try:
            item = Item.parse_obj(data)
        except ValidationError as e:
            raise HTTPException(status_code=422, detail=e.errors())
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 789 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002_an.py

    from docs_src.request_files.tutorial002_an import app
    
    client = TestClient(app)
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_forms/test_tutorial001.py

        assert response.json() == {"username": "Foo"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "password"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  5. tests/test_modules_same_name_body/test_main.py

        data = response.json()
    
    
    def test_post_a_invalid():
        data = {"a": "bar", "b": "foo"}
        response = client.post("/a/compute", json=data)
        assert response.status_code == 422, response.text
    
    
    def test_post_b():
        data = {"a": 2, "b": "foo"}
        response = client.post("/b/compute/", json=data)
        assert response.status_code == 200, response.text
        data = response.json()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

        assert response.json() == {"username": "Foo"}
    
    
    @needs_py39
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "password"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  7. tests/test_dependency_duplicates.py

    ):
        return [item, sub_items]
    
    
    def test_no_duplicates_invalid():
        response = client.post("/no-duplicates", json={"item": {"data": "myitem"}})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "item2"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_files/test_tutorial001_an.py

    from docs_src.request_files.tutorial001_an import app
    
    client = TestClient(app)
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "file"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  9. fastapi/exception_handlers.py

    from fastapi.websockets import WebSocket
    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.responses import JSONResponse, Response
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
    
    
    async def http_exception_handler(request: Request, exc: HTTPException) -> Response:
        headers = getattr(exc, "headers", None)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial002.py

    from docs_src.request_files.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
Back to top