title: openapi-generator doesn't generate response headers for Java client using Spring Webclient
body: <p>We have an openapi file (validated) that declares response headers, e.g.</p>
  <pre><code>    &quot;responses&quot;: {
        &quot;200&quot;: {
          &quot;description&quot;: &quot;OK&quot;,
          &quot;schema&quot;: {
            &quot;type&quot;: &quot;object&quot;,
            &quot;properties&quot;: {
              &quot;results&quot;: {
                &quot;type&quot;: &quot;array&quot;,
                &quot;items&quot;: {
                  &quot;$ref&quot;: &quot;#/definitions/CourseV2&quot;
                }
              },
              &quot;paging&quot;: {
                &quot;$ref&quot;: &quot;#/definitions/PagingInfo&quot;
              }
            },
            &quot;required&quot;: [
              &quot;results&quot;
            ]
          },
          &quot;headers&quot;: {
                &quot;X-RateLimit-Limit&quot;: {
                  &quot;type&quot;: &quot;integer&quot;,
                  &quot;description&quot;: &quot;Request limit per hour.&quot;
                },
                &quot;X-RateLimit-Remaining&quot;: {
                  &quot;type&quot;: &quot;integer&quot;,
                  &quot;description&quot;: &quot;The number of requests left for the time window.&quot;
                },
                &quot;X-RateLimit-Reset&quot;: {
                  &quot;type&quot;: &quot;string&quot;,
                  &quot;format&quot;: &quot;date-time&quot;,
                  &quot;description&quot;: &quot;The UTC date/time at which the current rate limit window resets.&quot;
                }              
            }           
        },
  </code></pre>
  <p>Using java webclient client generated by <a href="https://github.com/OpenAPITools/openapi-generator" rel="nofollow noreferrer">openapi-generator</a> project (maven or cli,), the return type of the invocations are not including response headers, nor the invokeAPI methods in ApiClient class does give access to the response headers.
  Indeed the ApiClient invoke methods are returning a Mono/Flux of the return type, thus no permitting to get response headers</p>
  <pre><code>public &lt;T&gt; Mono&lt;T&gt; invokeAPI(String path, HttpMethod method, Map&lt;String, Object&gt; pathParams, MultiValueMap&lt;String, String&gt; queryParams, Object body, HttpHeaders headerParams, MultiValueMap&lt;String, String&gt; cookieParams, MultiValueMap&lt;String, Object&gt; formParams, List&lt;MediaType&gt; accept, MediaType contentType, String[] authNames, ParameterizedTypeReference&lt;T&gt; returnType) throws RestClientException {
      final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
      return requestBuilder.retrieve().bodyToMono(returnType);
  }
  </code></pre>
  <p>As far as I know, the only way to have access to response headers using Spring Webclient is using toEntity that gives a ResponseEntity methods (and thus .getHeaders) instead the bodyToMono.</p>
  <p>Am I missing something?</p>