Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuppressionList update endpoints throw com.google.gson.JsonSyntaxException #105

Open
jgh opened this issue Aug 12, 2021 · 0 comments
Open

Comments

@jgh
Copy link

jgh commented Aug 12, 2021

In com.sparkpost.resources.ResourceSuppressionList the insertOrUpdate methods do this:

        SupressionListResponse suppressionListResponse = (SupressionListResponse) SupressionListResponse.decode(response, SupressionListResponse.class);
        return suppressionListResponse;

but the api returns this:

{
    "results": {
        "message": "Suppression list successfully updated"
    }
}

so gson shits the bed

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 13 path $.results

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:932)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at com.sparkpost.model.responses.Response.decode(Response.java:47)
at com.sparkpost.resources.ResourceSuppressionList.insertOrUpdate(ResourceSuppressionList.java:32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant