Home / File/ tutorial002_py39.py — fastapi Source File

tutorial002_py39.py — fastapi Source File

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

File python FastAPI Responses 6 imports 1 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  fc26af4f_37d9_e0c9_cad9_51ee06effde8["tutorial002_py39.py"]
  534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 534f6e44_61b8_3c38_8b89_6934a6df9802
  6383cfb2_5918_5c8c_5124_dbbbe44fbe24["docs.py"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 6383cfb2_5918_5c8c_5124_dbbbe44fbe24
  609573dc_dd8d_bd61_f42b_83a7d4873d61["get_redoc_html"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 609573dc_dd8d_bd61_f42b_83a7d4873d61
  3705e434_dfc7_b070_aae6_93314a9b9976["get_swagger_ui_html"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 3705e434_dfc7_b070_aae6_93314a9b9976
  9e591d9c_65d6_09d8_497c_322cdf94b4b4["get_swagger_ui_oauth2_redirect_html"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 9e591d9c_65d6_09d8_497c_322cdf94b4b4
  410cbf2a_8163_ee1a_0070_64d2ae2d5add["staticfiles.py"]
  fc26af4f_37d9_e0c9_cad9_51ee06effde8 --> 410cbf2a_8163_ee1a_0070_64d2ae2d5add
  a6788c5d_0ba3_0175_27ee_0487b3d446bc["test_tutorial002.py"]
  a6788c5d_0ba3_0175_27ee_0487b3d446bc --> fc26af4f_37d9_e0c9_cad9_51ee06effde8
  style fc26af4f_37d9_e0c9_cad9_51ee06effde8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from fastapi import FastAPI
from fastapi.openapi.docs import (
    get_redoc_html,
    get_swagger_ui_html,
    get_swagger_ui_oauth2_redirect_html,
)
from fastapi.staticfiles import StaticFiles

app = FastAPI(docs_url=None, redoc_url=None)

app.mount("/static", StaticFiles(directory="static"), name="static")


@app.get("/docs", include_in_schema=False)
async def custom_swagger_ui_html():
    return get_swagger_ui_html(
        openapi_url=app.openapi_url,
        title=app.title + " - Swagger UI",
        oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
        swagger_js_url="/static/swagger-ui-bundle.js",
        swagger_css_url="/static/swagger-ui.css",
    )


@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
async def swagger_ui_redirect():
    return get_swagger_ui_oauth2_redirect_html()


@app.get("/redoc", include_in_schema=False)
async def redoc_html():
    return get_redoc_html(
        openapi_url=app.openapi_url,
        title=app.title + " - ReDoc",
        redoc_js_url="/static/redoc.standalone.js",
    )


@app.get("/users/{username}")
async def read_user(username: str):
    return {"message": f"Hello {username}"}

Domain

Subdomains

Frequently Asked Questions

What does tutorial002_py39.py do?
tutorial002_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 tutorial002_py39.py?
tutorial002_py39.py defines 4 function(s): custom_swagger_ui_html, read_user, redoc_html, swagger_ui_redirect.
What does tutorial002_py39.py depend on?
tutorial002_py39.py imports 6 module(s): __init__.py, docs.py, get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html, staticfiles.py.
What files import tutorial002_py39.py?
tutorial002_py39.py is imported by 1 file(s): test_tutorial002.py.
Where is tutorial002_py39.py in the architecture?
tutorial002_py39.py is located at docs_src/custom_docs_ui/tutorial002_py39.py (domain: FastAPI, subdomain: Responses, directory: docs_src/custom_docs_ui).

Analyze Your Own Codebase

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

Try Supermodel Free