You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by "Friedrich Ulrich (Jira)" <ji...@apache.org> on 2019/09/24 13:53:00 UTC

[jira] [Created] (JOHNZON-280) Removing an entry from an array in an object with more than one array fails

Friedrich Ulrich created JOHNZON-280:
----------------------------------------

             Summary: Removing an entry from an array in an object with more than one array fails
                 Key: JOHNZON-280
                 URL: https://issues.apache.org/jira/browse/JOHNZON-280
             Project: Johnzon
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.13, 1.1.12
            Reporter: Friedrich Ulrich


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}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)