|
JSON > Owlike > How to exclude a property from Json Serialization |
|
How to exclude a property from Json Serialization
Author: Venkata Sudhakar
We can customize serialization & deserialization process using com.owlike.genson.annotation.JsonIgnore. This annotation can be applied to both fields and methods. By default it execludes the annotated methods & fields from the serialization & deserialization process. This can be further customized by using serialize and deserialize flags. In the below example password field will be deserialized but not serialized. Using JsonIgnore(serialize=true, deserialize=true) will effectively have no effect.
|
|