Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for get_openapi (0.05 sec)

  1. docs_src/extending_openapi/tutorial001_py39.py

    from fastapi import FastAPI
    from fastapi.openapi.utils import get_openapi
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items():
        return [{"name": "Foo"}]
    
    
    def custom_openapi():
        if app.openapi_schema:
            return app.openapi_schema
        openapi_schema = get_openapi(
            title="Custom title",
            version="2.5.0",
            summary="This is a very custom OpenAPI schema",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 737 bytes
    - Viewed (0)
  2. docs/pt/docs/how-to/extending-openapi.md

    Por padrão, o que o método `.openapi()` faz é verificar se a propriedade `.openapi_schema` tem conteúdo e retorná-lo.
    
    Se não tiver, ele gera o conteúdo usando a função utilitária em `fastapi.openapi.utils.get_openapi`.
    
    E essa função `get_openapi()` recebe como parâmetros:
    
    * `title`: O título do OpenAPI, exibido na documentação.
    * `version`: A versão da sua API, por exemplo, `2.5.0`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  3. tests/test_additional_responses_bad.py

            "/a": {
                "get": {
                    "responses": {
                        # this is how one would imagine the openapi schema to be
                        # but since the key is not valid, openapi.utils.get_openapi will raise ValueError
                        "hello": {"description": "Not a valid additional response"},
                        "200": {
                            "description": "Successful Response",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  4. docs/ru/docs/how-to/extending-openapi.md

    По умолчанию метод `.openapi()` проверяет свойство `.openapi_schema`: если в нём уже есть данные, возвращает их.
    
    Если нет — генерирует схему с помощью вспомогательной функции `fastapi.openapi.utils.get_openapi`.
    
    Функция `get_openapi()` принимает параметры:
    
    * `title`: Заголовок OpenAPI, отображается в документации.
    * `version`: Версия вашего API, например `2.5.0`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  5. docs/en/docs/how-to/extending-openapi.md

    By default, what the method `.openapi()` does is check the property `.openapi_schema` to see if it has contents and return them.
    
    If it doesn't, it generates them using the utility function at `fastapi.openapi.utils.get_openapi`.
    
    And that function `get_openapi()` receives as parameters:
    
    * `title`: The OpenAPI title, shown in the docs.
    * `version`: The version of your API, e.g. `2.5.0`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  6. docs/es/docs/how-to/extending-openapi.md

    Por defecto, lo que hace el método `.openapi()` es revisar la propiedad `.openapi_schema` para ver si tiene contenido y devolverlo.
    
    Si no lo tiene, lo genera usando la función de utilidad en `fastapi.openapi.utils.get_openapi`.
    
    Y esa función `get_openapi()` recibe como parámetros:
    
    * `title`: El título de OpenAPI, mostrado en la documentación.
    * `version`: La versión de tu API, por ejemplo `2.5.0`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  7. docs/de/docs/how-to/extending-openapi.md

    Ist das nicht der Fall, wird der Inhalt mithilfe der Hilfsfunktion unter `fastapi.openapi.utils.get_openapi` generiert.
    
    Diese Funktion `get_openapi()` erhält als Parameter:
    
    * `title`: Der OpenAPI-Titel, der in der Dokumentation angezeigt wird.
    * `version`: Die Version Ihrer API, z. B. `2.5.0`.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4K bytes
    - Viewed (0)
  8. fastapi/openapi/utils.py

        flat_models = callback_flat_models + list(
            body_fields_from_routes + responses_from_routes + request_fields_from_routes
        )
        return flat_models
    
    
    def get_openapi(
        *,
        title: str,
        version: str,
        openapi_version: str = "3.1.0",
        summary: Optional[str] = None,
        description: Optional[str] = None,
        routes: Sequence[BaseRoute],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  9. fastapi/applications.py

    from fastapi.openapi.docs import (
        get_redoc_html,
        get_swagger_ui_html,
        get_swagger_ui_oauth2_redirect_html,
    )
    from fastapi.openapi.utils import get_openapi
    from fastapi.params import Depends
    from fastapi.types import DecoratedCallable, IncEx
    from fastapi.utils import generate_unique_id
    from starlette.applications import Starlette
    from starlette.datastructures import State
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 176.3K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py

    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1K bytes
    - Viewed (0)
Back to top