How to use JsonIgnore in Vertx?

350 views
Skip to first unread message

John Dang

unread,
Jan 20, 2020, 8:10:33 AM1/20/20
to vert.x
Hi Everyone,

I need to ignore a property from a POJO when serializing to JSON then sending data to Kafka topic using io.vertx.core.json.

Currently, I use @JsonIgnore tag on top of the property but still see that field after serializing.
I search and could not find much about this topic on Vertx. I'm not sure if the library supports this feature.

Thanks,

JDang

Julien Viet

unread,
Jan 21, 2020, 11:43:19 AM1/21/20
to ve...@googlegroups.com
Hi,

how do you serialize your POJO to JSON ?

if you are using JsonObject.mapFrom(obj) I believe it should work as it uses Jackson Databind under the hood, but I never tried with this particular annotation

Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/df18ddab-f3b0-4d74-ab5b-77990bfc2eea%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages