Skip to content

Generate client libraries

The OpenAPI Specification defines a standard interface to describe an API, regardless of the language it was written in. This specification can then be used to automatically create documentation(swagger), or to automatically generate clients for your services.

Modern application landscapes often comprise many independent services. Each of these services have one or more responsibilities, and have an interface to expose functionality to the outside world. In the case of RESTful services, this functionality is exposed over HTTP.

If developer needs to generate Stubs to REST API for the integration then they can use below method .

Let's take a sample API as Flight product flow.

Load the Swagger-ui from developer's working environment such as

/api-doc/swagger/api/v1/hotel/swagger-ui/index.html

Then access below link then get the Json message.

Figure1

Then copy Json message from above link and paste on Swagger Editor.

Figure1

Then generate YAML file for relevant Json file.

Figure1

Then go to Generate Client link at Swagger Editor then generate required stubs for the REST API end point.

Figure1