Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 124 for Must (0.14 sec)

  1. fastapi/responses.py

        [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
        """
    
        def render(self, content: Any) -> bytes:
            assert ujson is not None, "ujson must be installed to use UJSONResponse"
            return ujson.dumps(content, ensure_ascii=False).encode("utf-8")
    
    
    class ORJSONResponse(JSONResponse):
        """
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/cors.md

    To achieve this, the backend must have a list of "allowed origins".
    
    In this case, it would have to include `http://localhost:8080` for the frontend to work correctly.
    
    ## Wildcards
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Nov 13 20:28:37 GMT 2022
    - 5.1K bytes
    - Viewed (0)
  3. tests/test_filter_pydantic_sub_model/app_pv1.py

        name: str
        description: Optional[str] = None
        model_b: ModelB
    
        @validator("name")
        def lower_username(cls, name: str, values):
            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)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 784 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py

                                },
                            },
                        },
                        "summary": "Create an item",
                        "description": "Create an item with all the information:\n\n- **name**: each item must have a name\n- **description**: a long description\n- **price**: required\n- **tax**: if the item doesn't have tax, you can omit this\n- **tags**: a set of unique tag strings for this item",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.7K bytes
    - Viewed (0)
  5. fastapi/param_functions.py

            Optional[float],
            Doc(
                """
                Greater than. If set, value must be greater than this. Only applicable to
                numbers.
                """
            ),
        ] = None,
        ge: Annotated[
            Optional[float],
            Doc(
                """
                Greater than or equal. If set, value must be greater than or equal to
                this. Only applicable to numbers.
                """
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  6. tests/test_filter_pydantic_sub_model_pv2.py

                    "msg": "Value error, name must end in A",
                    "input": "modelX",
                    "ctx": {"error": HasRepr("ValueError('name must end in A')")},
                }
            )
            | IsDict(
                # TODO remove when deprecating Pydantic v1
                {
                    "loc": ("response", "name"),
                    "msg": "name must end in A",
                    "type": "value_error",
                }
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  7. tests/test_inherited_custom_class.py

            return uuid.UUID
    
        @property
        def __dict__(self):
            """Spoof a missing __dict__ by raising TypeError, this is how
            asyncpg.pgroto.pgproto.UUID behaves"""
            raise TypeError("vars() argument must have __dict__ attribute")
    
    
    @needs_pydanticv2
    def test_pydanticv2():
        from pydantic import field_serializer
    
        app = FastAPI()
    
        @app.get("/fast_uuid")
        def return_fast_uuid():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
  8. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

        with pytest.raises(ResponseValidationError) as err:
            client.get("/model/modelX")
        assert err.value.errors() == [
            {
                "loc": ("response", "name"),
                "msg": "name must end in A",
                "type": "value_error",
            }
        ]
    
    
    @needs_pydanticv1
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/security/simple-oauth2.md

    The spec also states that the `username` and `password` must be sent as form data (so, no JSON here).
    
    ### `scope`
    
    The spec also says that the client can send another form field "`scope`".
    
    The form field name is `scope` (in singular), but it is actually a long string with "scopes" separated by spaces.
    
    Each "scope" is just a string (without spaces).
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/background-tasks.md

    * Processing data:
        * For example, let's say you receive a file that must go through a slow process, you can return a response of "Accepted" (HTTP 202) and process it in the background.
    
    ## Using `BackgroundTasks`
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.6K bytes
    - Viewed (0)
Back to top