Most API endpoints need some input from the client.
For example, a Bookstore API might need a book ID to retrieve a particular book, a category to filter books, or a JSON payload containing the details of a new book.
OpenAPI provides a structured way to describe these inputs so that developers know exactly what to send.
There are two main ways to describe input data in OpenAPI:
Both are important for defining clear API contracts.
Let's explore how to describe them, apply validation rules, and handle common scenarios.