We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
application/json-patch+json
Add support for application/json-patch+json media type.
n/a
The text was updated successfully, but these errors were encountered:
This is do-able with JSON-P.
@Path("/patch") public class JsonPatchResource { private static final JsonProvider JSON_PROVIDER = JsonProvider.provider(); private JsonObject jsonObject = JsonValue.EMPTY_JSON_OBJECT; @GET public JsonObject get() { return jsonObject; } @PUT public void put(JsonObject jsonObject) { this.jsonObject = jsonObject; } @Consumes("application/json-patch+json") @POST public void patch(JsonArray operations) { JsonPatch patch = JSON_PROVIDER.createPatch(operations); this.jsonObject = patch.apply(jsonObject); } }
# verify the empty initial state curl http://localhost:8080/patch {} # set the object curl -X PUT -H "Content-Type: application/json" http://localhost:8080/patch -d '{"foo": "bar"}' # verify the object curl http://localhost:8080/patch {"foo":"bar"} # patch the object curl -X POST -H "Content-Type: application/json-patch+json" http://localhost:8080/patch -d '[ {"op":"replace","path":"/foo","value": "123"} ]' # verify the result curl http://localhost:8080/patch {"foo":"123"}
We should double-check if this also works with Helidon SE. If this works, we should create examples for both.
Sorry, something went wrong.
tvallin
No branches or pull requests
Environment Details
Problem Description
Add support for
application/json-patch+json
media type.Steps to reproduce
n/a
The text was updated successfully, but these errors were encountered: