# Swagger CLI plugin

What happens is that TypeScript's metadata reflection system has several limitations, which prevents automatic detection of this data. Fortunately, we can activate the **Swagger CLI plugin**, which fixes many of these issues. The main advantage is that it prevents the necessity of flooding the codebase with swagger decorators for it to detect the data we want to document.

> This official [NestJS doc](https://docs.nestjs.com/openapi/cli-plugin#overview) lists the plugin's features.

To enable it, go to the file <mark style="color:purple;">nest-cli.json</mark> at the root of the project and insert in the <mark style="color:blue;">`compilerOptions`</mark>:

```json
"plugins": ["@nestjs/swagger"]
```

{% hint style="info" %}
For the plugin to load properly, the application should be shut down and started again.
{% endhint %}

After this, we can then refresh the **Swagger UI** page to see the changes. Now, in the route to create a user, we can see that all the fields required to do so have been automatically detected and shown. However, if you look at the route to update a user, you'll notice that the same has not happened, but fixing this is quite easy.

<mark style="color:green;">**Commit**</mark> - Enabling swagger cli plugin
