In this chapter we’re going to describe a simple HTTP response with OpenAPI and add it to our FarmStall API definition. We’ll look at the components of an HTTP response, comprising three parts: a status code, a set of headers, and an optional body. We’re going to focus on the status code and body for now (see figure 5.1). Headers will be covered incrementally throughout the next chapters.
Describing response bodies is an important part of communicating an API. Consumers need to know what the API will return when they call it from their applications.