Giter VIP home page Giter VIP logo

swagger-deepdive's Introduction

Build Status

Swagger Deep Dive

This is an example Springfox example project to explore different features of Swagger and Springfox in depth. The project consist of multiple endpoints of different animals and birds which are part of a menagerie. According to wikipedia, "A menagerie is a collection of captive animals, frequently exotic, kept for display; or the place where such a collection is kept, a precursor to the modern zoological garden."

The menagerie project consist of three modules:

  1. swagger: The custom Springfox/Swagger classes and plugins reside here.
  2. model: Menagerie model classes.
  3. service: Menagerie service related classes. It consists of multiple controller classes exposing different REST endpoints: ElephantController, LionController, ParrotController, TigerController, and ToucanController. The backend services are supported by HSQLDB, an in-memory database, and JPA.

The menagerie application is based on Springfox 2.6.1 version. You can find more about different Swagger/Springfox customizations, please refer to the Wiki page.

Build

Execute the following command from the parent directory to build the project:

mvn clean install

Run

To run the menagerie application from the terminal,

java -jar service/target/swagger-deepdive-service-1.0.jar

You should notice the application starting:

 ███╗   ███╗ ███████╗ ███╗   ██╗  █████╗   ██████╗  ███████╗ ██████╗  ██╗ ███████╗
 ████╗ ████║ ██╔════╝ ████╗  ██║ ██╔══██╗ ██╔════╝  ██╔════╝ ██╔══██╗ ██║ ██╔════╝
 ██╔████╔██║ █████╗   ██╔██╗ ██║ ███████║ ██║  ███╗ █████╗   ██████╔╝ ██║ █████╗
 ██║╚██╔╝██║ ██╔══╝   ██║╚██╗██║ ██╔══██║ ██║   ██║ ██╔══╝   ██╔══██╗ ██║ ██╔══╝
 ██║ ╚═╝ ██║ ███████╗ ██║ ╚████║ ██║  ██║ ╚██████╔╝ ███████╗ ██║  ██║ ██║ ███████╗
 ╚═╝     ╚═╝ ╚══════╝ ╚═╝  ╚═══╝ ╚═╝  ╚═╝  ╚═════╝  ╚══════╝ ╚═╝  ╚═╝ ╚═╝ ╚══════╝

Running Menagerie: An Springfox/Swagger Deep Dive project.
2017-05-03 22:33:23.677  INFO 71259 --- [           main] c.b.e.m.boot.MenagerieApplication        : Starting MenagerieApplication on mycomputer with PID 71259
...

2017-05-03 22:34:32.104  INFO 71274 --- [           main] .d.s.w.r.o.CachingOperationNameGenerator : Generating unique operation named: updateUsingPUT_4
2017-05-03 22:34:32.172  INFO 71274 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-05-03 22:34:32.178  INFO 71274 --- [           main] c.b.e.m.boot.MenagerieApplication        : Started MenagerieApplication in 7.228 seconds (JVM running for 7.778)

swagger-deepdive's People

Contributors

indrabasak avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.