@DoNotExpose Annotation
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
I was wondering why not include an annotation that allows the exclusion of only a single field or just few fields while serialization.
Example:
`Class Test{
String s1;
String s2;
String s3;
String s4;
}`
If I want to avoid serializing s1 and want to expose the other fields then it currently would look like :
`Class Test{
String s1;
@Expose String s2;
@Expose String s3;
@Expose String s4;
}`
But, I think it would be way more easier to have it the following :
`Class Test{
**@DoNotExpose** String s1;
String s2;
String s3;
String s4;
}`
Can someone please tell if there is a reason for not having this annotation or if there is a cleaner workaround for this available already, as we have a case where we want to avoid serializing a single heavy reference in classes and still expose the other fields.
Contributor guide
Assessment
This issue has not been assessed yet.