Skip to content

Can not construct instance of com.stripe.model.StripeObject #450

@mjain1990

Description

@mjain1990

I am using spring boot with jackson. I am trying to configure a webhook resource and expecting Event Object as request body. But when I get a webhook call my resource reject that request with 400 because jackson is not able to bind it. What it says is

Can not construct instance of com.stripe.model.StripeObject: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
 at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@626f4396; line: 7, column: 15] (through reference chain: com.stripe.model.Event["data"]->com.stripe.model.EventData["object"])

I searched for its solution and it says to add JsonTypeInfo on StripeObject. I don't want to create a another class in my own project for the same. Is there something which I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions