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 cf2b6d3e_7dda_5ca4_f13e_0cefc7248fa7["test_openapi_schema()"] a55fd08b_c04c_97f2_efca_060f542ca1af["test_tutorial002.py"] cf2b6d3e_7dda_5ca4_f13e_0cefc7248fa7 -->|defined in| a55fd08b_c04c_97f2_efca_060f542ca1af style cf2b6d3e_7dda_5ca4_f13e_0cefc7248fa7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_tutorial/test_body_multiple_params/test_tutorial002.py lines 198–366
def test_openapi_schema(client: TestClient):
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == snapshot(
{
"info": {
"title": "FastAPI",
"version": "0.1.0",
},
"openapi": "3.1.0",
"paths": {
"/items/{item_id}": {
"put": {
"operationId": "update_item_items__item_id__put",
"parameters": [
{
"in": "path",
"name": "item_id",
"required": True,
"schema": {
"title": "Item Id",
"type": "integer",
},
},
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Body_update_item_items__item_id__put",
},
},
},
"required": True,
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {},
},
},
"description": "Successful Response",
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError",
},
},
},
"description": "Validation Error",
},
},
"summary": "Update Item",
},
},
},
"components": {
"schemas": {
"Body_update_item_items__item_id__put": {
"properties": {
"item": {
"$ref": "#/components/schemas/Item",
},
"user": {
"$ref": "#/components/schemas/User",
},
},
"required": [
"item",
"user",
],
"title": "Body_update_item_items__item_id__put",
"type": "object",
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
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_body_multiple_params/test_tutorial002.py.
Where is test_openapi_schema() defined?
test_openapi_schema() is defined in tests/test_tutorial/test_body_multiple_params/test_tutorial002.py at line 198.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free