I have a serialization issue with this class ``` ...
# getting-started
f
I have a serialization issue with this class
Copy code
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
data class FacebookRequest(
        @JsonProperty("recipient") val recipient: RequestRecipient,
        @JsonProperty("message") val message: RequestMessage? = null,
        @JsonProperty("notification_type") val notificationType: NotificationType?,
        @JsonProperty("sender_action") val senderAction: SenderAction? = null
)
I try to serialize it with:
Copy code
(Json.encode(facebookRequest).toJsonAsBytes()
And I got :
Copy code
io.vertx.core.json.EncodeException: Failed to encode as JSON: No serializer found for class java.lang.Object and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.github.parkee.messenger.model.request.FacebookRequest["message"]->com.github.parkee.messenger.model.request.RequestMessage["quickReplies"]->java.util.ArrayList[0]->com.github.parkee.messenger.model.request.quickreply.QuickReply["payload"])
	at io.vertx.core.json.Json.encode(Json.java:65)
Any ideas? I tried that:
Copy code
Json.mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
I also try that:
Copy code
val mapper = ObjectMapper().registerModule(KotlinModule())