Uploaded image for project: 'Johnzon'
  1. Johnzon
  2. JOHNZON-280

Removing an entry from an array in an object with more than one array fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.12, 1.1.13
    • 1.2.0
    • Core
    • None

    Description

      Code to reproduce:

      JsonObject base = Json.createObjectBuilder()
        .add("foo", Json.createArrayBuilder().add("foo").add("bar").build())
        .add("bar", Json.createArrayBuilder().build())
        .build();
      JsonPatch p = Json.createPatchBuilder().remove("/foo/0").build();
      p.apply(base);

       

      Throws an execption:

      javax.json.JsonException: '[]' contains no element for index 0

      Attachments

        Activity

          People

            Unassigned Unassigned
            fulrich Friedrich Ulrich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: