forked from loafle/openapi-generator-original
convert all text/* content types to strings in the apache http java client (#18731)
This commit is contained in:
@@ -859,7 +859,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return objectMapper.readValue(content, valueType);
|
return objectMapper.readValue(content, valueType);
|
||||||
} else if ("text/plain".equalsIgnoreCase(mimeType)) {
|
} else if (mimeType.toLowerCase().startsWith("text/")) {
|
||||||
// convert input stream to string
|
// convert input stream to string
|
||||||
return (T) EntityUtils.toString(entity);
|
return (T) EntityUtils.toString(entity);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ public class ApiClient extends JavaTimeFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return objectMapper.readValue(content, valueType);
|
return objectMapper.readValue(content, valueType);
|
||||||
} else if ("text/plain".equalsIgnoreCase(mimeType)) {
|
} else if (mimeType.toLowerCase().startsWith("text/")) {
|
||||||
// convert input stream to string
|
// convert input stream to string
|
||||||
return (T) EntityUtils.toString(entity);
|
return (T) EntityUtils.toString(entity);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -870,7 +870,7 @@ public class ApiClient extends JavaTimeFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return objectMapper.readValue(content, valueType);
|
return objectMapper.readValue(content, valueType);
|
||||||
} else if ("text/plain".equalsIgnoreCase(mimeType)) {
|
} else if (mimeType.toLowerCase().startsWith("text/")) {
|
||||||
// convert input stream to string
|
// convert input stream to string
|
||||||
return (T) EntityUtils.toString(entity);
|
return (T) EntityUtils.toString(entity);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user