Unable to interpret the implicit parameter configuration with dataType: XXX, dataTypeClass: class XX

报错如下:

2020-11-04 10:11:41.689  WARN 11716 --- [           main] d.s.r.o.OperationImplicitParameterReader : Unable to interpret the implicit parameter configuration with dataType: String, dataTypeClass: class java.lang.Void
2020-11-04 10:11:41.726  WARN 11716 --- [           main] d.s.r.o.OperationImplicitParameterReader : Unable to interpret the implicit parameter configuration with dataType: Integer, dataTypeClass: class java.lang.Void
2020-11-04 10:11:41.733  WARN 11716 --- [           main] d.s.r.o.OperationImplicitParameterReader : Unable to interpret the implicit parameter configuration with dataType: Long, dataTypeClass: class java.lang.Void

解决方法

一、降低swagger版本

在pom.xml 文件中,swagger版本为最新的3.0.0,如下:

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

将版本号改为3.0.0更低的版本如下:

<dependency>
	<groupId>io.springfox</groupId>
	<artifactId>springfox-swagger2</artifactId>
	<version>2.8.0</version>
</dependency>
<dependency>
	<groupId>io.springfox</groupId>
	<artifactId>springfox-swagger-ui</artifactId>
	<version>2.8.0</version>
</dependency>
二、加入dataTypeClass = XXX.class

解释参考:https://github.com/springfox/springfox/issues/3520
@ApiImplicitParam(name = “id”, value = “主键ID”, required = true, dataType = “Long”, paramType = “path”) 加上 dataTypeClass = Long.class,如下:

@PostMapping( "/del" )
@ApiOperation(value = "删除")
@ApiImplicitParam(
	name = "id", value = "主键ID", 
	required = true, dataType = "Long",
	dataTypeClass = Long.class, paramType = "path"
)
public void del(@RequestParam Long id) {
 	......
   return;
}
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值