johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravisankar Challa (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JOHNZON-172) JsonPatchBuilder issue for a partcuilar scenario
Date Mon, 21 May 2018 09:34:00 GMT
Ravisankar Challa created JOHNZON-172:
-----------------------------------------

             Summary: JsonPatchBuilder issue for a partcuilar scenario
                 Key: JOHNZON-172
                 URL: https://issues.apache.org/jira/browse/JOHNZON-172
             Project: Johnzon
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.7
            Reporter: Ravisankar Challa


{code:java}
@Test
void test1() {
       JsonProvider json = JsonProvider.provider();
       JsonObject jsonObject = json.createReader(new StringReader("{" +
               "    \"request\" : {" +
               "        \"test\" : {}" +
               "    }" +
               "}")).readObject();
       JsonPatchBuilder patchBuilder = json.createPatchBuilder();
       JsonObject result = patchBuilder.add("/name", "ravi").build().apply(jsonObject);
       assertEquals("{\"request\":{\"test\":{}},\"name\":\"ravi\"}", result.toString());
       System.out.println(result.toString().equalsIgnoreCase(""));
       System.out.println(result);
    }
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message