Hi All,
I wanted to include/ignore bean properties dynamically based requested Rest
API version during serialization and deserialization. But I am not able to
do it as jackon caching the DTO/model properties after first serialization.
When I tried using BeanSerializationModifier/BeanDeSerializationModifier
it works for first request (Ser/Deserialiation) and it returns same data in
subsequent calls.
Any suggestion/Help would be highly appreciated.
Example : Below DTO mapped to either my REST post request or GET call
response.
MyDTO
{
String nameV1;
Sting nameV2;
String nameV3
....
}
Case 1. If user uses API version=1 then in rest call should accept nameV1
parameter in json body and it should bind it and if user passes nameV2 or
nameV3 should throw binding exception. Also if user makes get call i
should see only nameV1 only and it should ignore other name parameters.
Case 2. If user uses API version=2 then in rest call should accept nameV1,
nameV2 parameter in json body and it should bind it and if user passes
nameV3 should throw binding exception. Also if user makes get call i
should see only nameV1 and V2 only and it should ignore other name
parameters.
...
Thanks
Prakash
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.