首页 > 解决方案 > Swagger @ApiParam 中的示例属性不起作用

问题描述

我有这段代码:

   @ApiOperation(value = "Delete a Registration Form by id")
    public void deleteRegistrationForm(
        @ApiParam(name = "Repository Name", type = "String", value = "The Repository Name", example = "TestRepo") @PathVariable("repositoryName") String repositoryName,
        @ApiParam(name = "Object Id", type = "String", value = "r_object_id of the registration form", example = "090bc7b480735775") @PathVariable("documentId") String id)

我期待示例属性中指定的字符串“TestRepo”会在 Swagger UI 的输入中显示为占位符。

但是,这就是我得到的: Swagger UI 输出

我用谷歌搜索了这个,但我找不到任何帮助。

标签: springswaggerswagger-uiopenapi

解决方案


推荐阅读