Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 61 for output (0.16 sec)

  1. tests/test_openapi_separate_input_output_schemas.py

        sub: Optional[SubItem] = None
        if PYDANTIC_V2:
            model_config = {"json_schema_serialization_defaults_required": True}
    
    
    def get_app_client(separate_input_output_schemas: bool = True) -> TestClient:
        app = FastAPI(separate_input_output_schemas=separate_input_output_schemas)
    
        @app.post("/items/")
        def create_item(item: Item):
            return item
    
        @app.post("/items-list/")
        def create_item_list(item: List[Item]):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 18.4K bytes
    - Viewed (2)
  2. fastapi/openapi/utils.py

            components["schemas"] = {k: definitions[k] for k in sorted(definitions)}
        if components:
            output["components"] = components
        output["paths"] = paths
        if webhook_paths:
            output["webhooks"] = webhook_paths
        if tags:
            output["tags"] = tags
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/separate-openapi-schemas.md

    Because of that, the JSON Schema for a model can be different depending on if it's used for **input or output**:
    
    * for **input** the `description` will **not be required**
    * for **output** it will be **required** (and possibly `None`, or in JSON terms, `null`)
    
    ### Model for Output in Docs
    
    You can check the output model in the docs too, **both** `name` and `description` are marked as **required** with a **red asterisk**:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  4. docs_src/separate_openapi_schemas/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
    
    
    app = FastAPI(separate_input_output_schemas=False)
    
    
    @app.post("/items/")
    def create_item(item: Item):
        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 486 bytes
    - Viewed (0)
  5. docs/es/docs/advanced/path-operation-advanced-configuration.md

    ## Descripción avanzada desde el docstring
    
    Puedes limitar las líneas usadas desde el docstring de una *operación de path* para OpenAPI.
    
    Agregar un `\f` (un carácter de "form feed" escapado) hace que **FastAPI** trunque el output utilizada para OpenAPI en ese punto.
    
    No será mostrado en la documentación, pero otras herramientas (como Sphinx) serán capaces de usar el resto.
    
    ```Python hl_lines="19 20 21 22 23 24 25 26 27 28 29"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jul 04 12:49:31 GMT 2021
    - 2.1K bytes
    - Viewed (0)
  6. docs/de/docs/how-to/separate-openapi-schemas.md

    Und wenn Sie alle verfügbaren Schemas (JSON-Schemas) in OpenAPI überprüfen, werden Sie feststellen, dass es zwei gibt, ein `Item-Input` und ein `Item-Output`.
    
    Für `Item-Input` ist `description` **nicht erforderlich**, es hat kein rotes Sternchen.
    
    Aber für `Item-Output` ist `description` **erforderlich**, es hat ein rotes Sternchen.
    
    <div class="screenshot">
    <img src="/img/tutorial/separate-openapi-schemas/image04.png">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:18:03 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/response-model.md

    !!! danger
        Never store the plain password of a user or send it in a response like this, unless you know all the caveats and you know what you are doing.
    
    ## Add an output model
    
    We can instead create an input model with the plaintext password and an output model without it:
    
    === "Python 3.10+"
    
        ```Python hl_lines="9  11  16"
        {!> ../../../docs_src/response_model/tutorial003_py310.py!}
        ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  8. docs/fr/docs/async.md

    Ce "attendre quelque chose d'autre" fait généralement référence à des opérations <abbr title="Input/Output ou Entrées et Sorties ">I/O</abbr> qui sont relativement "lentes" (comparées à la vitesse du processeur et de la mémoire RAM) telles qu'attendre que :
    
    * de la donnée soit envoyée par le client à travers le réseau
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 24K bytes
    - Viewed (0)
  9. docs/zh/docs/advanced/generate-clients.md

    ```JSON  hl_lines="7"
    {
      "name": "frontend-app",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "generate-client": "openapi-ts --input http://localhost:8000/openapi.json --output ./src/client --client axios"
      },
      "author": "",
      "license": "",
      "devDependencies": {
        "@hey-api/openapi-ts": "^0.27.38",
        "typescript": "^4.6.2"
      }
    }
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 03 03:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  10. docs/en/docs/how-to/async-sql-encode-databases.md

    ### Notice the `response_model=List[Note]`
    
    It uses `typing.List`.
    
    That documents (and validates, serializes, filters) the output data, as a `list` of `Note`s.
    
    ## Create notes
    
    Create the *path operation function* to create notes:
    
    ```Python hl_lines="61-65"
    {!../../../docs_src/async_sql_databases/tutorial001.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
Back to top