首页 文章

在Swagger-ui中更改名称和描述 endpoints

提问于
浏览
1

我使用Spring启动和Spring Data Rest来实现我的Rest API . 为了记录它,我一直在使用Swagger,以及这些maven依赖项:

<dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.6.1</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.6.1</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-data-rest</artifactId>
        <version>2.6.1</version>
    </dependency>

我想更改和自定义我的Swagger UI页面 . 我想更改它出现在html页面中的名称和描述,具体来说这些名称在屏幕截图中以红色突出显示,但没有任何效果 .

enter image description here

我一直在尝试将 @Api 注释添加到我的实体和存储库类/接口,但没有任何作用 .

有关如何定制它的任何想法?

谢谢!

1 回答

  • 1

    @Api 注释与标签和说明一起使用 .

    @Api(description="Device APIs", tags = "Device")
    

    请注意, description 已弃用,但可以使用 .

相关问题