Documenting contracts
Unlike soap style messages where the Web Services Description Language (WSDL) defines a robust contract between the consumer and service provider as an XML document, there was no such metadata exchanged when consuming a REST service until WSDL 2.0 was released.
Textual documentation still seems to be popular with developers to describe the available methods and entities. There is a NuGet package available for MS Visual Studio, which automatically generates help page content for Web API projects. It can be installed using the Package Manager Console using the following command: PM> Install-Package Microsoft.AspNet.WebApi.HelpPage
.
Swagger, which is an open source product is also very popular among developers for generating interactive documentation and client SDK generation and discoverability. More information can be found at http://swagger.io/. Swagger appears to be Microsoft's tool of choice for API documentation as it has been adopted in many products in the Azure suite.
Another tool is RESTful API Modeling Language (RAML), which provides a contract first approach of modeling web APIs. This uses a derivative of YAML (YAML ain't markup language) and JSON to create a human- and machine-readable document. More information can be found at http://raml.org/index.html.
To help the consumers of the service, the messages should be self-descriptive, and you should be able to understand the requests and responses after spending minimal time using the service and reading the documentation. In the end, the URL structure has a large part to play in the overall usability of the service.
- Django+Vue.js商城項目實戰
- 前端跨界開發指南:JavaScript工具庫原理解析與實戰
- Arduino開發實戰指南:LabVIEW卷
- 秒懂設計模式
- Getting Started with Python Data Analysis
- 正則表達式經典實例(第2版)
- 單片機應用與調試項目教程(C語言版)
- 大數據分析與應用實戰:統計機器學習之數據導向編程
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Advanced UFT 12 for Test Engineers Cookbook
- 零基礎學HTML+CSS
- C語言程序設計實踐
- 視窗軟件設計和開發自動化:可視化D++語言
- Java核心編程
- Beginning C# 7 Hands-On:The Core Language