Wire gson adapter cannot serialize an object with a Message field
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
If an object has a Message as a field attempting to serialize will fail with
java.lang.IllegalArgumentException: failed to access com.squareup.wire.Message#ADAPTER
coming out of ProtoAdapter.kt:215
Example failing class:
class LedgerEntry {
final Message details;
// ...
}
Failure was in java source but presumably the same would happen with .kt
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at ProtoAdapter.kt:215 and reproduce the failure with a Java class containing a Message field, such as the LedgerEntry example. Trace why serialization attempts to access Message#ADAPTER, then verify that the example serializes without the reported IllegalArgumentException and add coverage for the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100