Skip to content

API version can be lost when using media type parameters #37619

Closed as not planned

Description

@noojung

MediaTypeParamApiVersionResolver supports extracting an API version from Accept or Content-Type.

With the resolver configured for application/json and parameter version, this request resolves to null instead of "3":

Accept: */*
Content-Type: application/json;version=3

Removing Accept resolves the version correctly.

The resolver returns the parameter value from the first compatible Accept media type, even when that value is null. This prevents checking Content-Type. Both MVC and WebFlux are affected.

On the client side, ApiVersionInserter.useMediaTypeParam() adds the version only to an existing Content-Type. The default WebClient connector, Reactor Netty, adds Accept: */*, which triggers the server-side behavior above.

If Content-Type is absent, e.g. for a GET or DELETE request sent without that header, the inserter adds no version and does not write to Accept.

Expected behavior:

  • Fall back to Content-Type when no version is found in Accept.
  • Support client-side media type version insertion for requests without Content-Type.

Related Issue:

Activity

  1. added
    status: waiting-for-triage
    on Oct 31, 2026
  2. self-assigned this
    on Nov 11, 2026
  3. added
    in: web
    type: enhancement
    status: superseded
    and removed
    status: waiting-for-triage
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webstatus: supersededtype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions