OpenAPI 3.0 is the next evolution of the Swagger specification. The OpenAPI 3.0 is also used to define a set of files required to describe and document of Rest API. This tutorial will show you how to export OpenAPI 3.0 file which API that you want to generate.
First, you need to do some prerequisite steps before you can use the function “Generate Metadata“:
- Create Integration
- Create Inbound/Outbound Interface
- Create MetaData
- Create Repository
- IStructure/Message type add into the interface
How to get message type in OpenAPI 3.0 File Format?
The OpenAPI 3.0 be generated at three places e.g. in the generic page (the custom link of Integration), the interface details page, and the messsage type of the Repository page.
We pick up one for sample using the inbound interface and having Message Type. Before getting the message type, we need to have a MetaData provider, a Repository.
Here is the Message Type sample:
Inbound interface using with Message Type
Checking structure message type in mapping tool at the left side because we are using an inbound interface.
How to generate OpenAPI 3.0 from the Generic Page?
Now you are able to generate MetaData. we will show you how to generate metadata on the generic page (the customs link of Integration Details). Please enter the integration details page and you will able to see the “Generate MetaData“ in the Custom Links section. Please click the Generate MetaData link:
Generate metadata in the new way of OpenAPI 3.0. Please choose the interface name on “Create WSDL For Interface”, Choose OpenAPI 3.0 file format in “Chose a format file”, uncheck the checkbox “As old way?”, Chose an api name, chose an operation, and click the “Export” button.
You will get an OpenAPI 3.0 file format under the “Outbound Interfaces (Related List)” section. You can download it by clicking the link “View”. You will able to see the file after download in the download folder or download bar chrome browser.
How to generate OpenAPI 3.0 from Interface Details Page?
This is the second way to generate OpenAPI 3.0 format, you can go to Interface Details Page that you want to generate. You will see the “Generate MetaData” button on the header section page. Please click this button to see the pop-up screen.
Please choose Swagger 2.0/OpenAPI 2.0 in the “Chose a format file” picklist and click the “Export” button.
You will get OpenAPI 3.0 file in the download bar section or you can check on download folder on your local pc.
Here is the result of generating meta from the generic page and interface details page. It will generate the Request message type includes the message Type name and its fields that you have link the message type with this interface.
How to generate OpenAPI 3.0 from Message Type of Repository?
This is the third way to generate OpenAPI 3.0 format from the message type. Please enter the message type section in the repository. Then you will see the “Generate MetaData” Action button in the message type section.
Here is the Rest message type template:
We will show you to export the “Rest Service” message type. Please click the Export MetaData button.
It will pop-up to export metadata, then please choose the OpenAPI 3.0 file format, Chose an API name, and Chose an operation.
You will get the file in the download bar section or you can check on the download folder on your local pc.
Here is the OpenAPI 3.0 file format after generating from message type of Repository.
Finally, you have learned how to generate metadata with OpenAPI 3.0 file format was in the generic page, Interface details page, and message type.