{
    "openapi": "3.0.0",
    "info": {
        "title": "BMI标准体重 - API文档",
        "version": "1.0.0",
        "description": "通过国际权威的标准体重指数（BMI）计算身材是否标准以及健康风险，成年人正常标准体重指数为18.5－23.9。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/bmi\/index": {
            "get": {
                "summary": "BMI标准体重判断",
                "tags": [
                    "BMI标准体重"
                ],
                "description": "身材指数查询减肥增重每一天",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "sex",
                        "in": "query",
                        "description": "0为男性[默认]，1为女性",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "0为男性[默认]，1为女性"
                        }
                    },
                    {
                        "name": "height",
                        "in": "query",
                        "description": "身高，单位厘米(cm)",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 172,
                            "description": "身高，单位厘米(cm)"
                        }
                    },
                    {
                        "name": "weight",
                        "in": "query",
                        "description": "体重，单位千克(kg)",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 58,
                            "description": "体重，单位千克(kg)"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "bmi": {
                                            "type": "int",
                                            "example": 19.6,
                                            "description": "体重指数BMI"
                                        },
                                        "tip": {
                                            "type": "string",
                                            "example": "哇，标准身材，请注意保持健康作息方式。",
                                            "description": "身材小贴士"
                                        },
                                        "healthy": {
                                            "type": "string",
                                            "example": "风险一般",
                                            "description": "健康风险"
                                        },
                                        "normbmi": {
                                            "type": "string",
                                            "example": "18.5~23.9",
                                            "description": "正常BMI指数范围"
                                        },
                                        "normweight": {
                                            "type": "string",
                                            "example": "57.96~70.80",
                                            "description": "正常体重范围"
                                        },
                                        "idealweight": {
                                            "type": "int",
                                            "example": 64.4,
                                            "description": "标准体重"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "bmi": 19.6,
                                        "tip": "哇，标准身材，请继续保持健康作息方式。",
                                        "healthy": "风险一般",
                                        "normbmi": "18.5~23.9",
                                        "normweight": "57.96~70.84",
                                        "idealweight": 64.4
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "BMI标准体重判断",
                "tags": [
                    "BMI标准体重"
                ],
                "description": "身材指数查询减肥增重每一天",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "sex": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "0为男性[默认]，1为女性"
                                    },
                                    "height": {
                                        "type": "int",
                                        "example": 172,
                                        "description": "身高，单位厘米(cm)"
                                    },
                                    "weight": {
                                        "type": "int",
                                        "example": 58,
                                        "description": "体重，单位千克(kg)"
                                    }
                                },
                                "required": [
                                    "key",
                                    "height",
                                    "weight"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "bmi": {
                                            "type": "int",
                                            "example": 19.6,
                                            "description": "体重指数BMI"
                                        },
                                        "tip": {
                                            "type": "string",
                                            "example": "哇，标准身材，请注意保持健康作息方式。",
                                            "description": "身材小贴士"
                                        },
                                        "healthy": {
                                            "type": "string",
                                            "example": "风险一般",
                                            "description": "健康风险"
                                        },
                                        "normbmi": {
                                            "type": "string",
                                            "example": "18.5~23.9",
                                            "description": "正常BMI指数范围"
                                        },
                                        "normweight": {
                                            "type": "string",
                                            "example": "57.96~70.80",
                                            "description": "正常体重范围"
                                        },
                                        "idealweight": {
                                            "type": "int",
                                            "example": 64.4,
                                            "description": "标准体重"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "bmi": 19.6,
                                        "tip": "哇，标准身材，请继续保持健康作息方式。",
                                        "healthy": "风险一般",
                                        "normbmi": "18.5~23.9",
                                        "normweight": "57.96~70.84",
                                        "idealweight": 64.4
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}