geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1784811 - /geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java
Date Tue, 28 Feb 2017 20:51:13 GMT
Author: struberg
Date: Tue Feb 28 20:51:12 2017
New Revision: 1784811

URL: http://svn.apache.org/viewvc?rev=1784811&view=rev
Log:
GERONIMO-6558 improve JsonMergePatch JavaDoc

Modified:
    geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java

Modified: geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java?rev=1784811&r1=1784810&r2=1784811&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java (original)
+++ geronimo/specs/trunk/geronimo-json_1.1_spec/src/main/java/javax/json/Json.java Tue Feb
28 20:51:12 2017
@@ -210,7 +210,31 @@ public final class Json {
 
     /**
      * Creates JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC 7396</a>)
-     * from specified {@code JsonValue}.
+     * from a specified {@link JsonValue}.
+     * Create a merged patch by comparing the source to the target.
+     *
+     * Applying this JsonPatch to the source will give you the target.
+     *
+     * If you have a JSON like
+     * <pre>
+     * {
+     *   "a": "b",
+     *   "c": {
+     *     "d": "e",
+     *     "f": "g"
+     *   }
+     * }
+     * </pre>
+     *
+     * Then you can change the value of "a" and removing "f" by sending:
+     * <pre>
+     * {
+     *   "a":"z",
+     *   "c": {
+     *     "f": null
+     *   }
+     * }
+     * </pre>
      *
      * @param patch the patch
      * @return a JSON Merge Patch
@@ -222,9 +246,32 @@ public final class Json {
     }
 
     /**
-     * Generates a JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC
7396</a>)
-     * from the source and target {@code JsonValue}s
-     * which when applied to the {@code source}, yields the {@code target}.
+     * Create a JSON Merge Patch (<a href="http://tools.ietf.org/html/rfc7396">RFC
7396</a>)
+     * from the source and target {@link JsonValue JsonValues}.
+     * Create a merged patch by comparing the source to the target.
+     *
+     * Applying this JsonPatch to the source will give you the target.
+     *
+     * If you have a JSON like
+     * <pre>
+     * {
+     *   "a": "b",
+     *   "c": {
+     *     "d": "e",
+     *     "f": "g"
+     *   }
+     * }
+     * </pre>
+     *
+     * Then you can change the value of "a" and removing "f" by sending:
+     * <pre>
+     * {
+     *   "a":"z",
+     *   "c": {
+     *     "f": null
+     *   }
+     * }
+     * </pre>
      *
      * @param source the source
      * @param target the target



Mime
View raw message