When I prepared my example project: https://github.com/hantsy/jakartaee11-starter-boilerplate
I encountered an issue with the latest Payara community version: it cannot serialize/deserialize DateTime Instant as expected because it uses Jackson 2 by default in REST and refuses to include the Jackson JSR310 module. https://github.com/hantsy/jakartaee11-starter-boilerplate/actions/runs/23273748402/job/67672079972?pr=125#step:4:22128
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
Java 8 date/time type `java.time.Instant` not supported by default:
add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
to enable handling (or disable `MapperFeature.REQUIRE_HANDLERS_FOR_JAVA8_TIMES`)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled);
line: 1, column: 15] (through reference chain: java.util.ArrayList[0]->com.example.domain.Todo["createdAt"])
(I have reported this to Payara, but got the answer I have to add Jackson jsr310 myself, but Java 8 DateTime is a support feature in Jakarta EE for a long time, it should cover all specs.)
On Glassfish v8, it could use JSONB to do this(there is no such an problem).
I want to ask:
- Does the REST spec require JSONB/JSONP to serialize/deserialize JSON data?
- If not, is there a list of the supported types (aka the
Instant here) in the spec/TCK to ensure alignment with JSONB and other specs to smooth the developer's experience?
When I prepared my example project: https://github.com/hantsy/jakartaee11-starter-boilerplate
I encountered an issue with the latest Payara community version: it cannot serialize/deserialize DateTime
Instantas expected because it uses Jackson 2 by default in REST and refuses to include the Jackson JSR310 module. https://github.com/hantsy/jakartaee11-starter-boilerplate/actions/runs/23273748402/job/67672079972?pr=125#step:4:22128(I have reported this to Payara, but got the answer I have to add Jackson jsr310 myself, but Java 8 DateTime is a support feature in Jakarta EE for a long time, it should cover all specs.)
On Glassfish v8, it could use JSONB to do this(there is no such an problem).
I want to ask:
Instanthere) in the spec/TCK to ensure alignment with JSONB and other specs to smooth the developer's experience?