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. 5 imports, 1 dependents.

File python FastAPI Responses 5 imports 1 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  21963e59_2145_4b3f_7959_1cb20fa40113["tutorial001_py39.py"]
  534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"]
  21963e59_2145_4b3f_7959_1cb20fa40113 --> 534f6e44_61b8_3c38_8b89_6934a6df9802
  6383cfb2_5918_5c8c_5124_dbbbe44fbe24["docs.py"]
  21963e59_2145_4b3f_7959_1cb20fa40113 --> 6383cfb2_5918_5c8c_5124_dbbbe44fbe24
  609573dc_dd8d_bd61_f42b_83a7d4873d61["get_redoc_html"]
  21963e59_2145_4b3f_7959_1cb20fa40113 --> 609573dc_dd8d_bd61_f42b_83a7d4873d61
  3705e434_dfc7_b070_aae6_93314a9b9976["get_swagger_ui_html"]
  21963e59_2145_4b3f_7959_1cb20fa40113 --> 3705e434_dfc7_b070_aae6_93314a9b9976
  9e591d9c_65d6_09d8_497c_322cdf94b4b4["get_swagger_ui_oauth2_redirect_html"]
  21963e59_2145_4b3f_7959_1cb20fa40113 --> 9e591d9c_65d6_09d8_497c_322cdf94b4b4
  9f9bd4b0_1cad_90ba_a82e_141dce5c9f58["test_tutorial001.py"]
  9f9bd4b0_1cad_90ba_a82e_141dce5c9f58 --> 21963e59_2145_4b3f_7959_1cb20fa40113
  style 21963e59_2145_4b3f_7959_1cb20fa40113 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,
)

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


@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="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js",
        swagger_css_url="https://unpkg.com/swagger-ui-dist@5/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="https://unpkg.com/redoc@2/bundles/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 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 4 function(s): custom_swagger_ui_html, read_user, redoc_html, swagger_ui_redirect.
What does tutorial001_py39.py depend on?
tutorial001_py39.py imports 5 module(s): __init__.py, docs.py, get_redoc_html, get_swagger_ui_html, get_swagger_ui_oauth2_redirect_html.
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/custom_docs_ui/tutorial001_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