Home / Function/ test_optional_schema() — fastapi Function Reference

test_optional_schema() — fastapi Function Reference

Architecture documentation for the test_optional_schema() function in test_optional.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  b1bc59e7_cd1b_3566_ec1b_091cc440f5e1["test_optional_schema()"]
  ca62ab9d_6699_f566_9a0c_577e941c769c["test_optional.py"]
  b1bc59e7_cd1b_3566_ec1b_091cc440f5e1 -->|defined in| ca62ab9d_6699_f566_9a0c_577e941c769c
  d1360ba2_24b5_be26_1bb8_d64ba3706aef["get_body_model_name()"]
  b1bc59e7_cd1b_3566_ec1b_091cc440f5e1 -->|calls| d1360ba2_24b5_be26_1bb8_d64ba3706aef
  style b1bc59e7_cd1b_3566_ec1b_091cc440f5e1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_request_params/test_file/test_optional.py lines 32–48

def test_optional_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", "format": "binary"},
                    {"type": "null"},
                ],
                "title": "P",
            }
        },
        "title": body_model_name,
        "type": "object",
    }

Domain

Subdomains

Frequently Asked Questions

What does test_optional_schema() do?
test_optional_schema() is a function in the fastapi codebase, defined in tests/test_request_params/test_file/test_optional.py.
Where is test_optional_schema() defined?
test_optional_schema() is defined in tests/test_request_params/test_file/test_optional.py at line 32.
What does test_optional_schema() call?
test_optional_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