Home / File/ tutorial009c_py39.py — fastapi Source File

tutorial009c_py39.py — fastapi Source File

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

File python FastAPI Responses 3 imports 1 dependents 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  4606954e_0e96_fb87_3123_b0247c04d659["tutorial009c_py39.py"]
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  4606954e_0e96_fb87_3123_b0247c04d659 --> 0dda2280_3359_8460_301c_e98c77e78185
  9de9d538_b3d9_ff4a_53fa_f662e9eee826["orjson"]
  4606954e_0e96_fb87_3123_b0247c04d659 --> 9de9d538_b3d9_ff4a_53fa_f662e9eee826
  534f6e44_61b8_3c38_8b89_6934a6df9802["__init__.py"]
  4606954e_0e96_fb87_3123_b0247c04d659 --> 534f6e44_61b8_3c38_8b89_6934a6df9802
  2cf59e9d_f3e5_31ed_6665_16da7c53961b["test_tutorial009c.py"]
  2cf59e9d_f3e5_31ed_6665_16da7c53961b --> 4606954e_0e96_fb87_3123_b0247c04d659
  style 4606954e_0e96_fb87_3123_b0247c04d659 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from typing import Any

import orjson
from fastapi import FastAPI, Response

app = FastAPI()


class CustomORJSONResponse(Response):
    media_type = "application/json"

    def render(self, content: Any) -> bytes:
        assert orjson is not None, "orjson must be installed"
        return orjson.dumps(content, option=orjson.OPT_INDENT_2)


@app.get("/", response_class=CustomORJSONResponse)
async def main():
    return {"message": "Hello World"}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does tutorial009c_py39.py do?
tutorial009c_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 tutorial009c_py39.py?
tutorial009c_py39.py defines 1 function(s): main.
What does tutorial009c_py39.py depend on?
tutorial009c_py39.py imports 3 module(s): __init__.py, orjson, typing.
What files import tutorial009c_py39.py?
tutorial009c_py39.py is imported by 1 file(s): test_tutorial009c.py.
Where is tutorial009c_py39.py in the architecture?
tutorial009c_py39.py is located at docs_src/custom_response/tutorial009c_py39.py (domain: FastAPI, subdomain: Responses, directory: docs_src/custom_response).

Analyze Your Own Codebase

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

Try Supermodel Free