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.
- 一步一步學(xué)Spring Boot 2:微服務(wù)項(xiàng)目實(shí)戰(zhàn)
- Building Modern Web Applications Using Angular
- ArcGIS By Example
- C語(yǔ)言課程設(shè)計(jì)
- 深入分布式緩存:從原理到實(shí)踐
- 單片機(jī)原理及應(yīng)用技術(shù)
- 從零學(xué)Java設(shè)計(jì)模式
- JavaScript悟道
- Mastering Embedded Linux Programming
- Implementing Microsoft Dynamics NAV(Third Edition)
- 大規(guī)模語(yǔ)言模型開(kāi)發(fā)基礎(chǔ)與實(shí)踐
- Android高級(jí)開(kāi)發(fā)實(shí)戰(zhàn):UI、NDK與安全
- 和孩子一起學(xué)編程:用Scratch玩Minecraft我的世界
- Getting Started with the Lazarus IDE
- 虛擬現(xiàn)實(shí):引領(lǐng)未來(lái)的人機(jī)交互革命