blackdog
blackdog

Reputation: 2107

How to ignore params when `parseObject` in fastjson?

I use the fastjson to deal with the JSON. When I was trying to derialize the JSON string to a bean, I got an exception. I debuged into the code and find out there was something wrong with a param when deserializeing. So I wanna ignore it. I used the method parseObject

public static <T> T parseObject(String text, Class<T> class)

I tried the transient but it didn't work.

Upvotes: 1

Views: 2397

Answers (1)

blackdog
blackdog

Reputation: 2107

@JSONField(serialize = false) can fix it

Upvotes: 0

Related Questions