79697840

Date: 2025-07-11 04:53:00
Score: 1
Natty:
Report link

Your Scontrino Class Contain LocalDateTime and Map<Aritcolo,Integer> with jackson the josan serializer used by springboot can not deserielised properly out of the box without help espically Map<Articolo,Integer> using entity as key

Using Long and String as a key

and refoctor your qulita to DTO's like

class AritcoloQualita{

private long aritcoloId;

private int qualita;

}

add jaskon datatype

<dependency>

<groupId >com.fasterxml.json.datatype</grouId>

<artifactId>json-datatype-jsr-310</artifacrId>

</groupId>

public Jackson20ObjectMapperBuilderCustomer jsonCustomer(){

return builder-> builder.modules(new JavaTimeModules)}

class scontrioRequestDTO{private LocalDateTime data ,

private Map<Long ,Integer> quantita}

public Scontrino cre(@RequestBody ScontrinoRequestDto dto){return Sentrio Service.cre(dto)}

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: tanya