Documenting an API
One of the worst parts about learning a new programming language or using a new piece of software that needs a bunch of configuration to get it to work with your current setup is the documentation. Some of these things have only a frequently asked questions section but nothing by way of troubleshooting. There are many things you should document about your software in order for people to feel comfortable using it.
Reference documentation is there to describe the interface contract of the API. Its purpose is to describe the inputs and outputs of both success and errors as well as the goals that are available to the user. The reference documentation is like the parts list of furniture you have to assemble, knowing the parts is handy, but can be useless without instructions. The most important part about the reference documentation is that is done in plain human English so it can be read easily.
Get Ace D Baugh’s stories in your inbox
Join Medium for free to get updates from this writer.
Part of the reference documentation is describing the goals of the software. This is where you document the operation and what is expected to happen, the inputs, the outputs, the things that happen if successful, and the things that happen if an error occurs.
No reference documentation is complete without mentioning security. Documenting what is used for security and how the security protects data and users helps give comfort in using your API as well as shows transparency. OpenAPI specification will automatically show authorization if security is defined as a goal in the documentation.
In my opinion, the most important is the use cases section of any reference documentation. This is like the instruction of how to assemble the furniture, to use the previous example. Use cases are best when you use the goals documentation and images are provided. Like the furniture, describing things is great, but diagrams help tremendously.
References
Lauret, A. (2019). The design of web apis. Manning Publications Co.



