Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for model_json_schema (0.19 sec)

  1. docs_src/path_operation_advanced_configuration/tutorial007.py

    
    class Item(BaseModel):
        name: str
        tags: List[str]
    
    
    @app.post(
        "/items/",
        openapi_extra={
            "requestBody": {
                "content": {"application/x-yaml": {"schema": Item.model_json_schema()}},
                "required": True,
            },
        },
    )
    async def create_item(request: Request):
        raw_body = await request.body()
        try:
            data = yaml.safe_load(raw_body)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 822 bytes
    - Viewed (0)
  2. docs/en/docs/advanced/path-operation-advanced-configuration.md

        ```
    
    !!! info
        In Pydantic version 1 the method to get the JSON Schema for a model was called `Item.schema()`, in Pydantic version 2, the method is called `Item.model_json_schema()`.
    
    Nevertheless, although we are not using the default integrated functionality, we are still using a Pydantic model to manually generate the JSON Schema for the data that we want to receive in YAML.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/path-operation-advanced-configuration.md

        ```
    
    !!! info
        In Pydantic Version 1 hieß die Methode zum Abrufen des JSON-Schemas für ein Modell `Item.schema()`, in Pydantic Version 2 heißt die Methode `Item.model_json_schema()`.
    
    Obwohl wir nicht die standardmäßig integrierte Funktionalität verwenden, verwenden wir dennoch ein Pydantic-Modell, um das JSON-Schema für die Daten, die wir in YAML empfangen möchten, manuell zu generieren.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:27:23 GMT 2024
    - 8.5K bytes
    - Viewed (0)
Back to top