I'm sending a User object through REST which contains a Set of SimpleGrantedAuthority
objects. On the receiver side, I'm getting an exception:
org.springframework.core.codec.DecodingException: JSON decoding error: Cannot construct instance of
org.springframework.security.core.authority.SimpleGrantedAuthority
(although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator);
I'm using the default JSON mapper which Spring Boot 2.1.2 provides. On the receiving side, I'm using WebFlux's WebClient (WebTestClient in this case).
Can anyone explain to me why am I getting this error and how to solve it?