Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 2,056 for App (0.02 sec)

  1. docs/en/docs/advanced/generate-clients.md

    You can see those schemas because they were declared with the models in the app.
    
    That information is available in the app's **OpenAPI schema**, and then shown in the API docs (by Swagger UI).
    
    And that same information from the models that is included in OpenAPI is what can be used to **generate the client code**.
    
    ### Generate a TypeScript Client
    
    Now that we have the app with the models, we can generate the client code for the frontend.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/behind-a-proxy.md

    `root_path` 用于处理这些特定情况。
    
    在挂载子应用时,也可以在内部使用。
    
    ## 移除路径前缀的代理
    
    本例中,移除路径前缀的代理是指在代码中声明路径 `/app`,然后在应用顶层添加代理,把 **FastAPI** 应用放在 `/api/v1` 路径下。
    
    本例的原始路径 `/app` 实际上是在 `/api/v1/app` 提供服务。
    
    哪怕所有代码都假设只有 `/app`。
    
    代理只在把请求传送给 Uvicorn 之前才会**移除路径前缀**,让应用以为它是在 `/app` 提供服务,因此不必在代码中加入前缀 `/api/v1`。
    
    但之后,在(前端)打开 API 文档时,代理会要求在 `/openapi.json`,而不是 `/api/v1/openapi.json` 中提取 OpenAPI 概图。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  3. tests/test_response_model_include_exclude.py

        age: int
        ref2: Model2
    
    
    app = FastAPI()
    
    
    @app.get(
        "/simple_include",
        response_model=Model2,
        response_model_include={"baz": ..., "ref": {"foo"}},
    )
    def simple_include():
        return Model2(
            ref=Model1(foo="simple_include model foo", bar="simple_include model bar"),
            baz="simple_include model2 baz",
        )
    
    
    @app.get(
        "/simple_include_dict",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Jul 19 19:14:58 UTC 2021
    - 4K bytes
    - Viewed (0)
  4. docs/es/docs/tutorial/first-steps.md

    Es el "**decorador de operaciones de path**".
    
    ///
    
    También puedes usar las otras operaciones:
    
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    
    y las más exóticas:
    
    * `@app.options()`
    * `@app.head()`
    * `@app.patch()`
    * `@app.trace()`
    
    /// tip | Consejo
    
    Tienes la libertad de usar cada operación (método de HTTP) como quieras.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  5. docs/debugging/healing-bin/main.go

    	"fmt"
    	"io"
    	"log"
    	"os"
    	"strings"
    
    	"github.com/minio/cli"
    	"github.com/tinylib/msgp/msgp"
    )
    
    func main() {
    	app := cli.NewApp()
    	app.Copyright = "MinIO, Inc."
    	app.Usage = "healing.bin to JSON"
    	app.HideVersion = true
    	app.HideHelpCommand = true
    	app.CustomAppHelpTemplate = `NAME:
      {{.Name}} - {{.Usage}}
    
    USAGE:
      {{.Name}} {{if .VisibleFlags}}[FLAGS]{{end}} [HEALINGBINFILE|INSPECTZIPFILE]
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  6. docs/uk/docs/index.md

    ## Приклад
    
    ### Створіть
    
    * Створіть файл `main.py` з:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 20 19:20:23 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/sql-databases.md

    <div class="screenshot">
    <img src="/img/tutorial/sql-databases/image01.png">
    </div>
    
    ## Atualizar o App com Múltiplos Modelos
    
    Agora vamos **refatorar** este app um pouco para aumentar a **segurança** e **versatilidade**.
    
    Se você verificar o app anterior, na interface você pode ver que, até agora, ele permite que o cliente decida o `id` do `Hero` a ser criado. 😱
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 15:25:29 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  8. docs_src/sql_databases/tutorial002_an.py

    
    def get_session():
        with Session(engine) as session:
            yield session
    
    
    SessionDep = Annotated[Session, Depends(get_session)]
    app = FastAPI()
    
    
    @app.on_event("startup")
    def on_startup():
        create_db_and_tables()
    
    
    @app.post("/heroes/", response_model=HeroPublic)
    def create_hero(hero: HeroCreate, session: SessionDep):
        db_hero = Hero.model_validate(hero)
        session.add(db_hero)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  9. docs_src/sql_databases/tutorial002_py39.py

    def create_db_and_tables():
        SQLModel.metadata.create_all(engine)
    
    
    def get_session():
        with Session(engine) as session:
            yield session
    
    
    app = FastAPI()
    
    
    @app.on_event("startup")
    def on_startup():
        create_db_and_tables()
    
    
    @app.post("/heroes/", response_model=HeroPublic)
    def create_hero(hero: HeroCreate, session: Session = Depends(get_session)):
        db_hero = Hero.model_validate(hero)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  10. tests/test_allow_inf_nan_in_enforcing.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/")
    async def get(
        x: Annotated[float, Query(allow_inf_nan=True)] = 0,
        y: Annotated[float, Query(allow_inf_nan=False)] = 0,
        z: Annotated[float, Query()] = 0,
        b: Annotated[float, Body(allow_inf_nan=False)] = 0,
    ) -> str:
        return "OK"
    
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "value,code",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:27:37 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top