Home / Function/ test_openapi_schema() — fastapi Function Reference

test_openapi_schema() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a984c255_9910_c07c_60c4_709834768d28["test_openapi_schema()"]
  23de5266_6d76_5349_62c3_4c0e8a118b67["test_repeated_parameter_alias.py"]
  a984c255_9910_c07c_60c4_709834768d28 -->|defined in| 23de5266_6d76_5349_62c3_4c0e8a118b67
  style a984c255_9910_c07c_60c4_709834768d28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_repeated_parameter_alias.py lines 25–106

def test_openapi_schema():
    response = client.get("/openapi.json")
    assert response.status_code == status.HTTP_200_OK
    assert response.json() == snapshot(
        {
            "components": {
                "schemas": {
                    "HTTPValidationError": {
                        "properties": {
                            "detail": {
                                "items": {
                                    "$ref": "#/components/schemas/ValidationError"
                                },
                                "title": "Detail",
                                "type": "array",
                            }
                        },
                        "title": "HTTPValidationError",
                        "type": "object",
                    },
                    "ValidationError": {
                        "properties": {
                            "ctx": {"title": "Context", "type": "object"},
                            "input": {"title": "Input"},
                            "loc": {
                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                                "title": "Location",
                                "type": "array",
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                        "required": ["loc", "msg", "type"],
                        "title": "ValidationError",
                        "type": "object",
                    },
                }
            },
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "openapi": "3.1.0",
            "paths": {
                "/{repeated_alias}": {
                    "get": {
                        "operationId": "get_parameters_with_repeated_aliases__repeated_alias__get",
                        "parameters": [
                            {
                                "in": "path",
                                "name": "repeated_alias",
                                "required": True,
                                "schema": {"title": "Repeated Alias", "type": "string"},
                            },
                            {
                                "in": "query",
                                "name": "repeated_alias",
                                "required": True,
                                "schema": {"title": "Repeated Alias", "type": "string"},
                            },
                        ],
                        "responses": {
                            "200": {
                                "content": {"application/json": {"schema": {}}},
                                "description": "Successful Response",
                            },
                            "422": {
                                "content": {
                                    "application/json": {
                                        "schema": {
                                            "$ref": "#/components/schemas/HTTPValidationError"
                                        }
                                    }
                                },
                                "description": "Validation Error",
                            },
                        },
                        "summary": "Get Parameters With Repeated Aliases",
                    }
                }
            },
        }

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_repeated_parameter_alias.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_repeated_parameter_alias.py at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free