Skip to content

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

@jgh

Description

@jgh

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)

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