When I create a User defined class "Asset".
public class Asset {
private UUID id;
private String name;
}
And set an object of this class as a response.
@GetMapping("/testSerialization")
public Asset testSerialization() {
return new Asset()
}
This controller works successfully.
But when the same controller uses Geometry Types the request fails,
import com.vividsolutions.jts.geom.Point;
// Does not work
@GetMapping("/testSerialization")
public Point testSerialization() {
GeometryFactory geometryFactory = new GeometryFactory();
Point point = geometryFactory.createPoint(new Coordinate(1, 2));
return point;
}
I know that I have to add Serialization & De-Serialization references to Jackson, either manually or using a library like Jackson-datatype-jts, to enable Jackson to work with Geometry classes
My Question is, why do I have to do this explicitly for Geomtery types, whereas my Custom classes work without manipulating any configurations?