Skip to content

Add support for writing byte[] via JsonGenerator.writeEmbeddedObject() #318

@cowtowncoder

Description

@cowtowncoder

(note: should be safe for patch, that is, 2.8.3)

Default implementation of 2.8-added writeEmbeddedObject() throws exception (unsupported operation) for all values, since JSON does not have any native object types.
This is different from handling of writeObject(), which tries to either delegate to ObjectCodec (if one registered), or even encode "simple" values.

However: since support for binary data is already handled in some cases using VALUE_EMBEDDED_OBJECT, it would actually make sense to handle case of byte[] (and, if feasible, perhaps ByteBuffer for extra points), and also ensure null can be written.

This is likely necessary to support FasterXML/jackson-databind#1361 and should in general make system more robust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions