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
  9901726c_b24b_72e4_9729_a32641b34872["test_openapi()"]
  68fab5bf_d288_818d_ce80_472dd26a29a4["test_tutorial001.py"]
  9901726c_b24b_72e4_9729_a32641b34872 -->|defined in| 68fab5bf_d288_818d_ce80_472dd26a29a4
  style 9901726c_b24b_72e4_9729_a32641b34872 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_graphql/test_tutorial001.py lines 27–73

def test_openapi(client: TestClient):
    response = client.get("/openapi.json")
    assert response.status_code == 200
    assert response.json() == snapshot(
        {
            "info": {
                "title": "FastAPI",
                "version": "0.1.0",
            },
            "openapi": "3.1.0",
            "paths": {
                "/graphql": {
                    "get": {
                        "operationId": "handle_http_get_graphql_get",
                        "responses": {
                            "200": {
                                "content": {
                                    "application/json": {
                                        "schema": {},
                                    },
                                },
                                "description": "The GraphiQL integrated development environment.",
                            },
                            "404": {
                                "description": "Not found if GraphiQL or query via GET are not enabled.",
                            },
                        },
                        "summary": "Handle Http Get",
                    },
                    "post": {
                        "operationId": "handle_http_post_graphql_post",
                        "responses": {
                            "200": {
                                "content": {
                                    "application/json": {
                                        "schema": {},
                                    },
                                },
                                "description": "Successful Response",
                            },
                        },
                        "summary": "Handle Http Post",
                    },
                },
            },
        }
    )

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_graphql/test_tutorial001.py.
Where is test_openapi() defined?
test_openapi() is defined in tests/test_tutorial/test_graphql/test_tutorial001.py at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free