API Modelling

Introduction

REST APIs are commonly used to expose functionality provided by a service to external consumers. When doing this, it is good practice that the offered REST API is described by an OpenAPI specification, which allows consumers to easily browse the offered functionality.

API Modelling in IBM Industry Solutions Workbench

To ease the creation of REST APIs within a service project, IBM Industry Solutions Workbench offers the API Modelling extension. It provides various modelling capabilities within the Solution Designer UI, which helps to quickly model REST APIs for various use cases.

The extension is available for the following stacks:

  • Java Spring Boot Stack 2.0.0 and later
  • Java Spring Boot Stack 1.0.0 (only for Domain services and always enabled)
  • NodeJS TypeScript Stack (only for Domain services and always enabled)

For the modelled REST API, a specification will be generated automatically in the OpenAPI 3 format. Besides that, it offers the capability to additionally build it in the Swagger 2 format. During deployment, the specification will be published automatically, so that it can be discovered by consumers. To learn more about modelling REST APIs, please check API Namespaces.

When an API is modelled in the Solution Designer, a REST API will automatically be offered by the service. The REST API is secure by default and only allows access when a valid JWT is provided.

The implementation of the REST API can be done comfortably after cloning the project. Depending on the modelled operations, requests and responses, various code artefacts will be generated to ease the implementation. Using this code artefacts, ensures that the implementation is compliant with the API specification provided for potential consumers. To find out more about implementation of REST APIs, please check out Implement REST APIs (Java) or Implement REST APIs (TypeScript)

Tip:

To easily visualize and access the REST API, please check out the Swagger UI Support Extension