Working with a request body
The next thing we want to document for our endpoints is the request body that consumers must supply. This is not relevant for the GET /items endpoint, but it is for our POST and PATCH endpoints, and any others that require body data.
POST /items
SO let's now work on the POST /items endpoint. We'll begin by adding the doc block above the method. We'll then add the @api
param and set this to {post} /items
, and we'll describe this endpoint as "Create an item".
Click to load comments...