mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
Added json enum to csharp with decoration
using newtonsoft decoration
This commit is contained in:
parent
ff1dd034a8
commit
f4773d3333
@ -3,6 +3,7 @@ package io.swagger.codegen.languages;
|
|||||||
import io.swagger.codegen.CodegenConfig;
|
import io.swagger.codegen.CodegenConfig;
|
||||||
import io.swagger.codegen.CodegenConstants;
|
import io.swagger.codegen.CodegenConstants;
|
||||||
import io.swagger.codegen.CodegenType;
|
import io.swagger.codegen.CodegenType;
|
||||||
|
import io.swagger.codegen.CodegenModel;
|
||||||
import io.swagger.codegen.DefaultCodegen;
|
import io.swagger.codegen.DefaultCodegen;
|
||||||
import io.swagger.codegen.SupportingFile;
|
import io.swagger.codegen.SupportingFile;
|
||||||
import io.swagger.codegen.CodegenProperty;
|
import io.swagger.codegen.CodegenProperty;
|
||||||
@ -11,6 +12,7 @@ import io.swagger.models.properties.ArrayProperty;
|
|||||||
import io.swagger.models.properties.MapProperty;
|
import io.swagger.models.properties.MapProperty;
|
||||||
import io.swagger.models.properties.Property;
|
import io.swagger.models.properties.Property;
|
||||||
import io.swagger.codegen.CliOption;
|
import io.swagger.codegen.CliOption;
|
||||||
|
import io.swagger.models.Model;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -18,8 +20,11 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.commons.lang.WordUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -29,6 +34,7 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
protected String packageVersion = "1.0.0";
|
protected String packageVersion = "1.0.0";
|
||||||
protected String clientPackage = "IO.Swagger.Client";
|
protected String clientPackage = "IO.Swagger.Client";
|
||||||
protected String sourceFolder = "src" + File.separator + "main" + File.separator + "csharp";
|
protected String sourceFolder = "src" + File.separator + "main" + File.separator + "csharp";
|
||||||
|
protected String localVariablePrefix = "";
|
||||||
|
|
||||||
public CSharpClientCodegen() {
|
public CSharpClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -261,12 +267,17 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return camelize(sanitizeName(operationId));
|
return camelize(sanitizeName(operationId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
@Override
|
||||||
this.packageName = packageName;
|
public CodegenModel fromModel(String name, Model model, Map<String, Model> allDefinitions) {
|
||||||
}
|
CodegenModel codegenModel = super.fromModel(name, model, allDefinitions);
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
if (allDefinitions != null && codegenModel != null && codegenModel.parent != null && codegenModel.hasEnums) {
|
||||||
this.packageVersion = packageVersion;
|
final Model parentModel = allDefinitions.get(toModelName(codegenModel.parent));
|
||||||
|
final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel);
|
||||||
|
codegenModel = this.reconcileInlineEnums(codegenModel, parentCodegenModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
return codegenModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -276,14 +287,133 @@ public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
Map<String, Object> mo = (Map<String, Object>) _mo;
|
Map<String, Object> mo = (Map<String, Object>) _mo;
|
||||||
CodegenModel cm = (CodegenModel) mo.get("model");
|
CodegenModel cm = (CodegenModel) mo.get("model");
|
||||||
for (CodegenProperty var : cm.vars) {
|
for (CodegenProperty var : cm.vars) {
|
||||||
// check to see if model name is same as the property name
|
Map<String, Object> allowableValues = var.allowableValues;
|
||||||
// which will result in compilation error
|
|
||||||
// if found, prepend with _ to workaround the limitation
|
// handle ArrayProperty
|
||||||
if (var.name.equals(cm.name)) {
|
if (var.items != null) {
|
||||||
var.name = "_" + var.name;
|
allowableValues = var.items.allowableValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allowableValues == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
List<String> values = (List<String>) allowableValues.get("values");
|
||||||
|
if (values == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// put "enumVars" map into `allowableValues", including `name` and `value`
|
||||||
|
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
|
||||||
|
String commonPrefix = findCommonPrefixOfVars(values);
|
||||||
|
int truncateIdx = commonPrefix.length();
|
||||||
|
for (String value : values) {
|
||||||
|
Map<String, String> enumVar = new HashMap<String, String>();
|
||||||
|
String enumName;
|
||||||
|
if (truncateIdx == 0) {
|
||||||
|
enumName = value;
|
||||||
|
} else {
|
||||||
|
enumName = value.substring(truncateIdx);
|
||||||
|
if ("".equals(enumName)) {
|
||||||
|
enumName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enumVar.put("name", toEnumVarName(enumName));
|
||||||
|
enumVar.put("jsonname", value);
|
||||||
|
enumVar.put("value", value);
|
||||||
|
enumVars.add(enumVar);
|
||||||
|
}
|
||||||
|
allowableValues.put("enumVars", enumVars);
|
||||||
|
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
|
||||||
|
if (var.defaultValue != null) {
|
||||||
|
String enumName = null;
|
||||||
|
for (Map<String, String> enumVar : enumVars) {
|
||||||
|
if (var.defaultValue.equals(enumVar.get("value"))) {
|
||||||
|
enumName = enumVar.get("name");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enumName != null) {
|
||||||
|
var.defaultValue = var.datatypeWithEnum + "." + enumName;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) {
|
||||||
|
// This generator uses inline classes to define enums, which breaks when
|
||||||
|
// dealing with models that have subTypes. To clean this up, we will analyze
|
||||||
|
// the parent and child models, look for enums that match, and remove
|
||||||
|
// them from the child models and leave them in the parent.
|
||||||
|
// Because the child models extend the parents, the enums will be available via the parent.
|
||||||
|
|
||||||
|
// Only bother with reconciliation if the parent model has enums.
|
||||||
|
if (parentCodegenModel.hasEnums) {
|
||||||
|
|
||||||
|
// Get the properties for the parent and child models
|
||||||
|
final List<CodegenProperty> parentModelCodegenProperties = parentCodegenModel.vars;
|
||||||
|
List<CodegenProperty> codegenProperties = codegenModel.vars;
|
||||||
|
|
||||||
|
// Iterate over all of the parent model properties
|
||||||
|
boolean removedChildEnum = false;
|
||||||
|
for (CodegenProperty parentModelCodegenPropery : parentModelCodegenProperties) {
|
||||||
|
// Look for enums
|
||||||
|
if (parentModelCodegenPropery.isEnum) {
|
||||||
|
// Now that we have found an enum in the parent class,
|
||||||
|
// and search the child class for the same enum.
|
||||||
|
Iterator<CodegenProperty> iterator = codegenProperties.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
CodegenProperty codegenProperty = iterator.next();
|
||||||
|
if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenPropery)) {
|
||||||
|
// We found an enum in the child class that is
|
||||||
|
// a duplicate of the one in the parent, so remove it.
|
||||||
|
iterator.remove();
|
||||||
|
removedChildEnum = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(removedChildEnum) {
|
||||||
|
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||||
|
int count = 0, numVars = codegenProperties.size();
|
||||||
|
for(CodegenProperty codegenProperty : codegenProperties) {
|
||||||
|
count += 1;
|
||||||
|
codegenProperty.hasMore = (count < numVars) ? true : null;
|
||||||
|
}
|
||||||
|
codegenModel.vars = codegenProperties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return codegenModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String findCommonPrefixOfVars(List<String> vars) {
|
||||||
|
String prefix = StringUtils.getCommonPrefix(vars.toArray(new String[vars.size()]));
|
||||||
|
// exclude trailing characters that should be part of a valid variable
|
||||||
|
// e.g. ["status-on", "status-off"] => "status-" (not "status-o")
|
||||||
|
return prefix.replaceAll("[a-zA-Z0-9]+\\z", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String toEnumVarName(String value) {
|
||||||
|
String var = value.replaceAll("_", " ");
|
||||||
|
var = WordUtils.capitalizeFully(var);
|
||||||
|
var = var.replaceAll("\\W+", "");
|
||||||
|
|
||||||
|
if (var.matches("\\d.*")) {
|
||||||
|
return "_" + var;
|
||||||
|
} else {
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPackageName(String packageName) {
|
||||||
|
this.packageName = packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackageVersion(String packageVersion) {
|
||||||
|
this.packageVersion = packageVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
public enum {{name}} {
|
||||||
|
{{#allowableValues}}{{#enumVars}}
|
||||||
|
[EnumMember("{{jsonname}}")]
|
||||||
|
{{name}}{{^-last}},
|
||||||
|
{{/-last}}{{#-last}}{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
|
}
|
@ -15,6 +15,22 @@ namespace {{packageName}}.Model {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
|
public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
|
||||||
|
{{#vars}}{{#isEnum}}
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
|
||||||
|
|
||||||
|
{{>enumClass}}{{/items}}{{/items.isEnum}}
|
||||||
|
|
||||||
|
private {{{name}}} {{name}};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
||||||
|
/// </summary>{{#description}}
|
||||||
|
/// <value>{{{description}}}</value>{{/description}}
|
||||||
|
[DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
|
||||||
|
public {{{name}}} {{name}} { get; set; }
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
||||||
|
@ -317,14 +317,14 @@ namespace IO.Swagger.Client
|
|||||||
switch(auth)
|
switch(auth)
|
||||||
{
|
{
|
||||||
|
|
||||||
case "api_key":
|
|
||||||
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "petstore_auth":
|
case "petstore_auth":
|
||||||
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "api_key":
|
||||||
|
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//TODO show warning about security definition not found
|
//TODO show warning about security definition not found
|
||||||
break;
|
break;
|
||||||
|
@ -14,6 +14,26 @@ namespace IO.Swagger.Model {
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class Category {
|
public class Category {
|
||||||
|
|
||||||
|
|
||||||
|
private Id Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||||
|
public Id Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Name Name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||||
|
public Name Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,75 @@ namespace IO.Swagger.Model {
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class Order {
|
public class Order {
|
||||||
|
|
||||||
|
|
||||||
|
private Id Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||||
|
public Id Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private PetId PetId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PetId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="petId", EmitDefaultValue=false)]
|
||||||
|
public PetId PetId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Quantity Quantity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Quantity
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="quantity", EmitDefaultValue=false)]
|
||||||
|
public Quantity Quantity { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private ShipDate ShipDate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ShipDate
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="shipDate", EmitDefaultValue=false)]
|
||||||
|
public ShipDate ShipDate { get; set; }
|
||||||
|
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum Status {
|
||||||
|
|
||||||
|
[EnumMember("placed")]
|
||||||
|
Placed,
|
||||||
|
|
||||||
|
[EnumMember("approved")]
|
||||||
|
Approved,
|
||||||
|
|
||||||
|
[EnumMember("delivered")]
|
||||||
|
Delivered
|
||||||
|
}
|
||||||
|
|
||||||
|
private Status Status;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Order Status
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Order Status</value>
|
||||||
|
[DataMember(Name="status", EmitDefaultValue=false)]
|
||||||
|
public Status Status { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Complete Complete;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Complete
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="complete", EmitDefaultValue=false)]
|
||||||
|
public Complete Complete { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,75 @@ namespace IO.Swagger.Model {
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class Pet {
|
public class Pet {
|
||||||
|
|
||||||
|
|
||||||
|
private Id Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||||
|
public Id Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Category Category;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Category
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="category", EmitDefaultValue=false)]
|
||||||
|
public Category Category { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Name Name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||||
|
public Name Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private PhotoUrls PhotoUrls;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrls
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="photoUrls", EmitDefaultValue=false)]
|
||||||
|
public PhotoUrls PhotoUrls { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Tags Tags;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tags
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="tags", EmitDefaultValue=false)]
|
||||||
|
public Tags Tags { get; set; }
|
||||||
|
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum Status {
|
||||||
|
|
||||||
|
[EnumMember("available")]
|
||||||
|
Available,
|
||||||
|
|
||||||
|
[EnumMember("pending")]
|
||||||
|
Pending,
|
||||||
|
|
||||||
|
[EnumMember("sold")]
|
||||||
|
Sold
|
||||||
|
}
|
||||||
|
|
||||||
|
private Status Status;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pet status in the store
|
||||||
|
/// </summary>
|
||||||
|
/// <value>pet status in the store</value>
|
||||||
|
[DataMember(Name="status", EmitDefaultValue=false)]
|
||||||
|
public Status Status { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,26 @@ namespace IO.Swagger.Model {
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class Tag {
|
public class Tag {
|
||||||
|
|
||||||
|
|
||||||
|
private Id Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||||
|
public Id Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Name Name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||||
|
public Name Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,81 @@ namespace IO.Swagger.Model {
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
|
|
||||||
|
private Id Id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||||
|
public Id Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Username Username;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Username
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="username", EmitDefaultValue=false)]
|
||||||
|
public Username Username { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private FirstName FirstName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets FirstName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="firstName", EmitDefaultValue=false)]
|
||||||
|
public FirstName FirstName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private LastName LastName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="lastName", EmitDefaultValue=false)]
|
||||||
|
public LastName LastName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Email Email;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Email
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="email", EmitDefaultValue=false)]
|
||||||
|
public Email Email { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Password Password;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="password", EmitDefaultValue=false)]
|
||||||
|
public Password Password { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private Phone Phone;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Phone
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name="phone", EmitDefaultValue=false)]
|
||||||
|
public Phone Phone { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private UserStatus UserStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// User Status
|
||||||
|
/// </summary>
|
||||||
|
/// <value>User Status</value>
|
||||||
|
[DataMember(Name="userStatus", EmitDefaultValue=false)]
|
||||||
|
public UserStatus UserStatus { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Id
|
/// Gets or Sets Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -39,7 +39,7 @@ import io.swagger.client.auth.HttpBasicAuth;
|
|||||||
import io.swagger.client.auth.ApiKeyAuth;
|
import io.swagger.client.auth.ApiKeyAuth;
|
||||||
import io.swagger.client.auth.OAuth;
|
import io.swagger.client.auth.OAuth;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-07T15:05:10.376+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class ApiClient {
|
public class ApiClient {
|
||||||
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
private int code = 0;
|
private int code = 0;
|
||||||
private Map<String, List<String>> responseHeaders = null;
|
private Map<String, List<String>> responseHeaders = null;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Configuration {
|
public class Configuration {
|
||||||
private static ApiClient defaultApiClient = new ApiClient();
|
private static ApiClient defaultApiClient = new ApiClient();
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import java.text.DateFormat;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-07T15:05:10.376+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class JSON {
|
public class JSON {
|
||||||
private ObjectMapper mapper;
|
private ObjectMapper mapper;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Pair {
|
public class Pair {
|
||||||
private String name = "";
|
private String name = "";
|
||||||
private String value = "";
|
private String value = "";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.client;
|
package io.swagger.client;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
@ -3,7 +3,7 @@ package io.swagger.client;
|
|||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class TypeRef<T> {
|
public class TypeRef<T> {
|
||||||
private final Type type;
|
private final Type type;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import java.io.File;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-04T19:58:40.953+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class PetApi {
|
public class PetApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import io.swagger.client.model.Order;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
private ApiClient apiClient;
|
private ApiClient apiClient;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class ApiKeyAuth implements Authentication {
|
public class ApiKeyAuth implements Authentication {
|
||||||
private final String location;
|
private final String location;
|
||||||
private final String paramName;
|
private final String paramName;
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public interface Authentication {
|
public interface Authentication {
|
||||||
/** Apply authentication settings to header and query params. */
|
/** Apply authentication settings to header and query params. */
|
||||||
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
|
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
import javax.xml.bind.DatatypeConverter;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class HttpBasicAuth implements Authentication {
|
public class HttpBasicAuth implements Authentication {
|
||||||
private String username;
|
private String username;
|
||||||
private String password;
|
private String password;
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.client.Pair;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-02T21:16:46.418+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class OAuth implements Authentication {
|
public class OAuth implements Authentication {
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
@ApiModel(description = "")
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Category {
|
public class Category {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
@ApiModel(description = "")
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Order {
|
public class Order {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -2,8 +2,8 @@ package io.swagger.client.model;
|
|||||||
|
|
||||||
import io.swagger.client.StringUtil;
|
import io.swagger.client.StringUtil;
|
||||||
import io.swagger.client.model.Category;
|
import io.swagger.client.model.Category;
|
||||||
import io.swagger.client.model.Tag;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import io.swagger.client.model.Tag;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
@ApiModel(description = "")
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Pet {
|
public class Pet {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
@ApiModel(description = "")
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class Tag {
|
public class Tag {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
@ApiModel(description = "")
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-10-30T16:36:47.681+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-11-19T13:52:16.052+01:00")
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user