Swagger or no Swagger LightWave Client lets you create REST APIs in minutes
Updated: Jan 5
RESTful API opens up NonStop by enabling its applications to interoperate with services within the enterprise, in the cloud or anywhere on the Internet. LightWave Client™ from our partner NuWave Technologies is the most popular REST client product to run on NonStop. It enables you to create NonStop applications to consume remote RESTful Web Services in minutes.
There are many factors that attribute to its success, including a browser-based GUI dashboard, its high performance, extensive diagnostic logging, etc. In addition, one outstanding feature is the ease of configuring and managing API definitions.
Swagger allows the RESTful Web Service developer to describe the structure of their APIs so that the REST Client knows how to call them. The ability of APIs to describe their own structure is the root of all benefits in Swagger. This file is essentially a resource listing of your API which adheres to OpenAPI Specification. The specification asks you to include information like:
What are all the operations that your API supports?
What are your API’s parameters and what does it return?
Does your API need some authorization? Etc.
Here is an example of a simple Swagger file.
A Swagger file for a RESTful service greatly facilitates the job of the REST Client program developer because it enables the creation of the methods and operations more easily. LightWave Client™ supports the use of Swagger in defining the APIs to consume the RESTful web service.
Swagger Support in LightWave Client – Point and Click
With LightWave Client™, you can create an API to consume the remote RESTful service instantly by importing its Swagger file. This can be done via a point-and-click operation like below.
Once the Swagger has been imported, LightWave Client™ will generate a schema with all the methods and operations as defined in the Swagger file. And the API is done!
LightWave Client™ also provides a feature that allows you to customize some of the schema attributes, like field size, array size, etc. to fit your application environment.
What if there is no Swagger?
The reality is that not every RESTful web service provider supplies a Swagger. This presents a potential problem to some other REST Client products on NonStop which require that you must have a Swagger file for it to work. If you don’t have it, then you are stuck. You will need to “make up” (create) one manually. It can be a tedious process that is prone to incompleteness and errors.
Lightwave Client – Schema By Example
This is not an issue for LightWave Client™. No need to fumble around trying to create a Swagger manually. With LightWave Client™, all you need is a sample Request and Response. Then you can take advantage of the product’s “Schema By Example” feature. As the name implies, LightWave Client™ will use the sample that you provide as an example to build a schema to be used for creating the request and response necessary to access the remote API.
When you use the LightWave Client™ GUI Dashboard to create the API definition, one of the options is “Add By Example.”
Paste in a sample Request or Response. Below is the definition for a Request
Once the request and the response definitions are imported via the Example, you can optionally edit the schema to fit your application needs.
That’s it: you API definition is now complete by using LightWave Client's™ Schema By Example feature.
Read more Blogs:
Do you find this tutorial blog helpful? Let us know what you think, and how we can make it even better. Don’t forget, you can subscribe to our blogs to get automatic email notification when a new blog is available.
Phil Ly is the president and founder of TIC Software, a New York-based company specializing in software and services that integrate NonStop with the latest technologies, including Web Services, .NET and Java. Prior to founding TIC in 1983, Phil worked for Tandem Computer in technical support and software development.