Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  08ce540f_ba8d_baf3_352d_05ce77838706["test_openapi_schema()"]
  6f861856_fac2_cab6_ed64_8a5d89aac432["test_response_by_alias.py"]
  08ce540f_ba8d_baf3_352d_05ce77838706 -->|defined in| 6f861856_fac2_cab6_ed64_8a5d89aac432
  style 08ce540f_ba8d_baf3_352d_05ce77838706 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_response_by_alias.py lines 137–330

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": {
                "/dict": {
                    "get": {
                        "summary": "Read Dict",
                        "operationId": "read_dict_dict_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {"$ref": "#/components/schemas/Model"}
                                    }
                                },
                            }
                        },
                    }
                },
                "/model": {
                    "get": {
                        "summary": "Read Model",
                        "operationId": "read_model_model_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {"$ref": "#/components/schemas/Model"}
                                    }
                                },
                            }
                        },
                    }
                },
                "/list": {
                    "get": {
                        "summary": "Read List",
                        "operationId": "read_list_list_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "title": "Response Read List List Get",
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Model"
                                            },
                                        }
                                    }
                                },
                            }
                        },
                    }
                },
                "/by-alias/dict": {
                    "get": {
                        "summary": "By Alias Dict",
                        "operationId": "by_alias_dict_by_alias_dict_get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {"$ref": "#/components/schemas/Model"}
                                    }
                                },
                            }
                        },
                    }
                },
                "/by-alias/model": {
                    "get": {
                        "summary": "By Alias Model",

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_response_by_alias.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_response_by_alias.py at line 137.

Analyze Your Own Codebase

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

Try Supermodel Free