Home / File/ tutorial001_py39.py — fastapi Source File

tutorial001_py39.py — fastapi Source File

Architecture documentation for tutorial001_py39.py, a python file in the fastapi codebase. 3 imports, 1 dependents.

File python FastAPI Responses 3 imports 1 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  c5e263d2_40cf_f289_613d_ff5353c66e30["tutorial001_py39.py"]
  534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"]
  c5e263d2_40cf_f289_613d_ff5353c66e30 --> 534f6e44_61b8_3c38_8b89_6934a6df9802
  0dcb823f_ea0d_bd04_752b_a3a3f875bba1["utils.py"]
  c5e263d2_40cf_f289_613d_ff5353c66e30 --> 0dcb823f_ea0d_bd04_752b_a3a3f875bba1
  d8a9ec8b_6a53_c575_f568_9201405b8883["get_openapi"]
  c5e263d2_40cf_f289_613d_ff5353c66e30 --> d8a9ec8b_6a53_c575_f568_9201405b8883
  af88d2cf_62a9_8cd6_16c9_504debd90f89["test_tutorial001.py"]
  af88d2cf_62a9_8cd6_16c9_504debd90f89 --> c5e263d2_40cf_f289_613d_ff5353c66e30
  style c5e263d2_40cf_f289_613d_ff5353c66e30 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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",
        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


app.openapi = custom_openapi

Domain

Subdomains

Frequently Asked Questions

What does tutorial001_py39.py do?
tutorial001_py39.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Responses subdomain.
What functions are defined in tutorial001_py39.py?
tutorial001_py39.py defines 2 function(s): custom_openapi, read_items.
What does tutorial001_py39.py depend on?
tutorial001_py39.py imports 3 module(s): __init__.py, get_openapi, utils.py.
What files import tutorial001_py39.py?
tutorial001_py39.py is imported by 1 file(s): test_tutorial001.py.
Where is tutorial001_py39.py in the architecture?
tutorial001_py39.py is located at docs_src/extending_openapi/tutorial001_py39.py (domain: FastAPI, subdomain: Responses, directory: docs_src/extending_openapi).

Analyze Your Own Codebase

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

Try Supermodel Free