With server code generation, you can generate server-side boilerplate code from your OpenAPI 3.0 specification. This enables you to run a server based on your API specification and use it as a starting point for developing your business logic.
Supported languages and frameworks include:
To generate server-side boilerplate from your OpenAPI 3.0 definition, do the following:
The generated code is automatically downloaded as a ZIP archive. The file name includes the name of the API and the language and framework selected.
The generated code structure depends on the language you select. Each of the supported languages covers some of the major features from your OpenAPI 3.0 specification. Here are some features that you can expect from the generated code:
README.md
file describing prerequisites and instructions to start the server.Along with code generated for configuring the routes and stubs for the implementation of each endpoint, the generated code also includes other files like README.md
, a list of dependencies, server setup code, and other items required by the selected framework. These files are often edited and customized after code generation.
You can select the Only generate routes and interfaces option when generating code. This will generate code relevant to the paths and components in the OpenAPI schema and leave out other files. This enables you to update files relevant to new or changed endpoints, and avoid overwriting your customized files with generated boilerplate code.
Last modified: 2024/05/10
Additional resources
Videos
Blog posts