users@jax-rs-spec.java.net

[jax-rs-spec users] Re: JSON PROCESSING (JSR 374) adaption

From: Alex Soto <asotobu_at_gmail.com>
Date: Wed, 04 Nov 2015 09:20:45 +0000

Sure:
https://java.net/projects/jsonp/sources/git/content/api/src/main/java/javax/json/JsonPatch.java?rev=b56276c54a512baafe7f582c847705e61a9df369


I think you need to use the constructor with JsonArray. In fact since a
PATCH document is a JsonArray, you only need to read the payload, convert
it as JsonArray and instantiate the JsonPatch object. For any question
don't hesitate to contact me.

Alex.

El dt., 3 nov. 2015 a les 17:56, Santiago Pericasgeertsen (<
santiago.pericasgeertsen_at_oracle.com>) va escriure:

> Hi Alex,
>
> It seems reasonable. Could you provide a link with more info about the
> JsonPatch type?
>
> — Santiago
>
> On Nov 3, 2015, at 5:09 AM, Alex Soto <asotobu_at_gmail.com> wrote:
>
> Hi Experts, this is Alex, member of expert group Json Processing API (JSR
> 374).
>
> In next release of JSR 374 there are some things that I think JAXRS spec
> should cover so we can have a tight integration between specs. At the end
> is about the support we have implemented about JSON PATCH (
> http://jsonpatch.com/).
>
> I suggest that:
>
> 1. @PATCH annotation should be provided as it is provided for GET,
> POST, ...
> 2. A new MediaType should be added. Concretely
> application/json-patch+json
> 3. Permit that users can do:
>
> @PATCH
> @Consumes(MediaType.PATCH)
> public Response applyPatch(JsonPatch patch, ....){}
>
> Basically that if method is annotated with PATCH and consumes PATCH then
> you know that the content is going to be a JsonPatch element on the body of
> the message so JAXRS can construct the object for the user in similar way
> as it happens with JsonObject or JsonArray.
>
> WDYT?
>
> Alex.
>
>
>