Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

Architecture documentation for the test_openapi_schema() function in test_generic_parameterless_depends.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  e57f30b4_6ce7_52a9_4712_e23aa29aeb03["test_openapi_schema()"]
  06b940f1_b201_e0d5_89cb_95898096d6be["test_generic_parameterless_depends.py"]
  e57f30b4_6ce7_52a9_4712_e23aa29aeb03 -->|defined in| 06b940f1_b201_e0d5_89cb_95898096d6be
  style e57f30b4_6ce7_52a9_4712_e23aa29aeb03 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_generic_parameterless_depends.py lines 45–79

def test_openapi_schema():
    response = client.get("/openapi.json")
    assert response.status_code == 200, response.text
    assert response.json() == snapshot(
        {
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "openapi": "3.1.0",
            "paths": {
                "/a": {
                    "get": {
                        "operationId": "a_a_get",
                        "responses": {
                            "200": {
                                "content": {"application/json": {"schema": {}}},
                                "description": "Successful Response",
                            }
                        },
                        "summary": "A",
                    }
                },
                "/b": {
                    "get": {
                        "operationId": "b_b_get",
                        "responses": {
                            "200": {
                                "content": {"application/json": {"schema": {}}},
                                "description": "Successful Response",
                            }
                        },
                        "summary": "B",
                    }
                },
            },
        }
    )

Domain

Subdomains

Frequently Asked Questions

What does test_openapi_schema() do?
test_openapi_schema() is a function in the fastapi codebase, defined in tests/test_generic_parameterless_depends.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_generic_parameterless_depends.py at line 45.

Analyze Your Own Codebase

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

Try Supermodel Free