Affects: 5.3.18


Within my project, almost all endpoints receive the user-agent header like so:

@RequestHeader("User-Agent", defaultValue = "") userAgent: String,

I would like to reduce this declaration to the following:

@UserAgentHeader userAgent: String,

I think handler methods support meta annotations (via reading the docs of org.springframework.core.annotation.SynthesizingMethodParameter) but the annotations (RequestParam, RequestHeader etc) have an annotation target of only PARAMETER so cannot be used as meta annotations.

Comment From: sbrannen

Closing as a duplicate of #21829.