Skip to content

Conversation

@Innei
Copy link

@Innei Innei commented Feb 16, 2022

I have encountered a problem. I have a Dto that has a field decorated by Exclude, but I don't want it to disappear from the JsonSchema.

export class TerminalOptionsDto {
  @IsOptional()
  @IsBoolean()
  enable: boolean

  @IsOptional()
  @IsString()
  @Transform(({ value }) =>
    typeof value == 'string' && value.length == 0 ? null : value,
  )
  @Exclude({ toPlainOnly: true, })
  @JSONSchema({ format: 'password', type: 'string', title: '密码' })
  password?: string

  @IsOptional()
  @IsString()
  script?: string
}

The password is disappear in JSONSchema, but I need it.

So, can add option to disable this feature?

@Innei Innei force-pushed the dev/add-do-not-exclude branch from f221896 to 084b8a4 Compare June 4, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant