Support for java.util.Optional
Open
enhancement
java8
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
Usually, when I use Gson, I need to add special logic so that a field of `Optional` gets serialized as `X` if it's present, and gets omitted if it's empty; and conversely on deserialization. This seems like the only reasonable way to handle `Optional`. Would you consider offering this feature (or accepting a PR that implements it)?
Contributor guide
Assessment
This issue has not been assessed yet.