79218201

Date: 2024-11-23 15:35:28
Score: 1.5
Natty:
Report link

Ok, after debugging the request following this blog it turned out that the parameters were being sent as a string "parameters":"{\"par1\":\"par2\"}" not matching the jsonb format.

I just changed the declaration of parameters in ProductFormDTO from

private Map<String, String> parameters;

to

private String parameters;

and deserialized it using ObjectMapper in ProductFormToProductEntity mapper

ObjectMapper objectMapper = new ObjectMapper();
productEntity.setParameters(objectMapper.readValue(productFormDTO.getParameters(), new TypeReference<Map<String, String>>() {}));
Reasons:
  • Blacklisted phrase (1): this blog
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: lordlaurent