Adapter auto-generation

Overview

PMF adapters are used to perform any necessary server-side logic, and to transfer and retrieve information from back-end systems to client applications and cloud services.

Generate an adapter from its OpenAPI specification

Auto-generation of an adapter from its OpenAPI specification (Swagger Specification) helps in expediting application development. PMF user can now focus on the application logic instead of creating the PMF adapter, which connects the application to the desired back-end service.

Note: This feature is available only in DevKit.

To use this feature, the OpenAPI specification (.json or .yaml) for the microservice (or the desired back-end service) should be available. The adapter generation feature is made available by an extension adapter called Microservice Connector, also referred to as Microservice Adapter Generator, which is available for download from the Download Center on PMF Console.

Note: As a prerequisite, configure the JAVA_HOME variable to point to the installed JDK folder.

Image of Adapter generator in Download Center

Download the Microservice Adapter Generator adapter and deploy it to PMF server. The deployed adapter will now be listed under Extensions, in the navigation pane.

Image of Adapter generator in navigation pane

Clicking the Microservice Adapter Generator will launch the page, where the user can provide the OpenAPI Specification (.json or .yaml) file and can choose to generate the adapter from the provided OpenAPI specification.

Image of Adapter generator page

After the adapter is generated it will be automatically downloaded to the browser. The user is then required to deploy the generated adapter, for use in their apps. Selecting the option Include adapter source will download the adapter source code and generated adapter as a zip file. User can modify the generated adapter source code, rebuild and deploy the adapter.

The adapter generator depends on the accuracy of the OpenAPI specification JSON. If the specification is incomplete or incorrect, the generation may fail or may result in the generation of adapter APIs that do not match the APIs of the back-end microservices.

Last modified on