Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17617

MVC @RequestHeader value is ignored

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Investigating
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.1.2
    • Fix Version/s: None
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      org.springframework.web.servlet.mvc.method.annotation.RequestHeaderMethodArgumentResolver creates RequestHeaderNamedValueInfo information from annotation using only name value of RequestHeader annotation.

      In generated codes for example swagger codegen 3, only the value attribute is filled, and because of that in the rest interace the name of the method argument will be used, that is might be different than the name (or value) of the RequestHeader annotation.

      For example:

      @RequestHeader(value = "Consent-ID",required = false) String consentId

       

      Name attribute of annotation is not filled, because of that method argument name consentId will be used, and won't found among the http request headers.

       

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            zsenyeg zsenyeg
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              3 years, 24 weeks, 4 days ago