diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache index ef171de9430..2ff7a3243c0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiResponseDecoder.mustache @@ -25,7 +25,7 @@ public class ApiResponseDecoder extends JacksonDecoder { Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); @@ -35,4 +35,4 @@ public class ApiResponseDecoder extends JacksonDecoder { return super.decode(response, type); } } -} \ No newline at end of file +}