FasterXML / FasterXML/jackson-dataformats-text

Async (non-blocking) support for CSV

Ouverte
#287 8 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

This question relates to usage of Jackson DataFormats CSV within Spring WebFlux.

I have a REST controller (Spring WebFlux) which returns a Flux from a Stream of a simple bean (MapInfo). The endpoint serves application/json (only for demo) and application/x-ndjson (for large datasets). I'd like to add support for text/csv also.

```
@GetMapping(produces = { "application/json", "application/x-ndjson", "text/csv" })
public Flux mapInfo() {
return Flux.fromStream(mapInfoStream());
}
```

Invoking this for text/csv results in HTTP 500 with message:
`"No Encoder for [com.mizuho.fo.dataservices.hc.controller.MapInfoController$MapInfo] with preset Content-Type 'null'"`

**I have not yet added any Jackson Dataformat libraries so this is expected.**

Question: Does Jackson Dataformat CSV have the necessary non-blocking support in order for it to be used to convert the payload to CSV?

Of course I could be imperative and write code to format as CSV, returning a Flux of String for instance, but my hope is to effect CSV output without lowering the abstraction level beyond what is already there (returning a Flux from a Stream of the POJO).

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.