zoukankan      html  css  js  c++  java
  • Springboot项目启动出现Coercing to be of type string.

    Springboot项目启动的时候莫名其妙的出现了一堆下面的警告

    Coercing to be of type string. This may not even be a scalar type in actuality

    实际上这是Springboot集成Swagger后,在标注Controller中接口时类型定义与Swagger规则不一致的原因。

    如下面代码中,字段Java类型是String,但Swagger中没有这个类型,那就会出现警告。String 改成 string 就没问题了

    @ApiImplicitParam(name = "strName", value = "名称", dataType = "String")

    Swagger中数据类型有 int, date, string, double, float, boolean, byte, object, long, date-time

    所以需要对照着填写 ApiImplicitParam

  • 相关阅读:
    day11
    day10
    day9
    day8
    day7
    day6
    day14
    day13
    day12
    day11
  • 原文地址:https://www.cnblogs.com/TiestoRay/p/13031938.html
Copyright © 2011-2022 走看看