How can I property output for application/x-ndjson

Viewed 462
@GetMapping(produces = {
        MediaType.APPLICATION_JSON_VALUE,
        MediaType.APPLICATION_NDJSON_VALUE
})
public Flux<Some> read() {
}

When I curl with --header 'Accept: application/x-ndjson'

The outer array is gone but all new lines in each elements is not gone.

{
  "some": "thing"
}
{
  "some": "other"
}

How can I make them as single-line as possible?

0 Answers
Related