Skip to content

Commit 8e6e5f9

Browse files
Merge pull request #2053 from shoaib30/update-docs-patch-1
docs(openapi): handle mapped-types and add build steps
2 parents 49ed013 + 8677707 commit 8e6e5f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

content/openapi/cli-plugin.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export class CreateUserDto {
5353
}
5454
```
5555

56+
> info **Hint** When using [mapped types utilities](https://docs.nestjs.com/openapi/mapped-types) (like `PartialType`) in DTOs import them from `@nestjs/swagger` instead of `@nestjs/mapped-types` for the plugin to pick up the schema.
57+
5658
The plugin adds appropriate decorators on the fly based on the **Abstract Syntax Tree**. Thus you won't have to struggle with `@ApiProperty` decorators scattered throughout the code.
5759

5860
> info **Hint** The plugin will automatically generate any missing swagger properties, but if you need to override them, you simply set them explicitly via `@ApiProperty()`.
@@ -184,6 +186,7 @@ export interface PluginOptions {
184186
</tr>
185187
</table>
186188

189+
Make sure to delete the `/dist` folder and rebuild your application whenever plugin options are updated.
187190
If you don't use the CLI but instead have a custom `webpack` configuration, you can use this plugin in combination with `ts-loader`:
188191

189192
```javascript

0 commit comments

Comments
 (0)