From 52cd17ecc798b2d8c1d72d88105d3a0bdfcdc86a Mon Sep 17 00:00:00 2001 From: Marvin Date: Thu, 19 Jul 2018 11:55:01 +0200 Subject: [PATCH] [Java][RESTEasy] Fixed setting of custom headers (#599) Fixed header generation. Previously the key was used as value parameter. --- .../main/resources/Java/libraries/resteasy/ApiClient.mustache | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index f447d6458072..ad1fcc649dd1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -638,7 +638,7 @@ public class ApiClient { for (Entry defaultHeaderEnrty: defaultHeaderMap.entrySet()) { if (!headerParams.containsKey(defaultHeaderEnrty.getKey())) { - String value = defaultHeaderEnrty.getKey(); + String value = defaultHeaderEnrty.getValue(); if (value != null) { invocationBuilder = invocationBuilder.header(defaultHeaderEnrty.getKey(), value); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java index 5e80ded364fe..b8cbc4854217 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java @@ -633,7 +633,7 @@ public T invokeAPI(String path, String method, List queryParams, Objec for (Entry defaultHeaderEnrty: defaultHeaderMap.entrySet()) { if (!headerParams.containsKey(defaultHeaderEnrty.getKey())) { - String value = defaultHeaderEnrty.getKey(); + String value = defaultHeaderEnrty.getValue(); if (value != null) { invocationBuilder = invocationBuilder.header(defaultHeaderEnrty.getKey(), value); }