swagger 集合 list 参数

时间:2025-03-20 08:13:27

swagger 集合 list 参数 ,怎么测试?

添加 @ApiImplicitParam 注解中的

allowMultiple = true 属性

这样就可以测试 list 参数了

@ApiImplicitParam(name = "ids", value = "id集合",  allowMultiple = true, dataType = "Long", paramType = "query")
public void test(List<Long> ids){

	(id -> ("id :" + id));
}

如果接受的参数是对象, 还是建议Json格式字符串 后台解析成对象比较好...