test_openapi_schema() — fastapi Function Reference
Architecture documentation for the test_openapi_schema() function in test_top_level_security_scheme_in_openapi.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 04c8f412_ce11_4fec_40c6_32fe58e8baee["test_openapi_schema()"] e3231cdc_0792_5877_3436_629083a05aa3["test_top_level_security_scheme_in_openapi.py"] 04c8f412_ce11_4fec_40c6_32fe58e8baee -->|defined in| e3231cdc_0792_5877_3436_629083a05aa3 style 04c8f412_ce11_4fec_40c6_32fe58e8baee fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_top_level_security_scheme_in_openapi.py lines 34–60
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": {
"/": {
"get": {
"summary": "Get Root",
"operationId": "get_root__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
}
},
"security": [{"HTTPBearer": []}],
}
}
},
"components": {
"securitySchemes": {"HTTPBearer": {"type": "http", "scheme": "bearer"}}
},
}
)
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_top_level_security_scheme_in_openapi.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_top_level_security_scheme_in_openapi.py at line 34.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free