我无法在我的Spring应用程序中使用SWAGGER-UI。
执行器(/actuator)和docs ('/v2/api-docs')工作正常。
但是在swagger url /swagger-ui.html中,我得到了错误,将Method Not Allowed和错误代码称为405
昂格格康菲
@Configuration
@EnableSwagger2
public class Config {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2
我只需添加此SwaggerConfig文件并添加以下依赖项即可在我的SpringBoot应用程序中设置Swagger 2:
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
.paths(Predicates.n
在swagger-ui中,我想将授权令牌添加到请求头。
我几乎看了这里和其他网站上的每一篇文章。仍然不能让它像预期的那样工作。我尝试了不同的解决方案,但什么都没有改变。
我目前根据的实现
XController.java:
@ApiOperation(
value = "Yeni Üye Tanımlama Servisi",
notes = "Platformlar tarafından iletilen üye bilgilerinin kaydedilmesini sağlayan servistir.",
我有一个springboot helloword项目,它的结构是
我的swaggerConfig是
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
//.enable(false)