Summary
In this chapter, we explored how to document APIs using OAS. We saw how, using OpenAPI, we can provide accurate and extensive documentation of our REST API, making it easier to understand, test, and consume. We looked at the structure of OpenAPI documents and the different building blocks that compose them, such as components, paths, and general API information.
We also explored some tools in the ecosystem that allow us to build our OpenAPI document from the code or our code from the OpenAPI document, including the server and client sides.
Finally, we explored how to add OpenAPI documentation to our shopping list API by annotating our existing Go code and using the swaggo tool.
Good documentation is a critical part of a successful REST API. OpenAPI is the industry standard for that, so we have an excellent new tool to include in our REST API development process.
Now that we have helped API users by providing detailed documentation, let’s jump into our...