OpenAPI (Swagger)
Documentation is very important when writing a Nest server, and is especially so when creating an API that will be consumed by others, otherwise the developer writing the clients that will eventually be consuming the API do not know what to send or what they get back. One of the most popular documentation engines out there is Swagger. Like with others, Nest provides a dedicated module for the OpenAPI (Swagger) spec, @nestjs/swagger
. This module provides decorators to help describe the inputs/outputs and endpoints of your API. This documentation is then accessible through an endpoint on the server.