Skip to content

Issue when jackson try to deserialize response classes #55

@felipelx07

Description

@felipelx07

I'm receive an error by Jackson when try to use Quarkus RestClient and response classes from this repository as mapped response of the client.
With this stacktrace error:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: cannot construct instance of ai.pluggy.client.response.AccountResponse (no creators, like default constructor, exist): cannot deserialize from object value (no delegate- or property-based creator) at [source: (org.jboss.resteasy.specimpl.AbstractBuiltResponse$InputStreamWrapper);

I suspect the error occur when Jackson try to deserialize the AccountsResponse, but the class don't have a default constructor.
As you can see from the master code, the class is annotated only with @Data & @Builder and not provide a default and empty constructor.

@Data
@Builder
public class AccountsResponse {

  List<Account> results;
}

When we map the class with @NoArgsConstructor & @AllArgsConstructor annotation of Lombok it's fixed.

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AccountsResponse {

  List<Account> results;
}

So, It's possible to include that annotations on all of response classes ?
I've already did it, if i can make a pull request just include me as a collaborator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions