Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring: Microservices with Spring Boot

You're reading from   Spring: Microservices with Spring Boot Build and deploy microservices with Spring Boot

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher
ISBN-13 9781789132588
Length 140 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
In28Minutes Official In28Minutes Official
Author Profile Icon In28Minutes Official
In28Minutes Official
Arrow right icon
View More author details
Toc

Documenting REST Services


Before a service provider can consume a service, they need a service contract. A service contract defines all the; details about a service:

  • How can I call a service? What is the URI of the service?

  • What should be the request format?

  • What kind of response should I expect?

There are multiple options to define a service contract for RESTful services. The most popular one in the last couple of years is Swagger. Swagger is gaining a lot of ground, with support from major vendors in the last couple of years. In this section, we will generate Swagger documentation for our services.

The following quote from the Swagger website (http://swagger.io) defines the purpose of the Swagger specification:

Swagger specification creates the RESTful contract for your API, detailing all of its resources and operations in a human and machine readable format for easy development, discovery, and integration.

Generating a Swagger Specification

One of the interesting developments in the last few...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image