Skip to content

Cannot deserialize byte[] from JSON null value #107

@reed53

Description

@reed53

Hello,
I ran into a bug today that I don't see a workaround for.
If I have an object like so:

  @Setter
  @Getter
  public static class ObjectWithByteArray {
      private byte[] arr;
  }

and I try to deserialize "{\"arr\":null}", I get the following error:

com.fasterxml.jackson.core.JsonParseException: Current token (VALUE_NULL) not VALUE_STRING or VALUE_EMBEDDED_OBJECT, can not access as binary
 at [Source: (String)"{"arr":null}"; line: 1, column: 12]

I then tried to implement a custom reader for byte arrays to work around this issue, however it seems like the error occurred before the reader has access to the value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions