I implemented a rest controller in my SpringBoot backend, which receives a json and maps it to an dto object via SpringBoots default Jackson configuration:
So we got:
The Rescontroller signed like that:
public ResponseEntity<Void> pushMyDTO(@RequestBody MyDTO myDTO) {...}
The MyDTO Object :
@JsonInclude(JsonInclude.Include.NON_NULL)
public record MyDTO(int a, double b, double c, Map<String, List<MyObject>> myList) {}
And last but not least the MyObject:
public class MyObject{
private double[] myArray = new double[2];
private double a = 0;
...
}
I allready read the incoming json stream before Jackson touches it and it contains everything perfectly.
BUT:
After the Mapping Json --> MyDTO, the doubles in MyObject.myArray are all 0. The rest is fine. Those are the only attributes jackson isnt able to map somehow.
Im thankfull for every advice :)