Friday, 18 October 2019

Amazing Use of Swagger Contract YAML

REST based micro-services is current day trend to develop application over HTTP communication. 

We have choice to follow either "CONTRACT FIRST" or "CONTRACT LAST".

My personal choice is "CONTRACT FIRST". It has numerous advantages - few of them are:-

  1. Request and Response is framed upfront and Swagger (YAML) contract is developed and published for its prospective clients.
  2.  Early feedback.
  3. Quick turn-around to market.       

Another vital benefits is that developed Swagger can reduce your micro-service development time by approx HALF.

Don't get Surprised!  Keep reading.

Follow below step in your Spring-boot project and generate controller Interface, Models etc upfront and simply focus on service logic in your micro-service.

All steps are to be incorporated in your POM.xml

1. Add path- of your swagger yaml file in project.

2. Add maven swagger codegen plugin and you are done.



For details TDD and quality REST micro-services development refer course at

Thank you!

Satender Kumar Mall
Twitter: @satenderiiit

No comments:

Post a Comment