javaee / json-processing-spec

Legacy JSON Processing spec. Please use the link below to find the current JSON P project
https://github.com/jakartaee/jsonp-api
Other
8 stars 3 forks source link

Json#createMergePatch should take a JsonStructure and not a JsonValue #89

Closed glassfishrobot closed 7 years ago

glassfishrobot commented 7 years ago

Currently the Json method for creating a MergePatch takes a JsonValue. But I can hardly think of a JSON MergePatch which just consists of a single int, String etc. See http://tools.ietf.org/html/rfc7396

public static JsonMergePatch createMergePatch(JsonValue patch)

should imo be

public static JsonMergePatch createMergePatch(JsonObject patch)

As far as I interpret the JSON RFC it is not even possible to have a JSON-Array as patch

Also, it is not possible to patch part of a target that is not an object, such as to replace just some of the values in an array.

Is this interpretation correct?

If not we could go for a JsonStructure param.

Affected Versions

[1.0-pr]

glassfishrobot commented 7 years ago

Reported by struberg

glassfishrobot commented 7 years ago

struberg said: Most probably JsonValue is even correct. If read through RFC-7396 again with Reinhard and we found the following sample data:

Unknown macro: {"a"}

"bar" "bar"

So this replaces a whole JsonObject with just the "bar" JsonValue.

Please close this ticket as illegal.

glassfishrobot commented 7 years ago

@m0mus said: It easily can be a JaonValue. I see that you realized it as well. Closing.

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JSON_PROCESSING_SPEC-89

glassfishrobot commented 7 years ago

Marked as won't fix on Monday, February 27th 2017, 12:33:08 pm