swagger报No operations defined in spec!
突然发现项目的swagger报No operations defined in spec!
SWAGGER_SCAN_BASE_PACKAGE 路径改变了!
package com.redis.configuration;
import java.sql.Date;
import java.time.LocalDate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
public static final String SWAGGER_SCAN_BASE_PACKAGE = "com.redis";
public static final String VERSION = "1.0.0";
@Value("${swagger.enable}")
private boolean enableSwagger;
ApiInfo apiInfo() {
return new ApiInfoBuilder().title("Swagger API").description("This is to show api description")
.license("Apache 2.0").licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("").version(VERSION).contact(new Contact("", "", "miaorf@outlook.com")).build();
}
@Bean
public Docket customImplementation() {
return new Docket(DocumentationType.SWAGGER_2).select()
.apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)).build()
.enable(enableSwagger)
.directModelSubstitute(LocalDate.class, java.sql.Date.class)
.directModelSubstitute(Date.class, java.util.Date.class).apiInfo(apiInfo());
}
}
swagger报No operations defined in spec!的更多相关文章
- 由ASP.NET Core WebApi添加Swagger报错引发的探究
缘起 在使用ASP.NET Core进行WebApi项目开发的时候,相信很多人都会使用Swagger作为接口文档呈现工具.相信大家也用过或者了解过Swagger,这里咱们就不过多的介绍了.本篇文章记录 ...
- Swagger 报错 no mapping found for http request with uri [/***/swagger-ui.html] in dispatcherservlet with name '***'
swagger报错: no mapping found for http request with uri [/***/swagger-ui.html] in dispatcherservlet wi ...
- selenium+python自动化96-执行jquery报:$ is not defined
前言 背景介绍:做wap页面自动化的时候,把url地址直接输入到浏览器(chrome浏览器有手机wap模式)上测试,有个按钮死活点不到,用wap模式的触摸事件也无法解决,后来想用jquery去执行点击 ...
- Mvc Swagger报错的解决办法。
报错信息:Not supported by Swagger 2.0: Multiple operations with path ‘xxxx.aspx’ and method 'POST' 解决办法出 ...
- swagger报错No handler found for GET /swagger-ui.html
今天下载jeeweb框架下来研究,其他还有,就是swagger老是出不来.报错:No handler found for GET /swagger-ui.html 后来搜索才发现,这个错误,是因为资源 ...
- swagger 报错:illegal defaultValue null for param type integer
swagger(版本2.9.2) 刷新报错,错误信息如下图: 问题原因: 根据上面这句报错信息,点进去AbstractSerializableParameter.java:412可以看到 源码, @J ...
- SpringBoot项目集成swagger报NumberFormatException: For input string: ""
java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.f ...
- Spring Boot整合Swagger报错:"this.condition" is null
前段时间看到群里有吐槽swagger整合问题,当时没仔细看,总以为是姿势不对. 这两天正好自己升级Spring Boot版本,然后突然出现了这样的一个错误: Caused by: java.lang. ...
- Vue运行报错--not defined
按F12键进入调试模式,谷歌总是提示Uncaught ReferenceError: ——is not defined这个错误. 原来是因为虽然是传递的值,但是在函数传参的时候也要加引号,加上引号后就 ...
随机推荐
- 在crontab中执行shell脚本的问题
crontab中记录的编写比较简单,下面是一个示例: * * * /app/tpssapp/ftpsrc/tools/statTables/statTables.sh > /app/tpssap ...
- (function($){...})(jQuery)与$(function(){...})区别
$(function(){...}) 这种写法和jQuery(function(){...}),$(document).ready(function(){...})作用一样,表示文档载入后需要运行的代 ...
- 如何通过eclipse查看、阅读hadoop2.4源码
问题导读:1.官网src包下载包,能否直接使用?2.如何跟踪和查看hadoop源码? 此篇是从零教你如何获取hadoop2.4源码并使用eclipse关联hadoop2.4源码基础上的一个继续,上文其 ...
- 呵呵sql
INSERT INTO fnd_document_folder_structure_t (folder_name,parent_folder_id,company_type_id,inv_flag, ...
- iis 部署 未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序
C#读取Access数据库在VS调试时正常,发布到win7-64的IIS之后报错“未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序”.原因是VS调试时模拟的是32位,发布 ...
- 洛谷 P1098 字符串的展开
题目描述 在初赛普及组的“阅读程序写结果”的问题中,我们曾给出一个字符串展开的例子:如果在输入的字符串中,含有类似于“d-h”或者“4-8”的字串,我们就把它当作一种简写,输出时,用连续递增的字母或数 ...
- webpack 图片资源处理
备注: css 引用图片资源 1. 安装loader yarn add file-loader --dev 2. 配置 const path = require("path"); ...
- minio 介绍
minio 兼容Amason的S3分布式对象存储项目,采用Golang实现,客户端支持Java,Python,Javacript, Golang语言. Minio可以做为云存储的解决方案用来保存海 ...
- 【转】VC 多线程中控制界面控件的几种方法
原文网址:https://software.intel.com/zh-cn/blogs/2010/11/30/vc-3 为了保证界面的用户体验经常要把数据处理等放到子线程中进行,然后把结果更新到主界面 ...
- hadoop深入学习之SequenceFile
的1个byte 3.Key和Value的类名 4.压缩相关的信息 5.其他用户定义的元数据 6.同步标记,sync marker Metadata 在文件创建时就写好了,所以也是不能更改的.条记录存储 ...