The video for this lesson is currently being updated, please read the transcript instead.

Reusing doc snippets

The header documentation we just defined for the DELETE /items/:id endpoint will actually be used by several other endpoints, including POST /items.

We could simply copy and paste those lines, but there's a "DRY" way to do it by using the @apiDefine param.

Let's go to the top of the file and create a new block up here. We'll use the @apiDefine param, after which can provide a unique name. Let's name this "AuthHeader".

To view the complete lesson you'll need to login or join this course.


Click to load comments...