Home / Function/ custom_openapi() — fastapi Function Reference

custom_openapi() — fastapi Function Reference

Architecture documentation for the custom_openapi() function in tutorial001_py39.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  ffc9e3ea_f311_f904_eff9_58c2ce418c50["custom_openapi()"]
  c5e263d2_40cf_f289_613d_ff5353c66e30["tutorial001_py39.py"]
  ffc9e3ea_f311_f904_eff9_58c2ce418c50 -->|defined in| c5e263d2_40cf_f289_613d_ff5353c66e30
  d8a9ec8b_6a53_c575_f568_9201405b8883["get_openapi()"]
  ffc9e3ea_f311_f904_eff9_58c2ce418c50 -->|calls| d8a9ec8b_6a53_c575_f568_9201405b8883
  style ffc9e3ea_f311_f904_eff9_58c2ce418c50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/extending_openapi/tutorial001_py39.py lines 12–26

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",
        description="Here's a longer description of the custom **OpenAPI** schema",
        routes=app.routes,
    )
    openapi_schema["info"]["x-logo"] = {
        "url": "https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png"
    }
    app.openapi_schema = openapi_schema
    return app.openapi_schema

Domain

Subdomains

Frequently Asked Questions

What does custom_openapi() do?
custom_openapi() is a function in the fastapi codebase, defined in docs_src/extending_openapi/tutorial001_py39.py.
Where is custom_openapi() defined?
custom_openapi() is defined in docs_src/extending_openapi/tutorial001_py39.py at line 12.
What does custom_openapi() call?
custom_openapi() calls 1 function(s): get_openapi.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free