Skip to content

Provide MediaType to AbstractJacksonHttpMessageConverter.customizeReader #37094

Description

@OrangeDog

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions