Skip to content

Consider fate of SerializationFeature.WRITE_EMPTY_JSON_ARRAYS #1547

@cowtowncoder

Description

@cowtowncoder

(note: based on FasterXML/jackson-annotations#102)

Since existing but deprecated SerializationFeature.WRITE_EMPTY_JSON_ARRAYS does not have exact replacement as is, we need to figure out what to do: main choices being:

  1. Figure out a replacement that is close enough to original one (if not exactly same), or
  2. Un-deprecate it

In former case we could do something as simple as "move" it to be MapperFeature, so that it can not be (attempted to be) changed on ObjectWriter, since even thought it can nominally be changed, change will not take effect as is.
In latter case we could just let it be used as is, with caveat that its semantics (wrt changing) differ from other SerializationFeatures.

On replacement: one initial thought was to add a new JsonFormat.Feature option; which would work nicely if there was a way to set global default (similar to ObjectMapper.setDefaultPropertyInclusion()), but currently there isn't (there is only per-class facility to set JsonFormat.Value). It would be possible to add such default, but since its only function would be to be used for this one format feature it may not be a way to go since it could be confusing in other ways (since other JsonFormat.Value choices would not be used).

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions