Skip to content

Replace JsonGenerator.writeObject() (and related) with writePOJO() #673

Closed
@cowtowncoder

Description

@cowtowncoder

Existing method JsonGenerator.writeObject() (and related writeObjectField()) is misnamed since Object otherwise refers to Object (JSON) values, but this method is for writing Java Objects (POJOs) -- which often end up as Object values but do not have to. Elsewhere in Jackson (f.ex in Tree Model) this difference is indicate properly.

So: let's add writePOJO() (and writePOJOField()) in 2.13 (and perhaps deprecate later in 2.14 or so): in 3.0 we can then remove old methods and only keep new ones.

NOTE: writeObjectFieldStart(), writeObjectId() and writeObjectRef() should remain as-is since the naming is less confusing (first method actually refers to data-level Object Value; and for other 2 Id/Ref make it clear these must be for Object entities).

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.x

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions