forked from loafle/openapi-generator-original
fix #1804
This commit is contained in:
parent
90d1e280ed
commit
ff9e04e4dd
@ -476,11 +476,11 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
model.imports.add("JsonSerialize");
|
||||
}
|
||||
}
|
||||
|
||||
if(model.isEnum == null || model.isEnum) {
|
||||
// needed by all pojos, but not enums
|
||||
model.imports.add("ApiModelProperty");
|
||||
model.imports.add("ApiModel");
|
||||
model.imports.add("Objects");
|
||||
|
||||
final String lib = getLibrary();
|
||||
if(StringUtils.isEmpty(lib) || "feign".equals(lib) || "jersey2".equals(lib)) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package {{package}};
|
||||
|
||||
import java.util.Objects;
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
||||
|
@ -41,7 +41,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-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class ApiClient {
|
||||
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class ApiException extends Exception {
|
||||
private int code = 0;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.client;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Configuration {
|
||||
private static ApiClient defaultApiClient = new ApiClient();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.client;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Pair {
|
||||
private String name = "";
|
||||
private String value = "";
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.swagger.client;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-29T11:32:50.163+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class StringUtil {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -12,7 +12,7 @@ import java.io.File;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:26:41.149+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class PetApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import io.swagger.client.model.Order;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class StoreApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.util.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class UserApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class ApiKeyAuth implements Authentication {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
@ -5,7 +5,6 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
public interface Authentication {
|
||||
/** Apply authentication settings to header and query params. */
|
||||
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class HttpBasicAuth implements Authentication {
|
||||
private String username;
|
||||
private String password;
|
||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:12:11.520+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class OAuth implements Authentication {
|
||||
private String accessToken;
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:17:07.711+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Category {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -1,17 +1,17 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:17:07.711+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Order {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -7,13 +8,12 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.client.model.Category;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.*;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:17:07.711+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Pet {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -1,16 +1,16 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:17:07.711+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class Tag {
|
||||
|
||||
private Long id = null;
|
||||
|
@ -1,16 +1,16 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-31T12:17:07.711+08:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-05T09:52:31.235+08:00")
|
||||
public class User {
|
||||
|
||||
private Long id = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user