Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d92ff0df_9136_14de_1954_75eba5dd5b5c["test_openapi_schema()"]
  0a65a3af_f6dc_1275_2ed7_2fa9f4e69088["test_arbitrary_types.py"]
  d92ff0df_9136_14de_1954_75eba5dd5b5c -->|defined in| 0a65a3af_f6dc_1275_2ed7_2fa9f4e69088
  style d92ff0df_9136_14de_1954_75eba5dd5b5c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_arbitrary_types.py lines 92–135

def test_openapi_schema(client: TestClient):
    response = client.get("openapi.json")
    assert response.json() == snapshot(
        {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
                        "summary": "Test",
                        "operationId": "test__get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/MyModel"
                                        }
                                    }
                                },
                            }
                        },
                    }
                }
            },
            "components": {
                "schemas": {
                    "MyModel": {
                        "properties": {
                            "custom_field": {
                                "items": {"type": "number"},
                                "type": "array",
                                "title": "Custom Field",
                            }
                        },
                        "type": "object",
                        "required": ["custom_field"],
                        "title": "MyModel",
                    }
                }
            },
        }
    )

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_arbitrary_types.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_arbitrary_types.py at line 92.

Analyze Your Own Codebase

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

Try Supermodel Free