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 Responses 1 imports 4 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  9f6ffe39_b348_5643_336e_8d6ee8bb59bb["utils.py"]
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  9f6ffe39_b348_5643_336e_8d6ee8bb59bb --> 0dda2280_3359_8460_301c_e98c77e78185
  3ddb4f07_0c59_5365_890b_2b4fea5a3dde["test_list.py"]
  3ddb4f07_0c59_5365_890b_2b4fea5a3dde --> 9f6ffe39_b348_5643_336e_8d6ee8bb59bb
  e5136429_9a94_4b13_0278_d22fff767687["test_optional_list.py"]
  e5136429_9a94_4b13_0278_d22fff767687 --> 9f6ffe39_b348_5643_336e_8d6ee8bb59bb
  3f7d416c_ad03_437e_1805_be947abbd565["test_optional_str.py"]
  3f7d416c_ad03_437e_1805_be947abbd565 --> 9f6ffe39_b348_5643_336e_8d6ee8bb59bb
  2c757026_ce58_cb5f_e4a3_710daa866978["test_required_str.py"]
  2c757026_ce58_cb5f_e4a3_710daa866978 --> 9f6ffe39_b348_5643_336e_8d6ee8bb59bb
  style 9f6ffe39_b348_5643_336e_8d6ee8bb59bb 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/json"]["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, Responses 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_body/utils.py (domain: FastAPI, subdomain: Responses, directory: tests/test_request_params/test_body).

Analyze Your Own Codebase

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

Try Supermodel Free