79527550

Date: 2025-03-22 13:57:24
Score: 2.5
Natty:
Report link

There is an error in the JSON. Lists must be enclosed in square brackets [].

Assuming the JSON is correct and you have a Map<...> object, are you sure you need or want to use MapStruct?

MapStruct is typically used for converting between DTO classes (often even identical ones).

Libraries that make HTTP calls and receive a JSON response can usually convert it automatically into a specific class.

If you have to handle the response manually, you can map it to a class without using a Map by leveraging a library like Jackson.

So, let me ask: what is your situation? What method are you using for the HTTP call? Are you the one converting the server response from JSON to Java classes? Are you required to use MapStruct due to some specific requirement?

Keep in mind that Jackson can convert from Map<...> to a specific class as well.

Reasons:
  • Blacklisted phrase (1): what is your
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Pumahawk