Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cowtowncoder opened this issue Jan 28, 2021 · 0 comments
Closed
Labels
Milestone

Comments

@cowtowncoder
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant