lurenjia1993 2019-12-30 11:35 采纳率: 42.9%
浏览 3562
已采纳

spring boot swagger2怎么进行map传参


io.springfox
springfox-swagger2
2.8.0


io.springfox
springfox-swagger-ui
2.8.0

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-spring-web</artifactId>
        <version>2.8.0</version>
    </dependency>

    依赖版本号

    这个版本不知支持Example用法,请问有什么解决的方式吗

    @ApiOperation(value = "not use")
@ApiImplicitParam(name = "params" , paramType = "body",examples = @Example({
    @ExampleProperty(value = "{'user':'id'}", mediaType = "application/json")
}))
@PostMapping("/xxx")
public void test(Map<String,String> params){}

    效果是
    ![图片说明](https://img-ask.csdn.net/upload/201912/30/1577676901_979644.png)
  • 写回答

2条回答 默认 最新

  • 「已注销」 2019-12-30 14:27
    关注

    有一个博主写过你看看能不能解决你的问题 https://blog.csdn.net/hellopeng1/article/details/82227942

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?