test_openapi_schema() — fastapi Function Reference
Architecture documentation for the test_openapi_schema() function in test_tutorial002.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD b7d30086_3f24_4134_dc89_1c6d80c74f80["test_openapi_schema()"] 403cc16e_3d5f_4324_0a51_b60b3753d450["test_tutorial002.py"] b7d30086_3f24_4134_dc89_1c6d80c74f80 -->|defined in| 403cc16e_3d5f_4324_0a51_b60b3753d450 style b7d30086_3f24_4134_dc89_1c6d80c74f80 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_query_param_models/test_tutorial002.py lines 121–235
def test_openapi_schema(client: TestClient):
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": {
"/items/": {
"get": {
"summary": "Read Items",
"operationId": "read_items_items__get",
"parameters": [
{
"name": "limit",
"in": "query",
"required": False,
"schema": {
"type": "integer",
"maximum": 100,
"exclusiveMinimum": 0,
"default": 100,
"title": "Limit",
},
},
{
"name": "offset",
"in": "query",
"required": False,
"schema": {
"type": "integer",
"minimum": 0,
"default": 0,
"title": "Offset",
},
},
{
"name": "order_by",
"in": "query",
"required": False,
"schema": {
"enum": ["created_at", "updated_at"],
"type": "string",
"default": "created_at",
"title": "Order By",
},
},
{
"name": "tags",
"in": "query",
"required": False,
"schema": {
"type": "array",
"items": {"type": "string"},
"default": [],
"title": "Tags",
},
},
],
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
},
},
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
Domain
Subdomains
Source
Frequently Asked Questions
What does test_openapi_schema() do?
test_openapi_schema() is a function in the fastapi codebase, defined in tests/test_tutorial/test_query_param_models/test_tutorial002.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_tutorial/test_query_param_models/test_tutorial002.py at line 121.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free