Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option doNotExcludeDecorator #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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