You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Potential Commit/PR that introduced the regression
No response
Versions
No response
Describe the regression
When using regular expression in @matches decorator from class-validator swagger throws exception
/app/node_modules/js-yaml/lib/dumper.js:868
throw new YAMLException('unacceptable kind of an object to dump ' + type);
^
YAMLException: unacceptable kind of an object to dump [object RegExp]
at writeNode (/app/node_modules/js-yaml/lib/dumper.js:868:13)
at writeBlockMapping (/app/node_modules/js-yaml/lib/dumper.js:731:10)
at writeNode (/app/node_modules/js-yaml/lib/dumper.js:834:9)
at writeBlockMapping (/app/node_modules/js-yaml/lib/dumper.js:731:10)
at writeNode (/app/node_modules/js-yaml/lib/dumper.js:834:9)
at writeBlockMapping (/app/node_modules/js-yaml/lib/dumper.js:731:10)
at writeNode (/app/node_modules/js-yaml/lib/dumper.js:834:9)
at writeBlockMapping (/app/node_modules/js-yaml/lib/dumper.js:731:10)
at writeNode (/app/node_modules/js-yaml/lib/dumper.js:834:9)
at writeBlockMapping (/app/node_modules/js-yaml/lib/dumper.js:731:10)
Minimum reproduction code
Have typeorm entity like this
import{Transform}from'class-transformer';import{IsAlphanumeric,IsNotEmpty,IsOptional,Matches,}from'class-validator';
@Entity()exportclassDocPropTypes{
@IsOptional({groups: [CREATE]})
@IsNotEmpty({groups: [UPDATE]})
@PrimaryGeneratedColumn()id: number;
@IsNotEmpty({groups: [CREATE]})
@IsOptional({groups: [UPDATE]})
@IsAlphanumeric()
@Matches(/[^]+/)// <============== This line gives errors. Removing this line and exception is gone
@Transform((transform)=>transform.value?.trim())
@Column({comment: 'Code'})code: string;}
Expected behavior
With old swagger (nestjs 8) there was no error
Other
No response
The text was updated successfully, but these errors were encountered:
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
No response
Versions
No response
Describe the regression
When using regular expression in @matches decorator from class-validator swagger throws exception
Minimum reproduction code
Have typeorm entity like this
Expected behavior
With old swagger (nestjs 8) there was no error
Other
No response
The text was updated successfully, but these errors were encountered: