Skip to content

Extra content after end of an array is ignored #3977

@marekkrk

Description

@marekkrk

Describe the bug
Extra content after a square bracket that ends an array is ignored. Example:
[]abc

Version information
2.15.2

To Reproduce
Run the following code:

import com.fasterxml.jackson.databind.ObjectMapper;

public class ParseArray {

public static void main(String[] args) throws Exception {
    var mapper = new ObjectMapper();
    var obj = mapper.readValue("[]abc", Object.class);
    System.out.println(obj);
}

}

Expected behavior
A parse exception is thrown.

Additional context
No exception, an empty list is printed to standard out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    to-evaluateIssue that has been received but not yet evaluated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions