Home / File/ utils.py — fastapi Source File

utils.py — fastapi Source File

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

File python FastAPI Applications 1 imports 4 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  1877f2a6_b800_9b18_3a1c_81db1771b81d["utils.py"]
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  1877f2a6_b800_9b18_3a1c_81db1771b81d --> 0dda2280_3359_8460_301c_e98c77e78185
  143b99d8_41e8_64ef_5f24_aa6a19a5a92f["test_list.py"]
  143b99d8_41e8_64ef_5f24_aa6a19a5a92f --> 1877f2a6_b800_9b18_3a1c_81db1771b81d
  b252ffb1_a82c_7132_1b26_b73869e66dc7["test_optional_list.py"]
  b252ffb1_a82c_7132_1b26_b73869e66dc7 --> 1877f2a6_b800_9b18_3a1c_81db1771b81d
  dfeed45d_bdd4_d7f2_b74f_c67acc7b9d16["test_optional_str.py"]
  dfeed45d_bdd4_d7f2_b74f_c67acc7b9d16 --> 1877f2a6_b800_9b18_3a1c_81db1771b81d
  45768896_4720_0ffe_18a6_a9be9369e316["test_required_str.py"]
  45768896_4720_0ffe_18a6_a9be9369e316 --> 1877f2a6_b800_9b18_3a1c_81db1771b81d
  style 1877f2a6_b800_9b18_3a1c_81db1771b81d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from typing import Any


def get_body_model_name(openapi: dict[str, Any], path: str) -> str:
    body = openapi["paths"][path]["post"]["requestBody"]
    body_schema = body["content"]["application/x-www-form-urlencoded"]["schema"]
    return body_schema.get("$ref", "").split("/")[-1]

Domain

Subdomains

Dependencies

  • typing

Frequently Asked Questions

What does utils.py do?
utils.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Applications subdomain.
What functions are defined in utils.py?
utils.py defines 1 function(s): get_body_model_name.
What does utils.py depend on?
utils.py imports 1 module(s): typing.
What files import utils.py?
utils.py is imported by 4 file(s): test_list.py, test_optional_list.py, test_optional_str.py, test_required_str.py.
Where is utils.py in the architecture?
utils.py is located at tests/test_request_params/test_form/utils.py (domain: FastAPI, subdomain: Applications, directory: tests/test_request_params/test_form).

Analyze Your Own Codebase

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

Try Supermodel Free