BrodaUa / swagger-graph

Generates a graph visualisation from Paths in Swagger API definitions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swagger-graph

Generates a graph visualisation from Paths in swagger-based (aka OpenAPI) RESTful APIs definitions.

What is it for?

During API maintenance or evolution, Architects and API developers might loose track of the existing resources and path parameters. Keeping the defined API standards is a challenging task if one has either dozens of APIs and/or hundread of methods and paths. A graph visualization of how all API's URLs are structured, with an user friendly view of all resources and path parameters, helps Architects to make better decisions.

How it works?

  1. Import from a repository to a database all APIs definitions. We call it "Ingestion";
    • Note 1: Currently only SVN (repository) and MongoDB (database) is supported;
    • Note 2: It' assumed you have them installed.
  2. Traverse all Paths from an API in the database and generate a graph such as the one below.
    • Note: Graph generation is done using GraphViz, which is assumed it is installed.

How graphs look like?

Blue nodes represent API resources. Dashed nodes are path parameters. Each Swagger API is presented with a clear gray background.

Colors can be easily customized.

Graph from one Swagger API

Graph generated by Swagger-Graph

Graph from more than one Swagger APIs

Graph generated by Swagger-Graph

What will you need before using it?

  1. Although it's easy to change, Swagger-graph is designed to fetch API definitions form Subversion (SVN) source code repository. Therefore, "as-is" you will need to have all your Swagger files commited to SVN;

  2. The requirement for MongoDB works in a similar fashing to SVN. Despite being possible not to use any database and generate graphs right from the JSON Swagger files, I have decided to use a database because the plan for future releases of Swagger-Graph is to build a next generation SOA service catalalog. What does it mean? New collections would be added to the very same database that stores the Swagger JSON documents collection. Those new collections would store all sort of relevant information regarding the APIs their services and capabilities. I plan most of them would be added automatically from the run time environment. That is the general idea.

  3. Python 3.5 together with GraphViz and its Python package

About

Generates a graph visualisation from Paths in Swagger API definitions.

License:MIT License


Languages

Language:Python 100.0%