Tutorials

  1. Home
  2. Dokumente
  3. Tutorials
  4. 47. How to export the Metadata in different format as xsd, XSD (Response for V3 Inbound), json schema, WSDL 1.1, swagger 2.0/OpenAPI 2.0 and openApi 3?
  5. 47.5 How to export Swagger 2.0/OpenAPI 2.0?

47.5 How to export Swagger 2.0/OpenAPI 2.0?

Introduction

The Swagger 2.0/OpenAPI 2.0 is used to define a set of files required to describe and document of Rest API. This tutorial will show you how to export Swagger 2.0/OpenAPI 2.0 file which API that you want to generate.

Note
+ In tool Generate Swagger 2.0/OpenAPI 2.0 we need to know about this following:

  • The interface could be Request, Response.
  • The Request/outbound interface will get the IStructure/MessageTye based on the interface and get extra fields as the SKYVVA__MessageId field. The SKYVVA__MessageId field will generate for all levels of messageType.
  • The Response/inbound interface will get the IStructure/MessageTye based on the interface and get extra fields such as SKYVVA__MessageId, SKYVVA__MESSAGE, and SKYVVA__Response_Code field. The SKYVVA fields generate only the parent level with messageType.
  • When the interface doesn’t link with Request Interface, it will automatically generate as Request. If the interface link with Request Interface, it will generate as Response.
  • The SKYVVA fields will not generate from Interface ISturcture that uploads from the file.
  • The old ways check box will generate old or new ways of file format.
  • It will export the normal message type and Rest template in the generic page and interface page, but the message type of repository will generate only the Rest template.
  • If you generate metadata from the message type section of the repository, it will not get SKYVVA fields.

Pre-Require

First, you need to do some prerequisite steps before you can use the function “Generate Metadata“:

  1. Create Integration
  2. Create Inbound/Outbound Interface
  3. Create MetaData
  4. Create Repository
  5. IStructure/Message type add into the interface

How to get message type in Swagger 2.0/OpenAPI 2.0 File Format?

The Swagger 2.0/OpenAPI 2.0 can be generated at three places e.g. in the generic page (the custom link of Integration), the interface details page, and the message type of 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 Swagger 2.0/OpenAPI 2.0 from 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 Swagger 2.0/OpenAPI 2.0. Please choose the interface name on “Create WSDL For Interface”, Choose Swagger 2.0/OpenAPI 2.0 file format in “Chose a format file”, uncheck the checkbox “As old ways?”, Chose an api name, chose an operation, and click the “Export” button.

Note
If your interface link to message type as Rest template, so Combobox ‘Chose a format file’ will display ‘Swagger 2.0/OpenAPI 2.0 and OpenAPI 3.0’ option.

You will get a Swagger 2.0/OpenAPI 2.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 Swagger 2.0/OpenAPI 2.0 from Interface Details Page?

This is the second way to generate Swagger 2.0/OpenAPI 2.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.

Note
it generate automatically as new way while you generate in interface details page.

Please choose Swagger 2.0/OpenAPI 2.0 in the “Chose a format file” picklist and click the “Export” button.

Note
If your interface link to message type as Rest template, so Combobox ‘Chose a format file’ will display only ‘Swagger 2.0/OpenAPI 2.0’ option.

You will get the Swagger 2.0/OpenAPI 2.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 Swagger 2.0/OpenAPI 2.0 from Message Type of Repository?

This is the third way to generate Swagger 2.0/OpenAPI 2.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.

Note
if you want to generate the Swagger 2.0/OpenAPI 2.0 file format on the message type, your message type has to Rest template. For example, you can generate Rest Service only. It has two-part in Rest template such as Request, Response Message type depend on your business message type.

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 Swagger 2.0/OpenAPI 2.0 file format.

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 Swagger 2.0/OpenAPI 2.0 file format after generating from Repository.

Summary

Finally, you have learned how to generate metadata with a Swagger 2.0/OpenAPI 2.0 file format was in the generic page, Interface details page, and message type.

 

Fandest du diesen Artikel hilfreich? Ja Nein

Wie können wir helfen?