Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fea7d982_1426_b206_6058_e05dde48f71a["test_openapi_schema()"]
  16af9b4a_d630_3cfd_79ed_44bfc929e2d1["test_param_include_in_schema.py"]
  fea7d982_1426_b206_6058_e05dde48f71a -->|defined in| 16af9b4a_d630_3cfd_79ed_44bfc929e2d1
  style fea7d982_1426_b206_6058_e05dde48f71a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_param_include_in_schema.py lines 114–248

def test_openapi_schema():
    client = TestClient(app)
    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": {
                "/hidden_cookie": {
                    "get": {
                        "summary": "Hidden Cookie",
                        "operationId": "hidden_cookie_hidden_cookie_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                },
                "/hidden_header": {
                    "get": {
                        "summary": "Hidden Header",
                        "operationId": "hidden_header_hidden_header_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                },
                "/hidden_path/{hidden_path}": {
                    "get": {
                        "summary": "Hidden Path",
                        "operationId": "hidden_path_hidden_path__hidden_path__get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                },
                "/hidden_query": {
                    "get": {
                        "summary": "Hidden Query",
                        "operationId": "hidden_query_hidden_query_get",
                        "responses": {
                            "200": {

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_param_include_in_schema.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_param_include_in_schema.py at line 114.

Analyze Your Own Codebase

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

Try Supermodel Free