MichalLytek / MichalLytek/class-transformer-validator

Give an option to combine class-validator's decorators with class-transformer's "excludeExtraneousValues" ?

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
205
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Since this package uses both class-validator and class-transformer, and many users complain on applying @Expose() on all fields in order to remove extraneous values, wouldn't it be possible to give an option to levarage the validation decorators?

Something like "excludeUnvalidatedFields"?

Or, perhaps, we could have something like @IsStringExpose(), that wraps both @IsString() and @Expose() ? I created this Gist as reference: https://gist.github.com/pauloendoh/f7d3194bae2ff121e78ce45589bd4ab2

Contributor guide

No contributing guide indexed for this repository

Research direction

Review how this package combines class-transformer and class-validator, then compare the proposed options with the linked Gist. Define the desired behavior for excluding unvalidated fields or combining decorators, and confirm the scope with maintainers before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.