You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Jackson 2.x has void as return type for write methods, like:
public abstract void writeStartArray() throws IOException;
which prevents chaining of write calls. It would be nice to instead have these return JsonGenerator, but change of return type is bytecode-/binary-incompatible change and as such absolutely no-go for 2.x.
But for 3.x this would be doable. It
One possible open question here is that format-specific subtypes' overriding of write methods; should they change return type to proper "this" type? I don't want to make JsonGenerator (... misnomer at this point, but it is what it is) type-parameterized.
I guess this is not a problem for most usage but should probably decide on recommended approach.
The text was updated successfully, but these errors were encountered:
cowtowncoder
changed the title
For Jackson 3.x make JsonGenerator.writeXxx() methods chainable
Make JsonGenerator.writeXxx() methods chainable
Jul 29, 2022
Currently Jackson 2.x has
void
as return type for write methods, like:which prevents chaining of write calls. It would be nice to instead have these return
JsonGenerator
, but change of return type is bytecode-/binary-incompatible change and as such absolutely no-go for 2.x.But for 3.x this would be doable. It
One possible open question here is that format-specific subtypes' overriding of write methods; should they change return type to proper "this" type? I don't want to make
JsonGenerator
(... misnomer at this point, but it is what it is) type-parameterized.I guess this is not a problem for most usage but should probably decide on recommended approach.
The text was updated successfully, but these errors were encountered: