Swagger使用指南 - 不能传递参数

参考:https://my.oschina.net/dlam/blog/808315

报下面的错误是

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalStateException: 
Optional int parameter 'classifyVersionCode' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.<div class="line">div>

type Exception report

message Request processing failed; nested exception is java.lang.IllegalStateException:

修改paramType=”query”,或者为header

@ApiImplicitParams({
        @ApiImplicitParam(paramType="query", name = "loginname", value = "手机号码", required = true, dataType = "String"),
        @ApiImplicitParam(paramType = "query", name = "password", value = "密码", required = true, dataType = "String"),
        @ApiImplicitParam(paramType = "query", name = "classifyVersionCode", value = "客户端分类版本号", required = true, dataType = "Integer"),
        @ApiImplicitParam(paramType = "query", name = "appVersionCode", value = "客户端apk版本号", required = true, dataType = "Integer"),
        @ApiImplicitParam(paramType = "query", name = "userType", value = "客户端类型", required = true, dataType = "Integer")
    })

你可能感兴趣的:(Swagger2,java,IDEA)