Generating Source Code from OpenAPI Documents
The OpenAPI parsing feature generates source code based on an OpenAPI Document. This process involves parsing the OpenAPI document, selecting desired paths and functions and obtaining a skeletal structure of the code in EGL.
Execute the following steps to generate source code:
- Get the OpenAPI Documentation for a specific endpoint you want to implement in your EGL application. This documentation should describe the functionality, data, and responses used in that endpoint.
- Select the type of implementation required for the application.
- Choose the package, the file name and the required function definitions to generate for your
application through the wizard.
Note:These functions will be extracted from the OpenAPI Document in input.
- Run the generation process and generate the output code into the desired file.
- Edit and implement the output code with the required logic.
Note:
- You may iterate through this cycle several times to generate different parts of the OpenAPI Document or by parsing multiple OpenAPI documents.
- For example, you could generate the functions for a specific path of an OpenAPI document as a Service and then generate the remaining paths as interfaces in a new file.