0

I have 2 microservices: gateway and another, which are connect with Feign.

When i do request directly to my microservice i have normal response. But if i do it with gateway i have exception:

Type definition error: [simple type, class FieldsDTO]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `FieldsDTO` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

This is my DTO class:

@Data
@NoArgsConstructor
@AllArgsConstructor
public class FieldsDTO {
    private Set<String> fieldNames;
    private List<ShortFiledsDTO> dataList;
}

Are there some thoughts how to fix it?

UPD: ANSWER:

Definitely, you must to create default constructor, but i forgot to update model's version

Krazim00da
  • 307
  • 1
  • 5
  • 14

0 Answers0