I was creating documentation for Nest.js
API using Swagger
. The problem is what I removed documentation from this DTO or model, in swagger UI docs I can see it as empty object.
For example:
import { IsNotEmpty } from 'class-validator';
export class PostDto {
@IsNotEmpty()
readonly title: string;
@IsNotEmpty()
readonly content: string;
@IsNotEmpty()
readonly description: string;
}
Also I was trying to change name of this entity, using incognito mode, reinstall node_modules
, but it didn't work. If I change name of this entity, it also changes there. What's wrong?
What I want to do, is by removing this documentation decorators, not to see those empty objects.