Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7ff95c1f_6e0d_08e6_c8ed_eb17701bfbbd["test_openapi_schema()"]
  4089f7ef_2338_51f0_d8fe_1b0ec024c456["test_tutorial005.py"]
  7ff95c1f_6e0d_08e6_c8ed_eb17701bfbbd -->|defined in| 4089f7ef_2338_51f0_d8fe_1b0ec024c456
  style 7ff95c1f_6e0d_08e6_c8ed_eb17701bfbbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_extra_models/test_tutorial005.py lines 27–57

def test_openapi_schema(client: TestClient):
    response = client.get("/openapi.json")
    assert response.status_code == 200, response.text
    assert response.json() == snapshot(
        {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/keyword-weights/": {
                    "get": {
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "title": "Response Read Keyword Weights Keyword Weights  Get",
                                            "type": "object",
                                            "additionalProperties": {"type": "number"},
                                        }
                                    }
                                },
                            }
                        },
                        "summary": "Read Keyword Weights",
                        "operationId": "read_keyword_weights_keyword_weights__get",
                    }
                }
            },
        }
    )

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_tutorial/test_extra_models/test_tutorial005.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_tutorial/test_extra_models/test_tutorial005.py at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free