Home / Function/ test_openapi() — fastapi Function Reference

test_openapi() — fastapi Function Reference

Architecture documentation for the test_openapi() function in test_tutorial001.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  c0b2c031_399d_d09c_3c00_5a6aac7045a4["test_openapi()"]
  42e533dc_5c15_97f1_40aa_6113bd861f8a["test_tutorial001.py"]
  c0b2c031_399d_d09c_3c00_5a6aac7045a4 -->|defined in| 42e533dc_5c15_97f1_40aa_6113bd861f8a
  style c0b2c031_399d_d09c_3c00_5a6aac7045a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py lines 15–38

def test_openapi():
    response = client.get("/openapi.json")
    assert response.status_code == 200
    assert response.json() == snapshot(
        {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/app": {
                    "get": {
                        "summary": "Read Main",
                        "operationId": "read_main_app_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            }
                        },
                    }
                }
            },
            "servers": [{"url": "/api/v1"}],
        }
    )

Domain

Subdomains

Frequently Asked Questions

What does test_openapi() do?
test_openapi() is a function in the fastapi codebase, defined in tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py.
Where is test_openapi() defined?
test_openapi() is defined in tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py at line 15.

Analyze Your Own Codebase

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

Try Supermodel Free