FasterXML / FasterXML/jackson-dataformats-text

CSV Schema map headers to Pojo

Abierto
#26 0 comentarios 1 reacción 0 asignados Ver en GitHub
csv
Lenguaje dominante
Java
Estrellas
455
Forks
164
Merge medio
6 d 10 h
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.