【发布时间】:2017-02-17 09:29:23
【问题描述】:
我正在使用 Spring Boot 和 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 页面中的名称和描述,具体而言,这些名称在屏幕截图中以红色突出显示,但没有任何效果。
我一直在尝试将 @Api 注释添加到我的实体和存储库类/接口中,但没有任何效果。
知道如何自定义它吗?
谢谢!
【问题讨论】:
-
你能添加一个你尝试过的例子吗?
-
在我的实体对象中,我尝试了下一个注释:
@Entity @Api(value="activity Name", description="activity Description") public class Activity但它没有用。我在 Respository Rest 接口中做了同样的事情,但效果不佳。
标签: spring spring-data swagger swagger-ui springfox