forked from loafle/openapi-generator-original
set supportInheritance to true for java based gens
This commit is contained in:
@@ -41,10 +41,10 @@ public class ApiClient {
|
||||
this();
|
||||
for(String authName : authNames) {
|
||||
RequestInterceptor auth;
|
||||
if (authName == "api_key") {
|
||||
auth = new ApiKeyAuth("header", "api_key");
|
||||
} else if (authName == "petstore_auth") {
|
||||
if (authName == "petstore_auth") {
|
||||
auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||
} else if (authName == "api_key") {
|
||||
auth = new ApiKeyAuth("header", "api_key");
|
||||
} else {
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import io.swagger.client.ApiClient;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -3,8 +3,8 @@ package io.swagger.client.api;
|
||||
import io.swagger.client.ApiClient;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.ModelApiResponse;
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -37,51 +37,9 @@ import io.swagger.client.model.Animal;
|
||||
*/
|
||||
|
||||
public class Cat extends Animal {
|
||||
@JsonProperty("className")
|
||||
private String className = null;
|
||||
|
||||
@JsonProperty("color")
|
||||
private String color = "red";
|
||||
|
||||
@JsonProperty("declawed")
|
||||
private Boolean declawed = null;
|
||||
|
||||
public Cat className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Cat color(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
return this;
|
||||
@@ -110,15 +68,13 @@ public class Cat extends Animal {
|
||||
return false;
|
||||
}
|
||||
Cat cat = (Cat) o;
|
||||
return Objects.equals(this.className, cat.className) &&
|
||||
Objects.equals(this.color, cat.color) &&
|
||||
Objects.equals(this.declawed, cat.declawed) &&
|
||||
return Objects.equals(this.declawed, cat.declawed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className, color, declawed, super.hashCode());
|
||||
return Objects.hash(declawed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,8 +82,6 @@ public class Cat extends Animal {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Cat {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
||||
@@ -37,51 +37,9 @@ import io.swagger.client.model.Animal;
|
||||
*/
|
||||
|
||||
public class Dog extends Animal {
|
||||
@JsonProperty("className")
|
||||
private String className = null;
|
||||
|
||||
@JsonProperty("color")
|
||||
private String color = "red";
|
||||
|
||||
@JsonProperty("breed")
|
||||
private String breed = null;
|
||||
|
||||
public Dog className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Dog color(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
this.breed = breed;
|
||||
return this;
|
||||
@@ -110,15 +68,13 @@ public class Dog extends Animal {
|
||||
return false;
|
||||
}
|
||||
Dog dog = (Dog) o;
|
||||
return Objects.equals(this.className, dog.className) &&
|
||||
Objects.equals(this.color, dog.color) &&
|
||||
Objects.equals(this.breed, dog.breed) &&
|
||||
return Objects.equals(this.breed, dog.breed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className, color, breed, super.hashCode());
|
||||
return Objects.hash(breed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,8 +82,6 @@ public class Dog extends Animal {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Dog {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
||||
Reference in New Issue
Block a user