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() {
    }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM