spring介面文檔註解:@ApiOperation

來源:互聯網
上載者:User

標籤:title   添加   api文檔   spingmvc   好用   swagger   api   關注   size   

spring介面文檔註解:@ApiOperation

@ApiOperation不是spring內建的註解是swagger裡的 
com.wordnik.swagger.annotations.ApiOperation;

@ApiOperation和@ApiParam為添加的API相關註解,個參數說明如下: 
@ApiOperation(value = “介面說明”, httpMethod = “介面請求方式”, response = “介面返回參數類型”, notes = “介面發布說明”;其他參數可參考源碼; 
@ApiParam(required = “是否必須參數”, name = “參數名稱”, value = “參數具體描述”

實際項目中非常需要寫文檔,提高Java服務端和Web前端以及移動端的對接效率。

Swagger是當前最好用的Restful API文檔產生的開源項目,通過swagger-spring項目

實現了與SpingMVC架構的無縫整合功能,方便產生spring restful風格的介面文檔,

同時swagger-ui還可以測試spring restful風格的介面功能。

spring介面文檔註解:@ApiOperation(轉)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.