springboot集成swgger2错误解决(No enum constant org.springframework.web.bind.annotation.RequestMethod.GET,POST)

出现这个问题的原因,是因为swgger2中没有对应的枚举类导致的;
RequestMethod.GET,POST 后面跟的是什么,那么就是由于什么原因导致的
get:表示有 @ApiOperation(value = "xxx", httpMethod = "get")
post:表示有 @ApiOperation(value = "xxx", httpMethod = "post")

处理办法:改成这些就好了
例如::@ApiOperation(value = "xxx", httpMethod = "POST")

public enum RequestMethod {
    GET,
    HEAD,
    POST,
    PUT,
    PATCH,
    DELETE,
    OPTIONS,
    TRACE;
    private RequestMethod() {
    }
}
posted @ 2021-06-18 18:45  左瑾  阅读(1182)  评论(0)    收藏  举报