forked from loafle/openapi-generator-original
Rebuild Java clients of the Petstore sample
This commit is contained in:
@@ -39,7 +39,7 @@ import io.swagger.client.auth.HttpBasicAuth;
|
||||
import io.swagger.client.auth.ApiKeyAuth;
|
||||
import io.swagger.client.auth.OAuth;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-11T11:35:58.351+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-09-23T12:52:56.012+08:00")
|
||||
public class ApiClient {
|
||||
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
@@ -384,8 +384,15 @@ public class ApiClient {
|
||||
|
||||
if (contentType.startsWith("application/json")) {
|
||||
return json.deserialize(body, returnType);
|
||||
} else if (returnType.getType().equals(String.class)) {
|
||||
// Expecting string, return the raw response body.
|
||||
return (T) body;
|
||||
} else {
|
||||
throw new ApiException(500, "can not deserialize Content-Type: " + contentType);
|
||||
throw new ApiException(
|
||||
500,
|
||||
"Content type \"" + contentType + "\" is not supported for type: "
|
||||
+ returnType.getType()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user