我有一个 Spring Boot 项目,它具有 Springfox 的下一个依赖项:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
我有我的界面:
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
@RestController
@RequestMapping(value = "/cache")
@ApiIgnore
@Api(hidden = true)
public interface CacheController {
@RequestMapping(
value = "clear/",
method = RequestMethod.GET,
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE}
)
@ApiOperation(value = "", hidden = true)
ResponseEntity<String> clearToken();
}
注释@ApiIgnore和@Api(hidden = true)(我已经单独测试过它们,它们也不起作用。)对隐藏文档没有影响。它仅在注释超过方法时才有效,但我想将它们全部隐藏,因为我还有其他要隐藏的端点。
一些想法?
ABOUTYOU
慕尼黑5688855
30秒到达战场
青春有我
慕码人2483693
相关分类