Designing REST APIs with OAS
In this section, we’ll dive into using OAS by designing an API for a Magic Items store. We want to introduce you to the practical aspect of API design with OAS and see how it works in the real world. You’ll learn how to set up API endpoints, structure data for requests and responses, and add cool features such as security and reusable bits. We’ll explain why these things matter and how they make your API shine. All of these are based on the knowledge you have already gained previously in this book.
OpenAPI and Swagger
As we already mentioned in the section about the origins and purpose of OAS, it used to be called Swagger Specification. This terminology often persists to this day, interchangeably. In this book, when talking about the specification, we will always refer to it as OpenAPI Specification (OAS). There are noticeable and significant differences between the two specifications. OpenAPI 3.x (the current version...