The aim of the Rhino REST API Framework is to take one or more OpenAPI documents, and generate a fully functional REST Resource Adaptor, with minimal developer effort.

Workflow

The workflow is explained in more detail in Rhino REST API Framework Users Guide, but can be summarised as follows:

  1. Write or obtain the OpenAPI document for each REST API that is required.

  2. For each API, create an API Module using the Rhino REST API Framework SDK tools.

  3. Create an RA Module using the SDK, and add dependencies on the API Modules that the RA should support.

  4. Build and publish the API Modules and RA Modules. The RA Module produces a Resource Adaptor that can be deployed in the Rhino TAS.

Apart from editing some build or properties files, no coding is required, and the developer now has a fully functional RA they can use to develop their applications.

How it works

The framework makes use of the popular open source tool openapi-generator. The openapi-generator tool is implemented in Java, but can generate output for any language. It provides an extension mechanism so that generators for new languages and frameworks can be added. The Rhino REST API Framework includes the OpenAPI SLEE Generator, a Java library that is loaded by openapi-generator automatically when it is available on the JVM’s classpath.

OpenAPI SLEE Generator

The Rhino REST API Framework provides Ant macros that run openapi-generator with the necessary command-line options to invoke the OpenAPI SLEE Generator. API Modules include Ant build files to invoke the generator, which can be customized by the SDK user. For example, a user may want to pass additional options to openapi-generator, or override some default templates.

The OpenAPI SLEE Generator uses "libraries", which is an openapi-generator term for sets of templates that can be used with the same generator. Each library knows how to generate a particular type of SLEE component. The available libraries are:

Client RA Type

The Java interface for SLEE applications using the API in a client role.

Server RA Type

The Java interface for SLEE applications using the API in a server role.

Client REST RA Plugin

Extension to the REST RA Core that implements a Client RA Type.

Server REST RA Plugin

Extension to the REST RA Core that implements a Server RA Type.

Client & Server RA Type

The Java interface for SLEE applications using the API in a client and/or server role.

Client & Server RA Plugin

Extension to the REST RA Core that implements a Client & Server RA Type.

Server SBB Part

Superclass for an SBB Part that implements event handlers for the request events defined in a Server RA Type.

Client SBB Part

Superclass for an SBB Part that implements event handlers for the response events defined in a Client RA Type.

Ant macros are provided that generate the various component types.

Tip

The module packs provided by the framework automatically create the necessary modules and Ant build files for the component types above. It is not necessary to create these build files from scratch. See Rhino REST API Framework Users Guide for more information.

OpenAPI Support & Limitations

Schema

OpenAPI documents in OpenAPI v2 and OpenAPI v3 formats are supported.

Callbacks

OpenAPI v3 Callback Objects are supported. If an API declares callback operations, then the generated server RA Type will have methods so that the server can create and send a request to a client.

Authentication & Authorization

Currently the OpenAPI SLEE generator does not generate any code for an operation’s Security Scheme Object. The application must set any required parameters (e.g. API Key) on a request manually.

Previous page Next page