The OpenAPI format
OAS is very rich and extensive. Still, I want to explain some commonly used parts to give extra context to the examples we will see later in this chapter.
First of all, we already saw in our first example two essential sections. Firstly, there is openapi, which defines the version of the format; for example, 3.0.0. Following that is the info section, which gives us general information about the API, such as the name of the API, the version, or what the API is for.
Next, we can talk about what I think is the most crucial section of the whole OpenAPI document: the paths section. This section allows us to define every endpoint in our system, defining the URL path, and, under that, all possible cases, the different methods that the URL accepts, what parameters with what responses, and so on. Of course, it also explains what the API endpoints do. We will see more examples later in the chapter, but let’s discuss reusability.
One problem you will find...