-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
The StudentPatchTest.testPatchDisabled fails on Yasson 3.0.0. The test part the fails looks like this:
jakarta.json.JsonArray patchRequest = Json.createArrayBuilder() .add(Json.createObjectBuilder().add("op", "copy").add("from", "/firstName").add("path", "/lastName").build()) .add(Json.createObjectBuilder().add("op", "replace").add("path", "/firstName").add("value", "John").build()) .build(); Response res = patchTarget.request().build(HttpMethod.PATCH, Entity.entity(patchRequest, MediaType.APPLICATION_JSON_PATCH_JSON)).invoke(); Assert.assertEquals("Http 400 is expected", 400, res.getStatus());
On Yasson 2.x it throws the following exception which is the cause of the 400.
jakarta.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: jakarta.json.bind.JsonbException: Can't deserialize JSON array into: class org.jboss.resteasy.test.resource.patch.Student
The entity value for the above exception is:
[{"op":"copy","from":"/firstName","path":"/lastName"},{"op":"replace","path":"/firstName","value":"John"}]
With WildFly 27 where Yasson is 3.0, the result is a 200 with an empty entity {}. The difference needs to be examined. Yasson creates a new Student with all null values.
I'm not sure I follow why it would be different though. The Jakarta JSON Binding 3.0 spec says the same thing.
The test itself might be a bit wrong TBH. I don't really know why a 400 would be expected. The patching is disabled in the deployments test. However, it looks like that should just FilterFlag.SKIP is returned which should just skip the filter.
I guess I'd really expect 200 to be correct, but I don't really know what the entity should be.