Using SwaggerHub with webMethods API Gateway
Tags: webmethods, apimanagement, apigateway, developerportal
Published: 2022-06-13 08:39:04

---
title: Using SwaggerHub with webMethods API Gateway
published: true
date: 2022-06-03 13:11:02 UTC
tags: webMethods, APIManagement, APIGateway, DeveloperPortal
canonical_url: https://tech.forums.softwareag.com/t/using-swaggerhub-with-webmethods-api-gateway/257994
---

According to a recent [Nordic APIs statistics roundup](https://nordicapis.com/20-impressive-api-economy-statistics/), over 90% of developers are using APIs and they spend nearly 30% of their time coding APIs. This clearly illustrates how important APIs have become for businesses, but also how much impact they have on the workload of IT professionals.

## What are API design tools good for?

Traditional API development practices often start with implementing business requirements in code and then generating the API specification and documentation from that code. For example, you would develop your Spring Boot microservice, annotate the implementation for OpenAPI and let the specification be generated by the framework. This is what you would call a **code-first approach** to building APIs.

Code-first API development is quick and well supported by many developer frameworks. But it does have a few downsides too:

1. Everyone else has to wait for the development to finish to get the completed API specification.
2. Generated documentation does not necessarily deliver a great developer experience.
3. You run a significant risk of expectation mismatches, introducing the risk of needing costly rework.

A **design-first first approach** to building APIs aims to tackle these disadvantages. With a design-first approach you describe the API in an iterative way that both humans and computers can understand - before you write any code. Every stakeholder participates in the API design to write an API specification that satisfies the business requirement in a way that works for everyone. Having the API specification available early in the process has significant benefits:

1. You can use the API specification to create mock servers, making it possible for teams to work in parallel.
2. Using API design tools you can create API specifications that improve the developer experience with interactive documentation, code samples, try out features, etc.
3. With API design tools it is easier to reuse components across multiple API projects, greatly reducing cost of development and improving the developer experiences across all APIs.

API Design tools come in different shapes and forms. webMethods API Gateway has API design features. But other options are available too, ranging from simple text editors over IDE extensions to robust collaboration platforms. [SwaggerHub](https://swagger.io/tools/swaggerhub/) fits that last category and offers an enterprise-grade solution for accelerating API delivery and quality through collaboration and built on [OpenAPI](https://www.openapis.org/).

## API lifecycle and Software Delivery

This post fits in a series of technical posts that I announced in [New API tools are transforming API Management](https://blog.softwareag.com/api-management-tools/). In that introduction I used this simple representation of the API Lifecycle.

![api_lifecycle_stages_iterative](https://aws1.discourse-cdn.com/techcommunity/original/3X/9/a/9a751f713a21fd442e4b6dfb2f23736d1304845a.png)

The API lifecycle is a high level abstraction of the actual delivery process for APIs. Ultimately APIs are software, and our industry has well-established practices like DevOps and CI/CD for software delivery. The next diagram illustrates how the API lifecycle can be mapped to different stakeholders.

[![api_lifecycle_stakholders_design](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/3/e/3ecfe2f8d041fbcd5b071ca109dc2396736a1cc4_2_517x213.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/3/e/3ecfe2f8d041fbcd5b071ca109dc2396736a1cc4.png "api\_lifecycle\_stakholders\_design")

## Integrating SwaggerHub

There are different options for getting the specifications designed with SwaggerHub into your gateway. You could for example import them manually. However, SwaggerHub supports direct integration with version control systems, which leads to interesting possibilities. I will walk you through an example with GitHub as the developer platform.

1, You design the API specification and documentation in SwaggerHub. You get all the cool and nifty features they offer to design the API in such a way that it will be clear to implement and delivers a great developer experience.

[![swaggerhub_api_editor](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/4/5/45a6637bce9ccd58902842db94ec992b86fda317_2_517x257.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/4/5/45a6637bce9ccd58902842db94ec992b86fda317.png "swaggerhub\_api\_editor")

2, When you’ve finished the design you are ready to make the specification available for the developers. SwaggerHub has a [GitHub Sync feature](https://support.smartbear.com/swaggerhub/docs/integrations/github-sync.html) which synchronizes your API specification and optionally generated server code and client SDK with a GitHub repository.

![swagger_hub_push](https://aws1.discourse-cdn.com/techcommunity/original/3X/3/7/378366a87709bb4449895462837cdeddd061a5f0.gif)

3, Then your developers go and do their magic, building an awesome API. As part of their CICD pipeline, they will automate building, packaging and deployment of the service code. In a previous post on [using GitHub Actions with webMethods API Gateway](https://tech.forums.softwareag.com/t/using-github-actions-with-webmethods-api-gateway/257584) I have explained how you can automate the registration and promotions of APIs with GitHub workflows. I’ll use a similar approach here, [automatically registering the API in webMethods API Gateway](https://github.com/jiridj/wm-apigw-actions-register-api) as part of the CICD pipeline.

[![github_workflow](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/c/b/cbb05f012b807cc50e1be50fd962c295d023cd71_2_517x249.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/b/cbb05f012b807cc50e1be50fd962c295d023cd71.png "github\_workflow")

And that ties it all together! If you’d like to see it all in action, here is a [quick demonstration](https://youtu.be/hikSb6JP6xc) that takes just a few minutes!

[![youtube](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/c/5c9ce3dee8476397935c70a7afb1afe9f55a23ea.jpeg)](https://youtu.be/hikSb6JP6xc)

[Visit the original post](https://tech.forums.softwareag.com/t/using-swaggerhub-with-webmethods-api-gateway/257994)