Your properties are private, so Jackson doesn’t serialize them I guess. They should be public.
t
thanksforallthefish
04/07/2021, 12:07 PM
the annotation is also wrong, you need
@field:JsonProperty
or
@get:JsonProperty
. though in your case it will not make a difference, since the property name you chose is the same of the field name
r
rajesh
04/07/2021, 12:54 PM
@jbnizet that worked. it store data as json "`{\"postId\":10000020,\"userId\":10000001}"` but when trying to access data, it throws
at [Source: (byte[])"{"postId":10000020,"userId":10000001}"; line: 1, column: 37]; nested exception is com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property '@class'