@Expose(serialize=true, deserialize=true) ignored for transient fields
Open
bug
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
Even when setting a field explicitly as exposed,
it is not serialized/deserialized for gson if it is transient.
The @Expose annotation should have precedence over the excludeFieldsWithModifiers()-rule.
Not the other way around.
This behavior makes certain combinations with Java Serialisation impossible.
The workaround of GsonBuilder().excludeFieldsWithModifiers(Modifier.STATIC)
is a global modification of how Gson behaves and thus has side effects for unrelated fields.
Contributor guide
Assessment
This issue has not been assessed yet.