You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the right approach to exclude certain objects being serialized based on condition.
For example, when I serializing User, User has both pubic and private Posts. In a public context, I don't want private posts to be exposed. How should I prevent private posts from serialization?
I need to do something like the following. I know that the usage of @Exclude is not right, but just to illustrate the point.
What is the right approach to exclude certain objects being serialized based on condition.
For example, when I serializing
User
,User
has both pubic and privatePosts
. In a public context, I don't want private posts to be exposed. How should I prevent private posts from serialization?I need to do something like the following. I know that the usage of
@Exclude
is not right, but just to illustrate the point.The text was updated successfully, but these errors were encountered: