katharsis-project / katharsis-framework

Katharsis adds powerful layer for RESTful endpoints providing implementenation of JSON:API standard
http://katharsis.io
Apache License 2.0
135 stars 65 forks source link

a problem we have when updating the version of Katharsis from 2.8.2 to 3.0.2 #451

Open tangchengn opened 7 years ago

tangchengn commented 7 years ago

In the latest released version 3.0.2, there is a configuration in class "io.katharsis.resource.Resource" as below: @JsonInclude(Include.NON_EMPTY) private Map<String, JsonNode> attributes = new HashMap<>();

And our problem is:

when the value of a field needed in DTO is null, we hope that the field can be invisible, so the configuration we did in

class "KatharsisFeature" as we did before as below is no longer effective.

(objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) .configure(SerializationFeature.WRITE_NULL_MAP_VALUES,false) .setSerializationInclusion(JsonInclude.Include.NON_NULL)

So, do you have any advice? looking forward to your reply.