Hello,
<https://stackoverflow.com/posts/71821629/timeline>

I am trying to parse a CSV and serialize it using the Jackson library. I 
have tried several methods but can't get to ignore the extra columns in the 
CSV which are not defined in the POJO. The CSV comes in realtime from a 
server. 

Requirements:

   1. The columns in the incoming CSV can be in any order.
   2. There can be some columns which are defined in POJO but not there in 
   CSV (missing columns).
   3. There can be some columns in the CSV which are not defined in POJO 
   (extra columns at any index).

I have already tried @JsonIgnoreProperties(true) and also tried to 
use DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES but nothing seems to 
work properly.

POJO:
public class student{ 
  @JsonProperty("STUDENT_NAME") 
  private String name; 
  @JsonProperty("DOB") 
  private String dateOfBirth; 
  @JsonProperty("ID") 
  private String id; 
} 

CSV:
STUDENT_NAME,ID,STANDARD,DOB 
John,1,4,01/02/2000 
Doe,2,5,02/01/1999

Please let me know how I can get all the above 3 requirements fulfilled. 

Thanks, 
Shubham   

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/60d2b4e3-bb36-4edd-9386-a01d26046bbfn%40googlegroups.com.

Reply via email to