Use API Discovery Service

You can specify a URL pointing to a Swagger 2.0 or OpenAPI 3.0 definition. This feature enables synchronization with the specified definition.

api designer api sync

Prerequisites

  • You have a JSON file that serves as an API specification in the Swagger format.

  • In the Security tab of the System Settings tool, the Proxy whitelist field is clear, or you have included the URI of the API to the proxy whitelist.

Procedure

In this example, we will use the https://petstore.swagger.io/v2/swagger.json which is a sample pet store server.

  1. In the Cockpit, select the API Designer.

    Result: A table of existing API definitions is shown.

  2. Select Create.

    Result: The Create API dialog opens.

  3. In Type, select External.

  4. In API Format, ensure that you set the API format in accordance with the format supported by your API server.

  5. In Name, enter a meaningful name for the API.

  6. In Endpoint, add the URI for the endpoint. In this example, it is https://petstore.swagger.io.

  7. In Package, assign the API definition to a development package.

  8. Select Create.

  9. In the API Discovery Service section, in API URI enter the URI of the API, in this example https://petstore.swagger.io/v2/swagger.json.

    Result: The Api Synchronization dialog opens. presenting all the new operations along with their respective details. By selecting a specific operation, you can view and compare all the details, effectively highlighting the changes between the old and new definitions.

  10. To incorporate the new definition from the dialog, select Synchronize.

api designer api sync diff

Result

api designer api sync result