jsonvertx-httpclient

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.


Solution

  • 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);