7 Developing RESTful Web services with Spring Boot

 

This chapter covers

  • Designing and building RESTful Web services with Spring Boot
  • Exception handling in RESTful Web services
  • Developing unit test cases to test RESTful Web services
  • Documenting the RESTful Web services through OpenAPI
  • Implementing different versioning strategies for RESTful Web services
  • Techniques for securing RESTful Web services

In the microservice-based architecture, it is a common practice to expose application functionality in terms of RESTful APIs. These APIs can then be accessed via a range of application devices, such as desktop applications, mobile devices, as well as other APIs.

In this chapter, we’ll introduce you to designing and building RESTful APIs with Spring Boot. You’ll also learn to document the API, so the API consumers can find required details about the API, such as the request, response structures, HTTP return codes, etc. Finally, you’ll learn to develop unit test cases to test the API. Lastly, we’ll show you how to secure your RESTful API. Let’s get started.

7.1 Developing a RESTful API with Spring Boot

7.1.1 Technique: Developing a RESTful API using Spring Boot

7.2 Managing exceptions in a Spring Boot RESTful API

7.2.1 Technique: Handling exceptions in a RESTful API

7.3 Testing a RESTful API

7.3.1 Technique: Testing a RESTful API in a Spring Boot application

7.4 Documenting a RESTful API

7.4.1 Technique: Documenting a RESTful API with OpenAPI

7.5 Implementing RESTful API versioning

7.5.1 Technique: Implementing versioning in a RESTful API

7.6 Securing a RESTful API

7.6.1 Technique: Using JWT to authorize RESTful API requests

Summary