test_openapi_schema() — fastapi Function Reference
Architecture documentation for the test_openapi_schema() function in test_regex_deprecated_params.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 69ce4c69_3855_e6a8_4b4b_af49123def0d["test_openapi_schema()"] 3115589e_a081_ce28_ae94_1ef83d2bd277["test_regex_deprecated_params.py"] 69ce4c69_3855_e6a8_4b4b_af49123def0d -->|defined in| 3115589e_a081_ce28_ae94_1ef83d2bd277 3e264647_060d_092b_b0c5_437ea40ab0e0["get_client()"] 69ce4c69_3855_e6a8_4b4b_af49123def0d -->|calls| 3e264647_060d_092b_b0c5_437ea40ab0e0 style 69ce4c69_3855_e6a8_4b4b_af49123def0d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_regex_deprecated_params.py lines 64–146
def test_openapi_schema():
client = get_client()
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": "q",
"in": "query",
"required": False,
"schema": {
"anyOf": [
{"type": "string", "pattern": "^fixedquery$"},
{"type": "null"},
],
"title": "Q",
},
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
},
},
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail",
}
},
"type": "object",
"title": "HTTPValidationError",
},
"ValidationError": {
"properties": {
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
"loc": {
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
"type": "array",
"title": "Location",
},
"msg": {"type": "string", "title": "Message"},
"type": {"type": "string", "title": "Error Type"},
},
"type": "object",
"required": ["loc", "msg", "type"],
"title": "ValidationError",
},
}
},
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does test_openapi_schema() do?
test_openapi_schema() is a function in the fastapi codebase, defined in tests/test_regex_deprecated_params.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_regex_deprecated_params.py at line 64.
What does test_openapi_schema() call?
test_openapi_schema() calls 1 function(s): get_client.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free