How to create Metadata with union type? #475
-
I'm using automapper with Pojo strategy. I have to define metadata for it, but "postalCode" field have a union type.
Unfortunately the syntax null postalCode: null | number does not work. I have looking in documentation but there was nothing about using union types with this strategy - https://automapperts.netlify.app/docs/strategies/pojos/. Is there a way to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
As of the moment, there's no union support for metadata. |
Beta Was this translation helpful? Give feedback.
As of the moment, there's no union support for metadata.
number | null
is still Number in this case. If the sourcepostalCode
isnull
then it will be mapped tonull
, if the sourcepostalCode
isundefined
then it will be mapped toundefined
. You can useundefinedSubstitution(null)
to convert it tonull
if the source isundefined