title: UnrecognizedPropertyException: Unrecognized field "code" in Android
body: <p>I want to return an Value from Jsonutil code by using ObjectMapper but data not reflect</p>
  
  <p>I am using Model from which I reflect an decription value and want to add in Spinner</p>
  
  <p>I am having this error:</p>
  
  <pre><code> V/Status code: 201
  04-18 01:56:01.666 7130-7799/vems.visioneering.com.vems V/RESPONSE SERVER COMM :: [{"primaryKey":1,"code":"C1","description":"Class I","isActive":true},{"primaryKey":2,"code":"C2","description":"Class II","isActive":true},{"primaryKey":3,"code":"C3","description":"Class III","isActive":true},{"primaryKey":4,"code":"C4","description":"Class IV","isActive":true},{"primaryKey":5,"code":"C5","description":"Class V","isActive":true},{"primaryKey":6,"code":"C6","description":"Class VI","isActive":true},{"primaryKey":7,"code":"C7","description":"Class VII","isActive":true},{"primaryKey":8,"code":"C8","description":"Class VIII","isActive":true},{"primaryKey":9,"code":"C9","description":"Class IX","isActive":true},{"primaryKey":10,"code":"C10","description":"Class X","isActive":true},{"primaryKey":11,"code":"C11","description":"Class XI","isActive":true},{"primaryKey":12,"code":"C12","description":"Class XII","isActive":true}]
  04-18 01:56:01.666 7130-7130/vems.visioneering.com.vems V/Util Data: {"primaryKey":1,"code":"C1","description":"Class I","isActive":true}
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "code" (class vems.visioneering.com.vems.Model.LKClassData), not marked as ignorable (2 known properties: "description", "primaryKey"])
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at [Source: {"primaryKey":1,"code":"C1","description":"Class I","isActive":true}; line: 1, column: 25] (through reference chain: vems.visioneering.com.vems.Model.LKClassData["code"])
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:817)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:958)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1324)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1302)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:249)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:136)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3562)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2578)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at vems.visioneering.com.vems.utils.JSonUtil.jsonToObject(JSonUtil.java:86)
  04-18 01:56:01.667 7130-7130/vems.visioneering.com.vems W/System.err:     at vems.visioneering.com.vems.fragments.AttendanceFragment.onCreateView(AttendanceFragment.java:94)
  </code></pre>
  
  <p>My Java Code is used to get Spinner data:</p>
  
  <pre><code>try{
               JSONObject msgJSON = new JSONObject();
               msgJSON.put("objName", "LKClass");
               SharedPreferences sharedPref = context.getSharedPreferences
                       (ApplicationUtils.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
               if (ApplicationUtils.BASE_URL == null) {
                   String response = VEMSServices.getInstance(context).getResponseData(msgJSON.toString(), ApplicationUtils.GET_OBJECT);
                   JSONArray jsonArray = new JSONArray(response);
                   final ArrayList&lt;LKClassData&gt; spn = new ArrayList&lt;&gt;();
                   for (int i = 0; i &lt; jsonArray.length(); i++) {
                       spn.add((LKClassData) JSonUtil.jsonToObject(jsonArray.getString(i), LKClassData.class));
  
                       Log.v("Check Value",spn.toString());
                       //JSONObject jsonObject = jsonArray.getJSONObject(i);
                       //spn.add(new LKClassData(jsonObject.getString("description"), jsonObject.getString("primaryKey")));
                   }
                   vSpinner = new VisioneeringSpinner(context);
                   vSpinner.getSpinner(R.id.spinner_stu_Attendance_Class, spn, this.getActivity());
  </code></pre>
  
  <p>My JsonUtil Class Code is:</p>
  
  <pre><code> public static Object jsonToObject(String jsonData, Class&lt;?&gt; clazz) {
          Log.v("Util Data",jsonData);
          try {
              return mapperObj.readValue(jsonData, clazz);
          } catch (IOException e) {
              e.printStackTrace();
          }
          return null;
      }
  </code></pre>
  
  <p>My Model Class data:</p>
  
  <pre><code>public class LKClassData {
  
  
      public String description;
      public String primaryKey;
  
      @Override
      public String toString() {
          return description;
      }
  }
  </code></pre>