Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

while doing Json.encodePrettily(object) in vertx null values are also getting included

while doing Json.encodePrettily(object) in vertx null values are also getting included.

so need to know how we can configure it to avoid null values in response.

like image 370
Kishore Tulsiani Avatar asked Sep 05 '25 03:09

Kishore Tulsiani


1 Answers

io.vertx.core.json is implemented using jackson fasterxml so vertx internally uses jackson fasterxml library. So unless explicitly required there is no need to use any other json library with vertx.

so to avoid same we can use following

Json.prettyMapper.setSerializationInclusion(Include.NON_NULL);
like image 79
Kishore Tulsiani Avatar answered Sep 07 '25 23:09

Kishore Tulsiani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!