FasterXML / FasterXML/jackson-dataformats-text

CSV Schema map headers to Pojo

Ouverte
#26 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
csv
Langage dominant
Java
Étoiles
455
Forks
164
Merge moyen
6 j 10 h
PR mergées (30 j)
2

Description

Hi,

There is a use case where we know the CSV column names but not the order.
It would be great if there was a way to map headers in the CSV to POJO properties.

Something like:
```
Map csvHeaders = new HashMap();
csvHeaders.put("headerX", "propertyX");
csvHeaders.put("headerY", "propertyY");
CsvSchema bootstrapSchema = CsvSchema.emptySchema().withHeaderMap(csvHeaders);
...
```

Possibly with an option to either ignore extra columns or throw an error if there are missing columns.

Does anyone know if this is possible/likely?

Thanks for a great library.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.