clerk / clerk-sdk-java

6 stars 5 forks source link

JsonMappingException: Deserialization Issue with JSON Type References in Verification.TypedObject #17

Closed bollus closed 1 day ago

bollus commented 2 weeks ago

Description

I encountered a when calling . After debugging, I traced the issue to the deserialization of a JSON object into using . The JSON input did not match any of the possible type references defined. Here are the details:JsonMappingExceptionsdk.users().get("user_id")private Verification.TypedObjectmapper.readValue()

java.lang.RuntimeException: ↴
    -> com.fasterxml.jackson.databind.JsonMappingException: ↴
        -> json did not match any of the possible type references: [com.clerk.backend_api.models.components.Otp, com.clerk.backend_api.models.components.Admin, com.clerk.backend_api.models.components.Oauth], 
json={"status":"verified","strategy":"from_oauth_google","attempts":null,"expire_at":null} 
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 753] (through reference chain: com.clerk.backend_api.models.components.User["email_addresses"]->java.util.ArrayList[0]->com.clerk.backend_api.models.components.EmailAddress["verification"])**

Additional Information:

The issue occurred at com.clerk.backend_api.utils.OneOfDeserializer [deserializeOneOf] line: 73, column: 39

bollus commented 2 weeks ago

has been fixed #19

simplesagar commented 2 weeks ago

Thanks for the proposal ! We'll take a look at that PR. We plan to address this in the next release v0.3.0-beta .

bollus commented 1 week ago

Thanks for the proposal ! We'll take a look at that PR. We plan to address this in the next release .v0.3.0-beta

great~ thx

simplesagar commented 1 day ago

Hey @bollus could you try out https://github.com/clerk/clerk-sdk-java/releases/tag/v0.2.0-beta.1 . It will be available on Maven Central shortly.

bollus commented 1 day ago

Hi @simplesagar I tried this, it's worked! thx so much