Home / Function/ test_optional_str_schema() — fastapi Function Reference

test_optional_str_schema() — fastapi Function Reference

Architecture documentation for the test_optional_str_schema() function in test_optional_str.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  21514f34_8c32_ba61_e7a9_3e88684a43d5["test_optional_str_schema()"]
  dfeed45d_bdd4_d7f2_b74f_c67acc7b9d16["test_optional_str.py"]
  21514f34_8c32_ba61_e7a9_3e88684a43d5 -->|defined in| dfeed45d_bdd4_d7f2_b74f_c67acc7b9d16
  5fadf4ad_2b8a_4b4f_fde9_555fff6ad722["get_body_model_name()"]
  21514f34_8c32_ba61_e7a9_3e88684a43d5 -->|calls| 5fadf4ad_2b8a_4b4f_fde9_555fff6ad722
  style 21514f34_8c32_ba61_e7a9_3e88684a43d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_request_params/test_form/test_optional_str.py lines 34–47

def test_optional_str_schema(path: str):
    openapi = app.openapi()
    body_model_name = get_body_model_name(openapi, path)

    assert app.openapi()["components"]["schemas"][body_model_name] == {
        "properties": {
            "p": {
                "anyOf": [{"type": "string"}, {"type": "null"}],
                "title": "P",
            },
        },
        "title": body_model_name,
        "type": "object",
    }

Domain

Subdomains

Frequently Asked Questions

What does test_optional_str_schema() do?
test_optional_str_schema() is a function in the fastapi codebase, defined in tests/test_request_params/test_form/test_optional_str.py.
Where is test_optional_str_schema() defined?
test_optional_str_schema() is defined in tests/test_request_params/test_form/test_optional_str.py at line 34.
What does test_optional_str_schema() call?
test_optional_str_schema() calls 1 function(s): get_body_model_name.

Analyze Your Own Codebase

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

Try Supermodel Free