-
Bug
-
Resolution: Done
-
Critical
-
8.0.0.GA-CR1, 8.0.0.GA-CR2
-
None
-
False
-
None
-
False
-
-
-
-
-
-
Known Issue
-
-
I have following JAX-RS resource (see attached file):
@Path("test") @ApplicationPath("rest") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public class DemoApplication extends Application { public record Data(String data) {} @GET @Path("short-record-response") public Response shortRecordR() { return Response.ok().entity(new Data("ok")).build(); } @GET @Path("short-record") public Data shortRecord() { return new Data("ok"); } }
I get a correct response with 8.0.0.Beta:
$ curl -X GET -H 'Accept: */*' -i 'http://localhost:8080/gezip-demo-1.0-SNAPSHOT/rest/test/short-record' HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 13 Date: Fri, 24 Nov 2023 15:13:56 GMT {"data":"ok"} $ curl -X GET -H 'Accept: */*' -i 'http://localhost:8080/gezip-demo-1.0-SNAPSHOT/rest/test/short-record-response' HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 13 Date: Fri, 24 Nov 2023 15:14:28 GMT {"data":"ok"}
However, serialization fails on 8.0.0.GA.CR2 and CR1:
$ curl -X GET -H 'Accept: */*' -i 'http://localhost:8080/gezip-demo-1.0-SNAPSHOT/rest/test/short-record-response' HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 2 Date: Fri, 24 Nov 2023 15:17:58 GMT {} $ curl -X GET -H 'Accept: */*' -i 'http://localhost:8080/gezip-demo-1.0-SNAPSHOT/rest/test/short-record' HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 2 Date: Fri, 24 Nov 2023 15:18:03 GMT {}
If I define simple container class for a string (with getter and setter) - see the attachment, it gets serialized correctly.
- is related to
-
JBEAP-25452 [GSS](7.4.z) fix resteasy / yasson issue with JDK17 record
- Closed