Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Architecture

William Gardiner edited this page Mar 6, 2019 · 5 revisions

SwaggerGen Annotations

We have created a custom set of Java annotations and using Reflection within Java, we can read through a project importing these to generate Swagger documentation.

Data

This solution accomplishes it's functionality through a series of parsers and translators, that read data from the input space (annotations, JSON schemas, and config files) and maps that same information to the output space (a Swagger file). The different formats that the data take along the way are described here:

Format Translations img

Domain

The domain describes the Java objects that provide no functionality, but act as containers for the data being acted upon by the rest of the system.

Input

Items in the input domain are Java objects constructed to match the structure of the data coming in.

A JSON Schema is a JSON file the describes the format of other JSON files. The JsonSchema is a Java representation of that JSON file.

SchemaIn img

Output

Items in the output domain are Java objects constructed to match the structure of the data going out.

The Path object stores all of the data that Swagger uses to describe a path. It is structured to use the same format as a Swagger file so that it can be easily written to a YAML or JSON Swagger file.

Path img

The Content object represents the contents of a body of a request. This in the output domain equivalent of the JsonSchema object.

Content img

Solution Structure

The package diagram below describes the intended purpose of each component. Data flows from input to output with each of the various components acting when appropriate.

package diagram img

Clone this wiki locally