diff --git a/docs-site/docs/mapping-configuration/map-defer.md b/docs-site/docs/mapping-configuration/map-defer.md index 9d8f0a8b9..290b628ea 100644 --- a/docs-site/docs/mapping-configuration/map-defer.md +++ b/docs-site/docs/mapping-configuration/map-defer.md @@ -21,3 +21,5 @@ mapper.createMap(User, UserDto).forMember( ``` `mapDefer()` will set the `TransformationType` to `TransformationType.MapDefer` + +If you have `strict` mode turned on, you might need to annotate the generics of the `MemberMapFunction` like `convertUsing()` diff --git a/docs-site/docs/plugins-system/classes-limitations.md b/docs-site/docs/plugins-system/classes-limitations.md index a398cdb8f..d0a40f7b6 100644 --- a/docs-site/docs/plugins-system/classes-limitations.md +++ b/docs-site/docs/plugins-system/classes-limitations.md @@ -173,3 +173,20 @@ mapper.createMap(SomePersonDto, Person).forMember( ) ); ``` + +## Strict Mode + +If you have `strict` mode turned on, and you have **Union Type** on your properties like: `string | null`, `number | null`, or `boolean | null`; you need to pass the `typeFn` to `@AutoMap()` like the following: + +```ts +export class User { + @AutoMap(() => String) + name!: string | null; + @AutoMap(() => Number) + age!: number | null; + @AutoMap(() => Boolean) + isAdmin!: boolean | null; +} +``` + +This is due to **Weak Reflection** when `strict` mode is enabled.