toedter / spring-hateoas-jsonapi

A JSON:API media type implementation for Spring HATEOAS
Apache License 2.0
107 stars 15 forks source link

@JsonInclude(JsonInclude.Include.NON_NULL) ignored when @JsonApiMeta is used #85

Closed toedter closed 10 months ago

toedter commented 10 months ago

The following does not work together:

@JsonApiMeta
@JsonInclude(JsonInclude.Include.NON_NULL)
private final String metaProperty = null;
@JsonApiMeta
@JsonInclude(JsonInclude.Include.NON_NULL)
@Nullable
public String getMetaProperty() {
        return null;
}

The result contains "metaProperty": null in both cases. The metaProperty should not be included in meta at all, when @JsonInclude(JsonInclude.Include.NON_NULL) is used.