I am implementing a CSV message converter by extending AbstractJacksonHttpMessageConverter.
While customizerWriter supplies the target MediaType, customizeReader does not supply the source MediaType.
As a result, I cannot check the "header" parameter to decide the value for CsvSchema.withUseHeader.
A new extension point could be added without breaking anything:
protected ObjectReader customizeReader(
ObjectReader reader, JavaType javaType, @Nullable MediaType contentType) {
return customizeReader(reader, javaType);
}
This could also be of general use for other formats, as media types such as application/x-my-thing+json are commonly used, and knowing the base type may be useful in configuring a reader.
I am implementing a CSV message converter by extending
AbstractJacksonHttpMessageConverter.While
customizerWritersupplies the targetMediaType,customizeReaderdoes not supply the sourceMediaType.As a result, I cannot check the "header" parameter to decide the value for
CsvSchema.withUseHeader.A new extension point could be added without breaking anything:
This could also be of general use for other formats, as media types such as
application/x-my-thing+jsonare commonly used, and knowing the base type may be useful in configuring a reader.