If you start the server, accessing the /api-docs route will provide access to the main Swagger screen, as follows:
Interaction is easy: select an area, click on a given request, and you'll get the list of all routes and operations. Let's see, for example, how to get the regions for Uruguay. First, we must get a token, so we want to open the token area and enter the necessary user and password, as shown in the following screenshot:
When the process runs, you'll get the answer, as shown in the following screenshot:
You can see the equivalent curl request at the top, which matches what we did earlier in this chapter, in the Testing simple services from the command line section. Now, copying that token and pasting it into the /regions/uy endpoint means that we're ready to do that query:
All that's left to do is execute that query, and we'll get the desired results, as shown in the following screenshot:
What can we point out? First, obviously, Swagger is a very good tool, in terms of documentation. You can add descriptions to methods, parameters, results, and even include sample values and results. This means that developers who need to use your API will have a very good way of learning about how to use it. In terms of actually using your API, Swagger is simpler than curl or Postman, but it cannot chain operations, which you'll have to do on your own. You should really think about starting your development with this tool, and only moving forward with actual coding once you have everything documented; give it a try!