{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/": {"get": {"summary": "Root", "description": "\u6839\u8def\u5f91\u8def\u7531 - \u81ea\u52d5\u91cd\u5c0e\u5411\u5230 API \u6587\u4ef6\u9801\u9762\n\n\u529f\u80fd\u8aaa\u660e\uff1a\n- \u7576\u4f7f\u7528\u8005\u8a2a\u554f http://127.0.0.1:8000/ \u6642\n- \u6703\u81ea\u52d5\u8df3\u8f49\u5230 /docs\uff08Swagger UI \u6587\u4ef6\u9801\u9762\uff09\n- 301 \u8868\u793a\u300c\u6c38\u4e45\u91cd\u5c0e\u5411\u300d\u72c0\u614b\u78bc", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries": {"get": {"summary": "Countries", "description": "\u5217\u51fa\u6240\u6709\u570b\u5bb6\u7684\u8def\u7531\n\nURL: GET /countries\n\u56de\u50b3: \u5305\u542b\u6240\u6709\u570b\u5bb6\u540d\u7a31\u7684 JSON \u9663\u5217\n\u7bc4\u4f8b\u56de\u50b3: [\"England\", \"France\", \"Germany\", \"Peru\", \"Portugal\", \"Italy\", \"Spain\"]\n\n\u5b78\u7fd2\u91cd\u9ede\uff1a\n- data.keys() \u53d6\u5f97\u5b57\u5178\u4e2d\u6240\u6709\u7684\u9375\uff08\u570b\u5bb6\u540d\u7a31\uff09\n- list() \u5c07\u7d50\u679c\u8f49\u63db\u70ba\u4e32\u5217", "operationId": "countries_countries_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/countries/{country}": {"get": {"summary": "Cities", "description": "\u5217\u51fa\u7279\u5b9a\u570b\u5bb6\u7684\u6240\u6709\u57ce\u5e02\n\nURL: GET /countries/{country}\n\u53c3\u6578: country - \u570b\u5bb6\u540d\u7a31\uff08\u8def\u5f91\u53c3\u6578\uff09\n\u56de\u50b3: \u5305\u542b\u8a72\u570b\u5bb6\u6240\u6709\u57ce\u5e02\u540d\u7a31\u7684 JSON \u9663\u5217\n\u7bc4\u4f8b: GET /countries/England \u2192 [\"London\"]\n\n\u5b78\u7fd2\u91cd\u9ede\uff1a\n- {country} \u662f\u8def\u5f91\u53c3\u6578\uff0c\u6703\u81ea\u52d5\u5c0d\u61c9\u5230\u51fd\u5f0f\u53c3\u6578\n- country: str \u8868\u793a\u9019\u500b\u53c3\u6578\u662f\u5b57\u4e32\u578b\u5225\n- data[country] \u53d6\u5f97\u8a72\u570b\u5bb6\u7684\u8cc7\u6599\n- .keys() \u53d6\u5f97\u6240\u6709\u57ce\u5e02\u540d\u7a31", "operationId": "cities_countries__country__get", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "title": "Country"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/countries/{country}/{city}/{month}": {"get": {"summary": "Monthly Average", "description": "\u67e5\u8a62\u7279\u5b9a\u57ce\u5e02\u67d0\u6708\u4efd\u7684\u6b77\u53f2\u6eab\u5ea6\n\nURL: GET /countries/{country}/{city}/{month}\n\u53c3\u6578:\n- country: \u570b\u5bb6\u540d\u7a31\n- city: \u57ce\u5e02\u540d\u7a31\n- month: \u6708\u4efd\uff08\u4f8b\u5982 \"January\", \"February\" \u7b49\uff09\n\n\u56de\u50b3: \u5305\u542b\u6b77\u53f2\u9ad8\u6eab (high) \u548c\u4f4e\u6eab (low) \u7684 JSON \u7269\u4ef6\n\u7bc4\u4f8b: GET /countries/England/London/January\n \u2192 {\"high\": 48.0, \"low\": 35.6}\n\n\u5b78\u7fd2\u91cd\u9ede\uff1a\n- \u53ef\u4ee5\u6709\u591a\u500b\u8def\u5f91\u53c3\u6578\n- \u900f\u904e\u5de2\u72c0\u5b57\u5178\u5b58\u53d6\u8cc7\u6599: data[\u570b\u5bb6][\u57ce\u5e02][\u6708\u4efd]", "operationId": "monthly_average_countries__country___city___month__get", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "title": "Country"}}, {"name": "city", "in": "path", "required": true, "schema": {"type": "string", "title": "City"}}, {"name": "month", "in": "path", "required": true, "schema": {"type": "string", "title": "Month"}}], "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": {"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"}}}}