showdoc icon indicating copy to clipboard operation
showdoc copied to clipboard

脚本自动生成文档请求体示例json_param能否可以支持自动格式化展示

Open stolenzc opened this issue 3 months ago • 2 comments

我看到在 #545 中添加了json_param来添加请求json的示例,但是我发现响应示例是可以自动格式化的,非常美观,但是请求示例没能自动格式化,始终按照一行进行显示,不知道是我的书写有问题还是还未支持,如果未支持的话能否考虑对此支持下呢。附上我的注释

    /**
    * showdoc
    * @catalog 健康检查
    * @title 健康检查
    * @description 提供健康检查
    * @method POST
    * @url http://api.example.com/healthz
    * @param check_type 必选 string 检查类型
    * @param check_value 可选 string 检查值
    * @param remark 可选 string 备注
    * @json_param {"check_type": "string", "check_value": "string", "remark": "string"}
    * @return {"status":1, "msg": "success", "data": {"check_type": "string", "check_value": "string", "remark": "string"}}
    * @return_param status int 状态码,1为成功,0为失败
    * @return_param msg string 提示信息
    * @return_param data json 返回数据
    * @return_param check_type string 检查类型
    * @return_param check_value string 检查值
    * @return_param remark string 备注
    */

当前效果:

Image

预期效果:

Image

stolenzc avatar Sep 24 '25 03:09 stolenzc

晚点支持下

star7th avatar Sep 25 '25 00:09 star7th

经过实测,使用你发出来的示例是可以自动格式化展示的。不知道你是否在使用旧版本。

Image

star7th avatar Oct 13 '25 01:10 star7th