Swagger with WSO2 API Manager
APIs are often described in JSON, and XML Schema or XML-based client tooling doesn’t work. Swagger enables developers to describe the API message, produce API schema documentations, and simplify connecting clients to APIs. The overarching goal of Swagger is to enable client and documentation systems to update at the same pace as the server. The documentation of methods, parameters and models are tightly integrated into the server code, allowing APIs to always stay in sync. WSO2 API Manager now integrates Swagger code. Swagger spans six distinct GitHub modules:
Swagger is a specification and complete framework available under an Apache 2.0 open source license. Swagger includes six distinct modules:
Swagger Core defines Java annotations and logic to automatically generate a Swagger JSON description from a number of supported servers. This project also hosts the wiki, which defines the specification.
Swagger Codegen contains a template-driven engine to generate code in different languages by parsing your Swagger Resource Declaration.
Scalatra contains native support for Swagger inside the Scalatra micro web framework.
Swagger node.js provides automatically-generated Swagger JSON for node.js in the express framework.
Swagger Play 2 provides automatically-generated Swagger JSON for the Play! Framework
WSO2 API Manager 1.4 supports Swagger. With Swagger integration, WSO2 API Manager 1.4 loads Swagger UI for each API and will display auto-generated documentation. The API creator or API publisher can customize API parameters and documentation.
Figure 1: Default Swagger UI in WSO2 API Store
The APICultur Store demonstrates Swagger integration in action.
To learn more about how to add documentation with Swagger, read the WSO2 API Manager documentation page.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)