Wiem, że Java 14 jeszcze nie wyszła i jest dostępna tylko jako EAP, ale moze jest sposób żeby używać recordy w controllerach Springowych?
@GetMapping
List<MyRecord> getRecords() {
return List.of(new MyRecord(1L, "test", "test"));
}
public record MyRecord(Long id, String content, String answer) {
}
Obecnie strzał pod ten endpoint powoduje
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.example.MyRecord and no properties discovered to create BeanSerializer