jackson - JSON copy same property to child nodes -


i have pojo structure similar below,

public class {     private int val1;     private string createdby;     private b bobj;     .     .     // getters , setters plus more fields  }  public class b {     private int val2;     private string val3;     private string createdby;     .     .     // getters , setters plus more fields } 

input json this

{     "createdby": "user_1",     "val1" : 1,     "bobj" : {         "val2" : 2,         "val3" : "3",         "createdby" : "user_1"     } } 

i want reuse createdby root class a inside bobj without having have client send same value in child nodes.

extend beandeserializer call super in deserialize , maniplations need there. register deserialzer using simplemodule.

i not sure if there other direct way so.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -