Using code-generation tools
In this section, we will deal with the practicalities of generating client and server code from an OAS definition using the two most popular tools currently in use:
- Swagger Codegen (https://swagger.io/tools/swagger-codegen/)
- OpenAPI Generator (https://swagger.io/tools/swagger-codegen/)
Swagger Codegen
Swagger Codegen (https://swagger.io/tools/swagger-codegen/) is part of the SmartBear API design and test tool suite. The product can be used within the SwaggerHub web portal or as a standalone command-line tool. The SwaggerHub portal offers a limited-time free trial, after which you can upgrade to various paid plans, but the command-line tool is made available free of charge.
Firstly, let us examine the capabilities of the SwaggerHub portal. Figure 10.2 shows a small OAS definition loaded into the editor window:
Figure 10.2 – Swagger Codegen user interface
The following areas are available to the...