{
    "openapi": "3.0.0",
    "info": {
        "title": "成语典故 - API文档",
        "version": "1.0.0",
        "description": "返回字段包括成语典故、来源、范例、拼音等，支持模糊搜索。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/chengyu\/index": {
            "get": {
                "summary": "成语典故查询",
                "tags": [
                    "成语典故"
                ],
                "description": "返回成语对应典故来源支持关键词搜索",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "返回数量，1-50",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": 1,
                            "description": "返回数量，1-50"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "description": "0严格搜索、1模糊搜索、2拼音简写搜索",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": 1,
                            "description": "0严格搜索、1模糊搜索、2拼音简写搜索"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": 1,
                            "description": "翻页"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "搜索词",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "马到成功",
                            "description": "搜索词"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "fanli": {
                                            "type": "string",
                                            "example": "只要不轻敌，相信你们一定会～。",
                                            "description": "范例"
                                        },
                                        "chuchu": {
                                            "type": "string",
                                            "example": "元·无名氏《小尉迟》第二折：“那老尉迟这一去，马到成功。”",
                                            "description": "出处"
                                        },
                                        "diangu": {
                                            "type": "string",
                                            "example": "形容工作刚开始就取得成功。",
                                            "description": "典故"
                                        },
                                        "pinyin": {
                                            "type": "string",
                                            "example": "mǎ dào chéng gōng",
                                            "description": "拼音音标"
                                        },
                                        "chengyu": {
                                            "type": "string",
                                            "example": "马到成功",
                                            "description": "成语"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "pysx": "mdcg",
                                                "fanli": "只要不轻敌，相信你们一定会～。",
                                                "chuchu": "元·无名氏《小尉迟》第二折：“那老尉迟这一去，马到成功。”",
                                                "diangu": "形容工作刚开始就取得成功。",
                                                "pinyin": "mǎ dào chéng gōng",
                                                "chengyu": "马到成功"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "成语典故查询",
                "tags": [
                    "成语典故"
                ],
                "description": "返回成语对应典故来源支持关键词搜索",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "string",
                                        "example": 1,
                                        "description": "返回数量，1-50"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "example": 1,
                                        "description": "0严格搜索、1模糊搜索、2拼音简写搜索"
                                    },
                                    "page": {
                                        "type": "string",
                                        "example": 1,
                                        "description": "翻页"
                                    },
                                    "word": {
                                        "type": "string",
                                        "example": "马到成功",
                                        "description": "搜索词"
                                    }
                                },
                                "required": [
                                    "key",
                                    "word"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "fanli": {
                                            "type": "string",
                                            "example": "只要不轻敌，相信你们一定会～。",
                                            "description": "范例"
                                        },
                                        "chuchu": {
                                            "type": "string",
                                            "example": "元·无名氏《小尉迟》第二折：“那老尉迟这一去，马到成功。”",
                                            "description": "出处"
                                        },
                                        "diangu": {
                                            "type": "string",
                                            "example": "形容工作刚开始就取得成功。",
                                            "description": "典故"
                                        },
                                        "pinyin": {
                                            "type": "string",
                                            "example": "mǎ dào chéng gōng",
                                            "description": "拼音音标"
                                        },
                                        "chengyu": {
                                            "type": "string",
                                            "example": "马到成功",
                                            "description": "成语"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "pysx": "mdcg",
                                                "fanli": "只要不轻敌，相信你们一定会～。",
                                                "chuchu": "元·无名氏《小尉迟》第二折：“那老尉迟这一去，马到成功。”",
                                                "diangu": "形容工作刚开始就取得成功。",
                                                "pinyin": "mǎ dào chéng gōng",
                                                "chengyu": "马到成功"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}