Allow to use custom serializer with primitive type