title: Generated Swagger REST client does not handle + character correctly for query parameter
body: <p>I have this Spring REST controller method:</p>
  
  <pre><code>@ApiOperation("My method")
  @RequestMapping(method = RequestMethod.POST, value = "/myMethod")
  public void myMethod(@RequestParam("myParam") String myParam) {
  ...
  }
  </code></pre>
  
  <p>The REST client is generated using swagger codegen CLI with language <em>Java</em> and library <em>resttemplate</em>:</p>
  
  <pre><code>public void myMethod(String myParam) throws RestClientException {
      ...
      return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
  }
  </code></pre>
  
  <p>And the source code for <code>ApiClient#invokeAPI</code> - which is also generated - is:</p>
  
  <pre><code>public &lt;T&gt; T invokeAPI(String path, HttpMethod method, MultiValueMap&lt;String, String&gt; queryParams, Object body, HttpHeaders headerParams, MultiValueMap&lt;String, Object&gt; formParams, List&lt;MediaType&gt; accept, MediaType contentType, String[] authNames, ParameterizedTypeReference&lt;T&gt; returnType) throws RestClientException {
      updateParamsForAuth(authNames, queryParams, headerParams);
  
      final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
      if (queryParams != null) {
          builder.queryParams(queryParams);
      }
  
      final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().toUri());
      if(accept != null) {
          requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
      }
      if(contentType != null) {
          requestBuilder.contentType(contentType);
      }
  
      addHeadersToRequest(headerParams, requestBuilder);
      addHeadersToRequest(defaultHeaders, requestBuilder);
  
      RequestEntity&lt;Object&gt; requestEntity = requestBuilder.body(selectBody(body, formParams, contentType));
  
      ResponseEntity&lt;T&gt; responseEntity = restTemplate.exchange(requestEntity, returnType);
      ...
  }
  </code></pre>
  
  <p>Now, when I call <code>myMethod</code> passing a string containing a <code>+</code> sign in <code>myParam</code>, at the server I receive a space character instead of the <code>+</code>. Seems to be an encoding issue since the plus sign is reserved in URL query parameters to be a replacement for the space character. Is this a bug from swagger codegen or from Spring classes or no bug at all? How can I fix that?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Swagger definition is like (generated from Spring REST controller):</p>
  
  <pre><code>{
    "swagger": "2.0",
    ...
    "paths": {
      "/myMethod": {
        "get": {
          "operationId": "myMethod",
          "produces": [
            "application/json"
          ],
          "parameters": [
            {
              "name": "myParam",
              "in": "query",
              "required": true,
              "type": "string"
            }
          ],
          "responses": {
             ...
          }
        }
      }
   ...
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Similar problems seems to be the encoding of path variables. When I pass <code>"bla:bla/bla"</code> to a path variable the special characters <code>:</code> and <code>/</code> will not be encoded but send as is which causes an error server side because the mapping not found.</p>