update java petstore sample, reenable test for resttemplate-withxml

This commit is contained in:
wing328
2017-08-03 17:09:38 +08:00
parent b4e0854823
commit 7aee5b6ee7
486 changed files with 810 additions and 629 deletions

View File

@@ -116,6 +116,7 @@ public class ApiClient {
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
authentications.put("http_basic_test", new HttpBasicAuth());
authentications.put("petstore_auth", new OAuth());
// Prevent the authentications from being modified.
@@ -416,6 +417,11 @@ public class ApiClient {
* @return boolean true if the MediaType represents JSON, false otherwise
*/
public boolean isJsonMime(String mediaType) {
// "* / *" is default to JSON
if ("*/*".equals(mediaType)) {
return true;
}
try {
return isJsonMime(MediaType.parseMediaType(mediaType));
} catch (InvalidMediaTypeException e) {

View File

@@ -76,7 +76,7 @@ public class FakeClassnameTags123Api {
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
String[] authNames = new String[] { "api_key_query" };
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);

View File

@@ -22,25 +22,29 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* AdditionalPropertiesClass
*/
@JacksonXmlRootElement(localName = "AdditionalPropertiesClass")
@XmlRootElement(name = "AdditionalPropertiesClass")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "AdditionalPropertiesClass")
public class AdditionalPropertiesClass {
@JsonProperty("map_property")
@JacksonXmlProperty(localName = "map_property")
@XmlElement(name = "map_property")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=String
@XmlElement(name = "inner")
private Map<String, String> mapProperty = null;
@JsonProperty("map_of_map_property")
@JacksonXmlProperty(localName = "map_of_map_property")
@XmlElement(name = "map_of_map_property")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=Map&lt;String, String&gt;
@XmlElement(name = "inner")
private Map<String, Map<String, String>> mapOfMapProperty = null;
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
@@ -136,6 +140,6 @@ public class AdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -21,8 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
@@ -33,9 +32,10 @@ import javax.xml.bind.annotation.*;
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
})
@JacksonXmlRootElement(localName = "Animal")
@XmlRootElement(name = "Animal")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Animal")
public class Animal {
@JsonProperty("className")
@JacksonXmlProperty(localName = "className")
@@ -124,6 +124,6 @@ public class Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -17,16 +17,16 @@ import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* AnimalFarm
*/
@JacksonXmlRootElement(localName = "AnimalFarm")
@XmlRootElement(name = "AnimalFarm")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "AnimalFarm")
public class AnimalFarm extends ArrayList<Animal> {
@Override
@@ -65,6 +65,6 @@ public class AnimalFarm extends ArrayList<Animal> {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -22,20 +22,22 @@ import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* ArrayOfArrayOfNumberOnly
*/
@JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly")
@XmlRootElement(name = "ArrayOfArrayOfNumberOnly")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly")
public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
@JacksonXmlProperty(localName = "ArrayArrayNumber")
@XmlElement(name = "ArrayArrayNumber")
// Is a container wrapped=false
// items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace=
// items.example= items.type=List&lt;BigDecimal&gt;
@XmlElement(name = "arrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
@@ -103,6 +105,6 @@ public class ArrayOfArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -22,20 +22,22 @@ import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* ArrayOfNumberOnly
*/
@JacksonXmlRootElement(localName = "ArrayOfNumberOnly")
@XmlRootElement(name = "ArrayOfNumberOnly")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ArrayOfNumberOnly")
public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
@JacksonXmlProperty(localName = "ArrayNumber")
@XmlElement(name = "ArrayNumber")
// Is a container wrapped=false
// items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace=
// items.example= items.type=BigDecimal
@XmlElement(name = "arrayNumber")
private List<BigDecimal> arrayNumber = null;
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
@@ -103,6 +105,6 @@ public class ArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -22,30 +22,36 @@ import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* ArrayTest
*/
@JacksonXmlRootElement(localName = "ArrayTest")
@XmlRootElement(name = "ArrayTest")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ArrayTest")
public class ArrayTest {
@JsonProperty("array_of_string")
@JacksonXmlProperty(localName = "array_of_string")
@XmlElement(name = "array_of_string")
// Is a container wrapped=false
// items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace=
// items.example= items.type=String
@XmlElement(name = "arrayOfString")
private List<String> arrayOfString = null;
@JsonProperty("array_array_of_integer")
@JacksonXmlProperty(localName = "array_array_of_integer")
@XmlElement(name = "array_array_of_integer")
// Is a container wrapped=false
// items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace=
// items.example= items.type=List&lt;Long&gt;
@XmlElement(name = "arrayArrayOfInteger")
private List<List<Long>> arrayArrayOfInteger = null;
@JsonProperty("array_array_of_model")
@JacksonXmlProperty(localName = "array_array_of_model")
@XmlElement(name = "array_array_of_model")
// Is a container wrapped=false
// items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace=
// items.example= items.type=List&lt;ReadOnlyFirst&gt;
@XmlElement(name = "arrayArrayOfModel")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
public ArrayTest arrayOfString(List<String> arrayOfString) {
@@ -169,6 +175,6 @@ public class ArrayTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Capitalization
*/
@JacksonXmlRootElement(localName = "Capitalization")
@XmlRootElement(name = "Capitalization")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Capitalization")
public class Capitalization {
@JsonProperty("smallCamel")
@JacksonXmlProperty(localName = "smallCamel")
@@ -217,6 +217,6 @@ public class Capitalization {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Cat
*/
@JacksonXmlRootElement(localName = "Cat")
@XmlRootElement(name = "Cat")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Cat")
public class Cat extends Animal {
@JsonProperty("declawed")
@JacksonXmlProperty(localName = "declawed")
@@ -46,7 +46,7 @@ public class Cat extends Animal {
* @return declawed
**/
@ApiModelProperty(value = "")
public Boolean getDeclawed() {
public Boolean isDeclawed() {
return declawed;
}
@@ -94,6 +94,6 @@ public class Cat extends Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Category
*/
@JacksonXmlRootElement(localName = "Category")
@XmlRootElement(name = "Category")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Category")
public class Category {
@JsonProperty("id")
@JacksonXmlProperty(localName = "id")
@@ -117,6 +117,6 @@ public class Category {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,17 +19,17 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Model for testing model with \&quot;_class\&quot; property
*/
@ApiModel(description = "Model for testing model with \"_class\" property")
@JacksonXmlRootElement(localName = "ClassModel")
@XmlRootElement(name = "ClassModel")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ClassModel")
public class ClassModel {
@JsonProperty("_class")
@JacksonXmlProperty(localName = "_class")
@@ -93,6 +93,6 @@ public class ClassModel {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Client
*/
@JacksonXmlRootElement(localName = "Client")
@XmlRootElement(name = "Client")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Client")
public class Client {
@JsonProperty("client")
@JacksonXmlProperty(localName = "client")
@@ -92,6 +92,6 @@ public class Client {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Dog
*/
@JacksonXmlRootElement(localName = "Dog")
@XmlRootElement(name = "Dog")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Dog")
public class Dog extends Animal {
@JsonProperty("breed")
@JacksonXmlProperty(localName = "breed")
@@ -94,6 +94,6 @@ public class Dog extends Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -21,16 +21,16 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* EnumArrays
*/
@JacksonXmlRootElement(localName = "EnumArrays")
@XmlRootElement(name = "EnumArrays")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "EnumArrays")
public class EnumArrays {
/**
* Gets or Sets justSymbol
@@ -108,8 +108,10 @@ public class EnumArrays {
}
@JsonProperty("array_enum")
@JacksonXmlProperty(localName = "array_enum")
@XmlElement(name = "array_enum")
// Is a container wrapped=false
// items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace=
// items.example= items.type=String
@XmlElement(name = "arrayEnum")
private List<ArrayEnumEnum> arrayEnum = null;
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
@@ -197,6 +199,6 @@ public class EnumArrays {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -14,8 +14,7 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
import com.fasterxml.jackson.annotation.JsonCreator;

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.OuterEnum;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* EnumTest
*/
@JacksonXmlRootElement(localName = "EnumTest")
@XmlRootElement(name = "EnumTest")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "EnumTest")
public class EnumTest {
/**
* Gets or Sets enumString
@@ -275,6 +275,6 @@ public class EnumTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -23,16 +23,16 @@ import java.math.BigDecimal;
import java.util.UUID;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* FormatTest
*/
@JacksonXmlRootElement(localName = "FormatTest")
@XmlRootElement(name = "FormatTest")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "FormatTest")
public class FormatTest {
@JsonProperty("integer")
@JacksonXmlProperty(localName = "integer")
@@ -406,6 +406,6 @@ public class FormatTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* HasOnlyReadOnly
*/
@JacksonXmlRootElement(localName = "HasOnlyReadOnly")
@XmlRootElement(name = "HasOnlyReadOnly")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "HasOnlyReadOnly")
public class HasOnlyReadOnly {
@JsonProperty("bar")
@JacksonXmlProperty(localName = "bar")
@@ -99,6 +99,6 @@ public class HasOnlyReadOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -22,20 +22,22 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* MapTest
*/
@JacksonXmlRootElement(localName = "MapTest")
@XmlRootElement(name = "MapTest")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "MapTest")
public class MapTest {
@JsonProperty("map_map_of_string")
@JacksonXmlProperty(localName = "map_map_of_string")
@XmlElement(name = "map_map_of_string")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=Map&lt;String, String&gt;
@XmlElement(name = "inner")
private Map<String, Map<String, String>> mapMapOfString = null;
/**
@@ -74,8 +76,10 @@ public class MapTest {
}
@JsonProperty("map_of_enum_string")
@JacksonXmlProperty(localName = "map_of_enum_string")
@XmlElement(name = "map_of_enum_string")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=String
@XmlElement(name = "inner")
private Map<String, InnerEnum> mapOfEnumString = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
@@ -171,6 +175,6 @@ public class MapTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -25,16 +25,16 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* MixedPropertiesAndAdditionalPropertiesClass
*/
@JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass")
@XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass")
public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("uuid")
@JacksonXmlProperty(localName = "uuid")
@@ -47,8 +47,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private OffsetDateTime dateTime = null;
@JsonProperty("map")
@JacksonXmlProperty(localName = "map")
@XmlElement(name = "map")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=Animal
@XmlElement(name = "inner")
private Map<String, Animal> map = null;
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
@@ -156,6 +158,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,17 +19,17 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Model for testing model name starting with number
*/
@ApiModel(description = "Model for testing model name starting with number")
@JacksonXmlRootElement(localName = "Name")
@XmlRootElement(name = "Name")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Name")
public class Model200Response {
@JsonProperty("name")
@JacksonXmlProperty(localName = "name")
@@ -118,6 +118,6 @@ public class Model200Response {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* ModelApiResponse
*/
@JacksonXmlRootElement(localName = "ModelApiResponse")
@XmlRootElement(name = "ModelApiResponse")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ModelApiResponse")
public class ModelApiResponse {
@JsonProperty("code")
@JacksonXmlProperty(localName = "code")
@@ -142,6 +142,6 @@ public class ModelApiResponse {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,17 +19,17 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Model for testing reserved words
*/
@ApiModel(description = "Model for testing reserved words")
@JacksonXmlRootElement(localName = "Return")
@XmlRootElement(name = "Return")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Return")
public class ModelReturn {
@JsonProperty("return")
@JacksonXmlProperty(localName = "return")
@@ -93,6 +93,6 @@ public class ModelReturn {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,17 +19,17 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Model for testing model name same as property name
*/
@ApiModel(description = "Model for testing model name same as property name")
@JacksonXmlRootElement(localName = "Name")
@XmlRootElement(name = "Name")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Name")
public class Name {
@JsonProperty("name")
@JacksonXmlProperty(localName = "name")
@@ -150,6 +150,6 @@ public class Name {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* NumberOnly
*/
@JacksonXmlRootElement(localName = "NumberOnly")
@XmlRootElement(name = "NumberOnly")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "NumberOnly")
public class NumberOnly {
@JsonProperty("JustNumber")
@JacksonXmlProperty(localName = "JustNumber")
@@ -93,6 +93,6 @@ public class NumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Order
*/
@JacksonXmlRootElement(localName = "Order")
@XmlRootElement(name = "Order")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Order")
public class Order {
@JsonProperty("id")
@JacksonXmlProperty(localName = "id")
@@ -198,7 +198,7 @@ public class Order {
* @return complete
**/
@ApiModelProperty(value = "")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}
@@ -255,6 +255,6 @@ public class Order {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -20,16 +20,16 @@ import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* OuterComposite
*/
@JacksonXmlRootElement(localName = "OuterComposite")
@XmlRootElement(name = "OuterComposite")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "OuterComposite")
public class OuterComposite {
@JsonProperty("my_number")
@JacksonXmlProperty(localName = "my_number")
@@ -143,6 +143,6 @@ public class OuterComposite {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -14,8 +14,7 @@
package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
import com.fasterxml.jackson.annotation.JsonCreator;

View File

@@ -23,16 +23,16 @@ import io.swagger.client.model.Category;
import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Pet
*/
@JacksonXmlRootElement(localName = "Pet")
@XmlRootElement(name = "Pet")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Pet")
public class Pet {
@JsonProperty("id")
@JacksonXmlProperty(localName = "id")
@@ -50,13 +50,23 @@ public class Pet {
private String name = null;
@JsonProperty("photoUrls")
@JacksonXmlProperty(localName = "photoUrl")
@XmlElement(name = "photoUrl")
// items.xmlName=
@JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls")
// Is a container wrapped=true
// items.name=photoUrls items.baseName=photoUrls items.xmlName= items.xmlNamespace=
// items.example= items.type=String
@XmlElement(name = "photoUrls")
@XmlElementWrapper(name = "photoUrl")
private List<String> photoUrls = new ArrayList<String>();
@JsonProperty("tags")
@JacksonXmlProperty(localName = "tag")
@XmlElement(name = "tag")
// items.xmlName=
@JacksonXmlElementWrapper(useWrapping = true, localName = "tags")
// Is a container wrapped=true
// items.name=tags items.baseName=tags items.xmlName= items.xmlNamespace=
// items.example= items.type=Tag
@XmlElement(name = "tags")
@XmlElementWrapper(name = "tag")
private List<Tag> tags = null;
/**
@@ -271,6 +281,6 @@ public class Pet {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* ReadOnlyFirst
*/
@JacksonXmlRootElement(localName = "ReadOnlyFirst")
@XmlRootElement(name = "ReadOnlyFirst")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "ReadOnlyFirst")
public class ReadOnlyFirst {
@JsonProperty("bar")
@JacksonXmlProperty(localName = "bar")
@@ -108,6 +108,6 @@ public class ReadOnlyFirst {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* SpecialModelName
*/
@JacksonXmlRootElement(localName = "$special[model.name]")
@XmlRootElement(name = "$special[model.name]")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "$special[model.name]")
public class SpecialModelName {
@JsonProperty("$special[property.name]")
@JacksonXmlProperty(localName = "$special[property.name]")
@@ -92,6 +92,6 @@ public class SpecialModelName {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* Tag
*/
@JacksonXmlRootElement(localName = "Tag")
@XmlRootElement(name = "Tag")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "Tag")
public class Tag {
@JsonProperty("id")
@JacksonXmlProperty(localName = "id")
@@ -117,6 +117,6 @@ public class Tag {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -19,16 +19,16 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
/**
* User
*/
@JacksonXmlRootElement(localName = "User")
@XmlRootElement(name = "User")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "User")
public class User {
@JsonProperty("id")
@JacksonXmlProperty(localName = "id")
@@ -267,6 +267,6 @@ public class User {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -15,8 +15,8 @@ package io.swagger.client.api;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import io.swagger.client.model.OuterComposite;
import org.junit.Test;
import org.junit.Ignore;
@@ -136,7 +136,7 @@ public class FakeApiTest {
String string = null;
byte[] binary = null;
LocalDate date = null;
DateTime dateTime = null;
OffsetDateTime dateTime = null;
String password = null;
String paramCallback = null;
api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
@@ -167,4 +167,21 @@ public class FakeApiTest {
// TODO: test validations
}
/**
* test json serialization of form data
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testJsonFormDataTest() {
String param = null;
String param2 = null;
api.testJsonFormData(param, param2);
// TODO: test validations
}
}