java - com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize out of START_ARRAY token -


i'm getting start_array error following model. i'm expecting object of inputdetails

class inputdetails{   public list<eachfielddetails> fielddetails; }  class eachfielddetails{   public string fieldname;   public string value; } 

json input follows:

[{"fieldname":"sitename","value":"warehouse"},{"fieldname":"ponumber","value":"po1"},{"fieldname":"itemcode","value":"itemcode1"},{"fieldname":"asdnserialno","value":"null"}] 

can provide me solution.

here class

public response setwhdetails(@beanparam requestbean requestbean,inputdetails saveinputs) {    //do operation    } 

your json specifies array while you're trying deserialize object.

if json like:

{     "fielddetails" : [         {"fieldname":"sitename","value":"warehouse"},         {"fieldname":"ponumber","value":"po1"},         {"fieldname":"itemcode","value":"itemcode1"},         {"fieldname":"asdnserialno","value":"null"}     ] } 

it probably work. alternately, deserialize directly array.

i probably because haven't provided code or information of tool or library you're using handle deserialization process.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -