|
@ -12,6 +12,7 @@ client = TestClient(app) |
|
|
[ |
|
|
[ |
|
|
("/api_route", 200, {"message": "Hello World"}), |
|
|
("/api_route", 200, {"message": "Hello World"}), |
|
|
("/non_decorated_route", 200, {"message": "Hello World"}), |
|
|
("/non_decorated_route", 200, {"message": "Hello World"}), |
|
|
|
|
|
("/multiple-methods", 200, {"message": "Hello World"}), |
|
|
("/nonexistent", 404, {"detail": "Not Found"}), |
|
|
("/nonexistent", 404, {"detail": "Not Found"}), |
|
|
], |
|
|
], |
|
|
) |
|
|
) |
|
@ -1163,6 +1164,28 @@ def test_openapi_schema(): |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
"/multiple-methods": { |
|
|
|
|
|
"get": { |
|
|
|
|
|
"summary": "Multiple Methods", |
|
|
|
|
|
"operationId": "multiple_methods_multiple_methods_get", |
|
|
|
|
|
"responses": { |
|
|
|
|
|
"200": { |
|
|
|
|
|
"description": "Successful Response", |
|
|
|
|
|
"content": {"application/json": {"schema": {}}}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
"post": { |
|
|
|
|
|
"summary": "Multiple Methods", |
|
|
|
|
|
"operationId": "multiple_methods_multiple_methods_post", |
|
|
|
|
|
"responses": { |
|
|
|
|
|
"200": { |
|
|
|
|
|
"description": "Successful Response", |
|
|
|
|
|
"content": {"application/json": {"schema": {}}}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
"/query/list": { |
|
|
"/query/list": { |
|
|
"get": { |
|
|
"get": { |
|
|
"summary": "Get Query List", |
|
|
"summary": "Get Query List", |
|
@ -1251,6 +1274,17 @@ def test_openapi_schema(): |
|
|
}, |
|
|
}, |
|
|
"components": { |
|
|
"components": { |
|
|
"schemas": { |
|
|
"schemas": { |
|
|
|
|
|
"HTTPValidationError": { |
|
|
|
|
|
"title": "HTTPValidationError", |
|
|
|
|
|
"type": "object", |
|
|
|
|
|
"properties": { |
|
|
|
|
|
"detail": { |
|
|
|
|
|
"title": "Detail", |
|
|
|
|
|
"type": "array", |
|
|
|
|
|
"items": {"$ref": "#/components/schemas/ValidationError"}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
"ValidationError": { |
|
|
"ValidationError": { |
|
|
"title": "ValidationError", |
|
|
"title": "ValidationError", |
|
|
"required": ["loc", "msg", "type"], |
|
|
"required": ["loc", "msg", "type"], |
|
@ -1267,17 +1301,6 @@ def test_openapi_schema(): |
|
|
"type": {"title": "Error Type", "type": "string"}, |
|
|
"type": {"title": "Error Type", "type": "string"}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
"HTTPValidationError": { |
|
|
|
|
|
"title": "HTTPValidationError", |
|
|
|
|
|
"type": "object", |
|
|
|
|
|
"properties": { |
|
|
|
|
|
"detail": { |
|
|
|
|
|
"title": "Detail", |
|
|
|
|
|
"type": "array", |
|
|
|
|
|
"items": {"$ref": "#/components/schemas/ValidationError"}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|