test_openapi_schema() — fastapi Function Reference
Architecture documentation for the test_openapi_schema() function in test_response_class_no_mediatype.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD a7286d44_b7f1_9aed_5dc6_f2a2754daddb["test_openapi_schema()"] 0514cccf_589d_c09f_257b_6e926a52a0c0["test_response_class_no_mediatype.py"] a7286d44_b7f1_9aed_5dc6_f2a2754daddb -->|defined in| 0514cccf_589d_c09f_257b_6e926a52a0c0 style a7286d44_b7f1_9aed_5dc6_f2a2754daddb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_response_class_no_mediatype.py lines 40–114
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": {
"/a": {
"get": {
"responses": {
"500": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/JsonApiError"
}
}
},
},
"200": {"description": "Successful Response"},
},
"summary": "A",
"operationId": "a_a_get",
}
},
"/b": {
"get": {
"responses": {
"500": {
"description": "Error",
"content": {
"application/json": {
"schema": {"$ref": "#/components/schemas/Error"}
}
},
},
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
},
},
"summary": "B",
"operationId": "b_b_get",
}
},
},
"components": {
"schemas": {
"Error": {
"title": "Error",
"required": ["status", "title"],
"type": "object",
"properties": {
"status": {"title": "Status", "type": "string"},
"title": {"title": "Title", "type": "string"},
},
},
"JsonApiError": {
"title": "JsonApiError",
"required": ["errors"],
"type": "object",
"properties": {
"errors": {
"title": "Errors",
"type": "array",
"items": {"$ref": "#/components/schemas/Error"},
}
},
},
}
},
}
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_openapi_schema() do?
test_openapi_schema() is a function in the fastapi codebase, defined in tests/test_response_class_no_mediatype.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_response_class_no_mediatype.py at line 40.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free