Chapter 13. Creating a RESTful JSON API with Swagger

This chapter covers

  • API basics and construction styles
  • Adding an HTTP API to the Hacker Tracker
  • Refactoring code to remove trait duplication
  • The Swagger documentation framework
  • Annotating the Hacker Tracker API using Swagger
  • Securing your API with HMAC

Scalatra is commonly used as a way to build HTTP application programming interfaces (APIs). An API is a way for one computer system to talk to another. It usually exposes business processes and data from one computer system, making it available for another computer system to talk to.

If you’ve done any web development over the past several years, you’ll be aware that large web companies—Google, Facebook, Twitter, Amazon—all have APIs ...

Get Scalatra in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.