Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  14b71fe9_4bbc_b108_f8e1_6eb8a5167c16["test_openapi_schema()"]
  01aad658_409e_7170_8762_4d5bce266329["test_tuples.py"]
  14b71fe9_4bbc_b108_f8e1_6eb8a5167c16 -->|defined in| 01aad658_409e_7170_8762_4d5bce266329
  style 14b71fe9_4bbc_b108_f8e1_6eb8a5167c16 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tuples.py lines 84–276

def test_openapi_schema():
    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": {
                "/model-with-tuple/": {
                    "post": {
                        "summary": "Post Model With Tuple",
                        "operationId": "post_model_with_tuple_model_with_tuple__post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {"$ref": "#/components/schemas/ItemGroup"}
                                }
                            },
                            "required": True,
                        },
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                },
                "/tuple-of-models/": {
                    "post": {
                        "summary": "Post Tuple Of Models",
                        "operationId": "post_tuple_of_models_tuple_of_models__post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {
                                        "title": "Square",
                                        "maxItems": 2,
                                        "minItems": 2,
                                        "type": "array",
                                        "prefixItems": [
                                            {"$ref": "#/components/schemas/Coordinate"},
                                            {"$ref": "#/components/schemas/Coordinate"},
                                        ],
                                    }
                                }
                            },
                            "required": True,
                        },
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {"application/json": {"schema": {}}},
                            },
                            "422": {
                                "description": "Validation Error",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                            },
                        },
                    }
                },
                "/tuple-form/": {
                    "post": {
                        "summary": "Hello",
                        "operationId": "hello_tuple_form__post",

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_tuples.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_tuples.py at line 84.

Analyze Your Own Codebase

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

Try Supermodel Free