slackapi / slackapi/java-slack-sdk

Deserialization issue with slack sdk with message attachments

Open
#1,465 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triage-skip bug needs info project:slack-api-model
Dominant language
Java
Stars
602
Forks
232
Avg merge
4d 9h
Merged PRs (30d)
7

Description

Noticed this with one of our customers:

j.l.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 265032 path $.messages[115].attachments[0].list_records[0].fields[1].message See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure at c.g.g.s.JsonReader.unexpectedTokenError(JsonReader.java:1768) at c.g.g.s.JsonReader.beginObject(JsonReader.java:469) at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:509) ... 43 common frames omitted Wrapped by: c.g.g.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 265032 path $.messages[115].attachments[0].list_records[0].fields[1].message See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520) at c.g.g.Gson$FutureTypeAdapter.read(Gson.java:1516) at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267) at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558) at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:516) at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59) at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267) at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558) at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:516) at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace and the JSON path $.messages[115].attachments[0].list_records[0].fields[1].message, then inspect the SDK's attachment deserialization entry point. Reproduce the customer payload and determine the expected shape for that field; done means the payload deserializes without the reported BEGIN_OBJECT/BEGIN_ARRAY error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.