Monday, September 15, 2014

POC: Swagger - Spring MVC (And Swagger UI)

My eGospel project using SpringMVC in the backend, and produces JSON RESTful web services via it's controllers as JSON objects. To quickly see the list of the services, and do simple check, I use swagger-ui (which means I also need to use swagger, in this case swagger-springmvc). Previously, I'm using swagger-springmvc ver 0.6.5. But when I'm upgrading to ver 0.8.8, it start to have issues.

So, I decided to create another project, as showcase or working example of the framework. I will write my finding on another post. Please check the project on github, and please give me some direction.

Introduction to Spring Web MVC framework

The Spring Web model-view-controller (MVC) framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale, time zone and theme resolution as well as support for uploading files. The default handler is based on the @Controller and@RequestMapping annotations, offering a wide range of flexible handling methods. With the introduction of Spring 3.0, the @Controller mechanism also allows you to create RESTful Web sites and applications, through the @PathVariable annotation and other features.

What's Swagger?

The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swager removes the guesswork in calling the service.
Check out Swagger-Spec for additional information about the Swagger project, including additional libraries with support for other languages and more.

Swagger UI

Swagger UI is part of Swagger project. The Swagger project allows you to produce, visualize and consume your OWN RESTful services. No proxy or 3rd party services required. Do it your own way.
Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation and sandbox from a Swagger-compliant API. Because Swagger UI has no dependencies, you can host it in any server environment, or on your local machine.

No comments:

Post a Comment