Merge pull request #2787 from xhh/js-enum

[JavaScript] Fix the exporting of outer enum model in JS client
This commit is contained in:
wing328 2016-05-06 18:56:38 +08:00
commit 34ec63e908
113 changed files with 2163 additions and 783 deletions

View File

@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript \ ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript \
-i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l javascript \ -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
-o samples/client/petstore/javascript-promise \ -o samples/client/petstore/javascript-promise \
--additional-properties usePromises=true" --additional-properties usePromises=true"

View File

@ -839,6 +839,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) { public Map<String, Object> postProcessModels(Map<String, Object> objs) {
objs = super.postProcessModelsEnum(objs);
List<Object> models = (List<Object>) objs.get("models"); List<Object> models = (List<Object>) objs.get("models");
for (Object _mo : models) { for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo; Map<String, Object> mo = (Map<String, Object>) _mo;
@ -853,8 +854,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
cm.vendorExtensions.put("x-all-required", allRequired); cm.vendorExtensions.put("x-all-required", allRequired);
for (CodegenProperty var : cm.vars) { for (CodegenProperty var : cm.vars) {
Map<String, Object> allowableValues = var.allowableValues;
// Add JSDoc @type value for this property. // Add JSDoc @type value for this property.
String jsDocType = getJSDocTypeWithBraces(cm, var); String jsDocType = getJSDocTypeWithBraces(cm, var);
var.vendorExtensions.put("x-jsdoc-type", jsDocType); var.vendorExtensions.put("x-jsdoc-type", jsDocType);
@ -862,40 +861,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
if (Boolean.TRUE.equals(var.required)) { if (Boolean.TRUE.equals(var.required)) {
required.add(var.name); required.add(var.name);
} }
// handle ArrayProperty
if (var.items != null) {
allowableValues = var.items.allowableValues;
}
if (allowableValues == null) {
continue;
}
List<Object> values = (List<Object>) 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 (Object value : values) {
Map<String, String> enumVar = new HashMap<String, String>();
String enumName;
if (truncateIdx == 0) {
enumName = value.toString();
} else {
enumName = value.toString().substring(truncateIdx);
if ("".equals(enumName)) {
enumName = value.toString();
}
}
enumVar.put("name", toEnumVarName(enumName, var.datatype));
enumVar.put("value",toEnumValue(value.toString(), var.datatype));
enumVars.add(enumVar);
}
allowableValues.put("enumVars", enumVars);
} }
if (supportsInheritance) { if (supportsInheritance) {

View File

@ -2,6 +2,6 @@
## Enum ## Enum
{{#allowableValues}} {{#allowableValues}}{{#enumVars}}
* `{{.}}` * `{{name}}` (value: `{{{value}}}`)
{{/allowableValues}} {{/enumVars}}{{/allowableValues}}

View File

@ -3,5 +3,5 @@
## Enum ## Enum
{{#allowableValues}}{{#enumVars}} {{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{value}}`) * `{{name}}` (value: `{{{value}}}`)
{{/enumVars}}{{/allowableValues}} {{/enumVars}}{{/allowableValues}}

View File

@ -1,9 +1,25 @@
{{#models}}{{#model}}# {{moduleName}}.{{classname}} {{#models}}{{#model}}{{#isEnum}}# {{moduleName}}.{{classname}}
## Enum
{{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{{value}}}`)
{{/enumVars}}{{/allowableValues}}
{{/isEnum}}{{^isEnum}}# {{moduleName}}.{{classname}}
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{/vars}} {{/vars}}
{{#vars}}{{#isEnum}}
{{/model}}{{/models}} <a name="{{{datatypeWithEnum}}}"></a>
## Enum: {{datatypeWithEnum}}
{{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{{value}}}`)
{{/enumVars}}{{/allowableValues}}
{{/isEnum}}{{/vars}}
{{/isEnum}}{{/model}}{{/models}}

View File

@ -5,18 +5,18 @@
* @readonly * @readonly
*/ */
{{/emitJSDoc}} {{/emitJSDoc}}
exports.{{classname}} = { var exports = {
{{#allowableValues}} {{#allowableValues}}
{{#values}} {{#enumVars}}
{{#emitJSDoc}} {{#emitJSDoc}}
/** /**
* value: {{{.}}} * value: {{{value}}}
* @const * @const
*/ */
{{/emitJSDoc}} {{/emitJSDoc}}
"{{{.}}}": "{{{.}}}"{{^-last}}, "{{name}}": {{{value}}}{{^-last}},
{{/-last}} {{/-last}}
{{/values}} {{/enumVars}}
{{/allowableValues}} {{/allowableValues}}
}; };

View File

@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -3,6 +3,12 @@
## Enum ## Enum
* `{values&#x3D;[_abc, -efg, (xyz)], enumVars&#x3D;[{name&#x3D;_ABC, value&#x3D;&quot;_abc&quot;}, {name&#x3D;_EFG, value&#x3D;&quot;-efg&quot;}, {name&#x3D;_XYZ_, value&#x3D;&quot;(xyz)&quot;}]}`
* `_ABC` (value: `"_abc"`)
* `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `"(xyz)"`)

View File

@ -23,7 +23,7 @@ Fake endpoint for testing various parameters
FakeApi apiInstance = new FakeApi(); FakeApi apiInstance = new FakeApi();
String number = "number_example"; // String | None BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String string = "string_example"; // String | None String string = "string_example"; // String | None
byte[] _byte = B; // byte[] | None byte[] _byte = B; // byte[] | None
@ -47,7 +47,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**number** | **String**| None | **number** | **BigDecimal**| None |
**_double** | **Double**| None | **_double** | **Double**| None |
**string** | **String**| None | **string** | **String**| None |
**_byte** | **byte[]**| None | **_byte** | **byte[]**| None |

View File

@ -15,6 +15,7 @@ Name | Type | Description | Notes
**binary** | **byte[]** | | [optional] **binary** | **byte[]** | | [optional]
**date** | [**Date**](Date.md) | | **date** | [**Date**](Date.md) | |
**dateTime** | [**Date**](Date.md) | | [optional] **dateTime** | [**Date**](Date.md) | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | | **password** | **String** | |

View File

@ -7,6 +7,7 @@ import io.swagger.client.ApiClient;
import io.swagger.client.Configuration; import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.ArrayList; import java.util.ArrayList;
@ -51,7 +52,7 @@ public class FakeApi {
* @param password None (optional) * @param password None (optional)
* @throws ApiException if fails to make API call * @throws ApiException if fails to make API call
*/ */
public void testEndpointParameters(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { public void testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'number' is set // verify the required parameter 'number' is set

View File

@ -8,8 +8,8 @@ import io.swagger.client.Configuration;
import io.swagger.client.Pair; import io.swagger.client.Pair;
import io.swagger.client.model.Pet; import io.swagger.client.model.Pet;
import java.io.File;
import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.ModelApiResponse;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
/**
* AnimalFarm
*/
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -2,6 +2,7 @@ package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.ArrayList; import java.util.ArrayList;
@ -10,7 +11,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import feign.*; import feign.*;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:05.435+08:00")
public interface FakeApi extends ApiClient.Api { public interface FakeApi extends ApiClient.Api {
@ -36,5 +37,5 @@ public interface FakeApi extends ApiClient.Api {
"Content-type: application/x-www-form-urlencoded", "Content-type: application/x-www-form-urlencoded",
"Accepts: application/json", "Accepts: application/json",
}) })
void testEndpointParameters(@Param("number") String number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") Date date, @Param("dateTime") Date dateTime, @Param("password") String password); void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") Date date, @Param("dateTime") Date dateTime, @Param("password") String password);
} }

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
/**
* AnimalFarm
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:05.435+08:00")
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -11,7 +11,7 @@ import java.util.Date;
/** /**
* FormatTest * FormatTest
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:05.435+08:00")
public class FormatTest { public class FormatTest {
private Integer integer = null; private Integer integer = null;
@ -25,6 +25,7 @@ public class FormatTest {
private byte[] binary = null; private byte[] binary = null;
private Date date = null; private Date date = null;
private Date dateTime = null; private Date dateTime = null;
private String uuid = null;
private String password = null; private String password = null;
@ -225,6 +226,23 @@ public class FormatTest {
} }
/**
**/
public FormatTest uuid(String uuid) {
this.uuid = uuid;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("uuid")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
/** /**
**/ **/
public FormatTest password(String password) { public FormatTest password(String password) {
@ -262,12 +280,13 @@ public class FormatTest {
Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.binary, formatTest.binary) &&
Objects.equals(this.date, formatTest.date) && Objects.equals(this.date, formatTest.date) &&
Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password); Objects.equals(this.password, formatTest.password);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
} }
@Override @Override
@ -286,6 +305,7 @@ public class FormatTest {
sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();

View File

@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -0,0 +1,14 @@
# EnumClass
## Enum
* `_ABC` (value: `"_abc"`)
* `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `"(xyz)"`)

View File

@ -0,0 +1,36 @@
# EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
<a name="EnumStringEnum"></a>
## Enum: EnumStringEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
<a name="EnumIntegerEnum"></a>
## Enum: EnumIntegerEnum
Name | Value
---- | -----
NUMBER_1 | 1
NUMBER_MINUS_1 | -1
<a name="EnumNumberEnum"></a>
## Enum: EnumNumberEnum
Name | Value
---- | -----
NUMBER_1_DOT_1 | 1.1
NUMBER_MINUS_1_DOT_2 | -1.2

View File

@ -0,0 +1,75 @@
# FakeApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
Fake endpoint for testing various parameters
Fake endpoint for testing various parameters
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String string = "string_example"; // String | None
byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None
Float _float = 3.4F; // Float | None
byte[] binary = B; // byte[] | None
Date date = new Date(); // Date | None
Date dateTime = new Date(); // Date | None
String password = "password_example"; // String | None
try {
apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEndpointParameters");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **BigDecimal**| None |
**_double** | **Double**| None |
**string** | **String**| None |
**_byte** | **byte[]**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Long**| None | [optional]
**_float** | **Float**| None | [optional]
**binary** | **byte[]**| None | [optional]
**date** | **Date**| None | [optional]
**dateTime** | **Date**| None | [optional]
**password** | **String**| None | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -11,11 +11,12 @@ Name | Type | Description | Notes
**_float** | **Float** | | [optional] **_float** | **Float** | | [optional]
**_double** | **Double** | | [optional] **_double** | **Double** | | [optional]
**string** | **String** | | [optional] **string** | **String** | | [optional]
**_byte** | **byte[]** | | [optional] **_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional] **binary** | **byte[]** | | [optional]
**date** | [**Date**](Date.md) | | [optional] **date** | [**Date**](Date.md) | |
**dateTime** | [**Date**](Date.md) | | [optional] **dateTime** | [**Date**](Date.md) | | [optional]
**password** | **String** | | [optional] **uuid** | **String** | | [optional]
**password** | **String** | |

View File

@ -16,9 +16,9 @@ Name | Type | Description | Notes
## Enum: StatusEnum ## Enum: StatusEnum
Name | Value Name | Value
---- | ----- ---- | -----
PLACED | placed PLACED | &quot;placed&quot;
APPROVED | approved APPROVED | &quot;approved&quot;
DELIVERED | delivered DELIVERED | &quot;delivered&quot;

View File

@ -16,9 +16,9 @@ Name | Type | Description | Notes
## Enum: StatusEnum ## Enum: StatusEnum
Name | Value Name | Value
---- | ----- ---- | -----
AVAILABLE | available AVAILABLE | &quot;available&quot;
PENDING | pending PENDING | &quot;pending&quot;
SOLD | sold SOLD | &quot;sold&quot;

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -0,0 +1,128 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import java.math.BigDecimal;
import java.util.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class FakeApi {
private ApiClient apiClient;
public FakeApi() {
this(Configuration.getDefaultApiClient());
}
public FakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Fake endpoint for testing various parameters
* Fake endpoint for testing various parameters
* @param number None (required)
* @param _double None (required)
* @param string None (required)
* @param _byte None (required)
* @param integer None (optional)
* @param int32 None (optional)
* @param int64 None (optional)
* @param _float None (optional)
* @param binary None (optional)
* @param date None (optional)
* @param dateTime None (optional)
* @param password None (optional)
* @throws ApiException if fails to make API call
*/
public void testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'number' is set
if (number == null) {
throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters");
}
// verify the required parameter '_double' is set
if (_double == null) {
throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters");
}
// verify the required parameter 'string' is set
if (string == null) {
throw new ApiException(400, "Missing the required parameter 'string' when calling testEndpointParameters");
}
// verify the required parameter '_byte' is set
if (_byte == null) {
throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters");
}
// create path and map variables
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (integer != null)
localVarFormParams.put("integer", integer);
if (int32 != null)
localVarFormParams.put("int32", int32);
if (int64 != null)
localVarFormParams.put("int64", int64);
if (number != null)
localVarFormParams.put("number", number);
if (_float != null)
localVarFormParams.put("float", _float);
if (_double != null)
localVarFormParams.put("double", _double);
if (string != null)
localVarFormParams.put("string", string);
if (_byte != null)
localVarFormParams.put("byte", _byte);
if (binary != null)
localVarFormParams.put("binary", binary);
if (date != null)
localVarFormParams.put("date", date);
if (dateTime != null)
localVarFormParams.put("dateTime", dateTime);
if (password != null)
localVarFormParams.put("password", password);
final String[] localVarAccepts = {
"application/xml", "application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
}
}

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* Animal * Animal
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Animal { public class Animal {
private String className = null; private String className = null;
@ -32,7 +32,6 @@ public class Animal {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
/**
* AnimalFarm
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -10,7 +10,7 @@ import io.swagger.client.model.Animal;
/** /**
* Cat * Cat
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Cat extends Animal { public class Cat extends Animal {
private String className = null; private String className = null;
@ -51,7 +51,6 @@ public class Cat extends Animal {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* Category * Category
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Category { public class Category {
private Long id = null; private Long id = null;
@ -50,7 +50,6 @@ public class Category {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -10,7 +10,7 @@ import io.swagger.client.model.Animal;
/** /**
* Dog * Dog
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Dog extends Animal { public class Dog extends Animal {
private String className = null; private String className = null;
@ -51,7 +51,6 @@ public class Dog extends Animal {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -10,7 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* EnumTest * EnumTest
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class EnumTest { public class EnumTest {
@ -132,7 +132,6 @@ public class EnumTest {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -8,10 +8,10 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/**
* FormatTest
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class FormatTest { public class FormatTest {
private Integer integer = null; private Integer integer = null;
@ -25,10 +25,13 @@ public class FormatTest {
private byte[] binary = null; private byte[] binary = null;
private Date date = null; private Date date = null;
private Date dateTime = null; private Date dateTime = null;
private String uuid = null;
private String password = null; private String password = null;
/** /**
* minimum: 10.0
* maximum: 100.0
**/ **/
public FormatTest integer(Integer integer) { public FormatTest integer(Integer integer) {
this.integer = integer; this.integer = integer;
@ -46,6 +49,8 @@ public class FormatTest {
/** /**
* minimum: 20.0
* maximum: 200.0
**/ **/
public FormatTest int32(Integer int32) { public FormatTest int32(Integer int32) {
this.int32 = int32; this.int32 = int32;
@ -80,6 +85,8 @@ public class FormatTest {
/** /**
* minimum: 32.1
* maximum: 543.2
**/ **/
public FormatTest number(BigDecimal number) { public FormatTest number(BigDecimal number) {
this.number = number; this.number = number;
@ -97,6 +104,8 @@ public class FormatTest {
/** /**
* minimum: 54.3
* maximum: 987.6
**/ **/
public FormatTest _float(Float _float) { public FormatTest _float(Float _float) {
this._float = _float; this._float = _float;
@ -114,6 +123,8 @@ public class FormatTest {
/** /**
* minimum: 67.8
* maximum: 123.4
**/ **/
public FormatTest _double(Double _double) { public FormatTest _double(Double _double) {
this._double = _double; this._double = _double;
@ -154,7 +165,7 @@ public class FormatTest {
return this; return this;
} }
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("byte") @JsonProperty("byte")
public byte[] getByte() { public byte[] getByte() {
return _byte; return _byte;
@ -188,7 +199,7 @@ public class FormatTest {
return this; return this;
} }
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("date") @JsonProperty("date")
public Date getDate() { public Date getDate() {
return date; return date;
@ -215,6 +226,23 @@ public class FormatTest {
} }
/**
**/
public FormatTest uuid(String uuid) {
this.uuid = uuid;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("uuid")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
/** /**
**/ **/
public FormatTest password(String password) { public FormatTest password(String password) {
@ -222,7 +250,7 @@ public class FormatTest {
return this; return this;
} }
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("password") @JsonProperty("password")
public String getPassword() { public String getPassword() {
return password; return password;
@ -252,12 +280,13 @@ public class FormatTest {
Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.binary, formatTest.binary) &&
Objects.equals(this.date, formatTest.date) && Objects.equals(this.date, formatTest.date) &&
Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password); Objects.equals(this.password, formatTest.password);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
} }
@Override @Override
@ -276,6 +305,7 @@ public class FormatTest {
sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();

View File

@ -7,9 +7,10 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* Model200Response * Model for testing model name starting with number
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @ApiModel(description = "Model for testing model name starting with number")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Model200Response { public class Model200Response {
private Integer name = null; private Integer name = null;
@ -32,7 +33,6 @@ public class Model200Response {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/**
* ModelApiResponse
*/
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-23T12:58:40.273+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class ModelApiResponse { public class ModelApiResponse {
private Integer code = null; private Integer code = null;

View File

@ -7,9 +7,10 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* ModelReturn * Model for testing reserved words
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @ApiModel(description = "Model for testing reserved words")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class ModelReturn { public class ModelReturn {
private Integer _return = null; private Integer _return = null;
@ -32,7 +33,6 @@ public class ModelReturn {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -7,13 +7,15 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* Name * Model for testing model name same as property name
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @ApiModel(description = "Model for testing model name same as property name")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Name { public class Name {
private Integer name = null; private Integer name = null;
private Integer snakeCase = null; private Integer snakeCase = null;
private String property = null;
/** /**
@ -23,7 +25,7 @@ public class Name {
return this; return this;
} }
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("name") @JsonProperty("name")
public Integer getName() { public Integer getName() {
return name; return name;
@ -33,22 +35,28 @@ public class Name {
} }
/**
**/
public Name snakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
return this;
}
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("snake_case") @JsonProperty("snake_case")
public Integer getSnakeCase() { public Integer getSnakeCase() {
return snakeCase; return snakeCase;
} }
public void setSnakeCase(Integer snakeCase) {
this.snakeCase = snakeCase;
/**
**/
public Name property(String property) {
this.property = property;
return this;
} }
@ApiModelProperty(example = "null", value = "")
@JsonProperty("property")
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
@Override @Override
@ -61,12 +69,13 @@ public class Name {
} }
Name name = (Name) o; Name name = (Name) o;
return Objects.equals(this.name, name.name) && return Objects.equals(this.name, name.name) &&
Objects.equals(this.snakeCase, name.snakeCase); Objects.equals(this.snakeCase, name.snakeCase) &&
Objects.equals(this.property, name.property);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(name, snakeCase); return Objects.hash(name, snakeCase, property);
} }
@Override @Override
@ -76,6 +85,7 @@ public class Name {
sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }

View File

@ -11,7 +11,7 @@ import java.util.Date;
/** /**
* Order * Order
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Order { public class Order {
private Long id = null; private Long id = null;
@ -40,15 +40,25 @@ public class Order {
} }
} }
private StatusEnum status = StatusEnum.PLACED; private StatusEnum status = null;
private Boolean complete = null; private Boolean complete = false;
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "") @ApiModelProperty(example = "null", value = "")
@JsonProperty("id") @JsonProperty("id")
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) {
this.id = id;
}
/** /**
@ -137,7 +147,6 @@ public class Order {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -14,7 +14,7 @@ import java.util.List;
/** /**
* Pet * Pet
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Pet { public class Pet {
private Long id = null; private Long id = null;
@ -150,7 +150,6 @@ public class Pet {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* SpecialModelName * SpecialModelName
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class SpecialModelName { public class SpecialModelName {
private Long specialPropertyName = null; private Long specialPropertyName = null;
@ -32,7 +32,6 @@ public class SpecialModelName {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* Tag * Tag
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class Tag { public class Tag {
private Long id = null; private Long id = null;
@ -50,7 +50,6 @@ public class Tag {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
/** /**
* User * User
*/ */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-12T23:06:12.393+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-06T18:35:03.551+08:00")
public class User { public class User {
private Long id = null; private Long id = null;
@ -159,7 +159,6 @@ public class User {
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {

View File

@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -4,11 +4,11 @@
## Enum ## Enum
* `_ABC` (value: `&quot;_abc&quot;`) * `_ABC` (value: `"_abc"`)
* `_EFG` (value: `&quot;-efg&quot;`) * `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `&quot;(xyz)&quot;`) * `_XYZ_` (value: `"(xyz)"`)

View File

@ -23,7 +23,7 @@ Fake endpoint for testing various parameters
FakeApi apiInstance = new FakeApi(); FakeApi apiInstance = new FakeApi();
String number = "number_example"; // String | None BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String string = "string_example"; // String | None String string = "string_example"; // String | None
byte[] _byte = B; // byte[] | None byte[] _byte = B; // byte[] | None
@ -47,7 +47,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**number** | **String**| None | **number** | **BigDecimal**| None |
**_double** | **Double**| None | **_double** | **Double**| None |
**string** | **String**| None | **string** | **String**| None |
**_byte** | **byte[]**| None | **_byte** | **byte[]**| None |

View File

@ -15,6 +15,7 @@ Name | Type | Description | Notes
**binary** | **byte[]** | | [optional] **binary** | **byte[]** | | [optional]
**date** | [**Date**](Date.md) | | **date** | [**Date**](Date.md) | |
**dateTime** | [**Date**](Date.md) | | [optional] **dateTime** | [**Date**](Date.md) | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | | **password** | **String** | |

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -17,6 +17,7 @@ import com.squareup.okhttp.Response;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@ -45,7 +46,7 @@ public class FakeApi {
} }
/* Build call for testEndpointParameters */ /* Build call for testEndpointParameters */
private Call testEndpointParametersCall(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { private Call testEndpointParametersCall(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null; Object localVarPostBody = null;
// verify the required parameter 'number' is set // verify the required parameter 'number' is set
@ -147,7 +148,7 @@ public class FakeApi {
* @param password None (optional) * @param password None (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/ */
public void testEndpointParameters(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { public void testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
testEndpointParametersWithHttpInfo(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); testEndpointParametersWithHttpInfo(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
} }
@ -169,7 +170,7 @@ public class FakeApi {
* @return ApiResponse<Void> * @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/ */
public ApiResponse<Void> testEndpointParametersWithHttpInfo(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException { public ApiResponse<Void> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, null, null); Call call = testEndpointParametersCall(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password, null, null);
return apiClient.execute(call); return apiClient.execute(call);
} }
@ -193,7 +194,7 @@ public class FakeApi {
* @return The request call * @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object * @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/ */
public Call testEndpointParametersAsync(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ApiCallback<Void> callback) throws ApiException { public Call testEndpointParametersAsync(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null; ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
/**
* AnimalFarm
*/
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -47,6 +47,9 @@ public class FormatTest {
@SerializedName("dateTime") @SerializedName("dateTime")
private Date dateTime = null; private Date dateTime = null;
@SerializedName("uuid")
private String uuid = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
@ -170,6 +173,16 @@ public class FormatTest {
this.dateTime = dateTime; this.dateTime = dateTime;
} }
/**
**/
@ApiModelProperty(value = "")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
/** /**
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(required = true, value = "")
@ -201,12 +214,13 @@ public class FormatTest {
Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.binary, formatTest.binary) &&
Objects.equals(this.date, formatTest.date) && Objects.equals(this.date, formatTest.date) &&
Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.dateTime, formatTest.dateTime) &&
Objects.equals(this.uuid, formatTest.uuid) &&
Objects.equals(this.password, formatTest.password); Objects.equals(this.password, formatTest.password);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
} }
@Override @Override
@ -225,6 +239,7 @@ public class FormatTest {
sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -6,6 +6,7 @@ import retrofit.Callback;
import retrofit.http.*; import retrofit.http.*;
import retrofit.mime.*; import retrofit.mime.*;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.ArrayList; import java.util.ArrayList;
@ -36,7 +37,7 @@ public interface FakeApi {
@FormUrlEncoded @FormUrlEncoded
@POST("/fake") @POST("/fake")
Void testEndpointParameters( Void testEndpointParameters(
@Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password
); );
/** /**
@ -61,6 +62,6 @@ public interface FakeApi {
@FormUrlEncoded @FormUrlEncoded
@POST("/fake") @POST("/fake")
void testEndpointParameters( void testEndpointParameters(
@Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password, Callback<Void> cb @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password, Callback<Void> cb
); );
} }

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AnimalFarm animalFarm = (AnimalFarm) o;
return true;
}
@Override
public int hashCode() {
return Objects.hash();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -47,6 +47,9 @@ public class FormatTest {
@SerializedName("dateTime") @SerializedName("dateTime")
private Date dateTime = null; private Date dateTime = null;
@SerializedName("uuid")
private String uuid = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
@ -170,6 +173,16 @@ public class FormatTest {
this.dateTime = dateTime; this.dateTime = dateTime;
} }
/**
**/
@ApiModelProperty(value = "")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
/** /**
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(required = true, value = "")
@ -201,12 +214,13 @@ public class FormatTest {
Objects.equals(binary, formatTest.binary) && Objects.equals(binary, formatTest.binary) &&
Objects.equals(date, formatTest.date) && Objects.equals(date, formatTest.date) &&
Objects.equals(dateTime, formatTest.dateTime) && Objects.equals(dateTime, formatTest.dateTime) &&
Objects.equals(uuid, formatTest.uuid) &&
Objects.equals(password, formatTest.password); Objects.equals(password, formatTest.password);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
} }
@Override @Override
@ -225,6 +239,7 @@ public class FormatTest {
sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -8,6 +8,7 @@ import retrofit2.http.*;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.ArrayList; import java.util.ArrayList;
@ -37,7 +38,7 @@ public interface FakeApi {
@FormUrlEncoded @FormUrlEncoded
@POST("fake") @POST("fake")
Call<Void> testEndpointParameters( Call<Void> testEndpointParameters(
@Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password @Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password
); );
} }

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AnimalFarm animalFarm = (AnimalFarm) o;
return true;
}
@Override
public int hashCode() {
return Objects.hash();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -47,6 +47,9 @@ public class FormatTest {
@SerializedName("dateTime") @SerializedName("dateTime")
private Date dateTime = null; private Date dateTime = null;
@SerializedName("uuid")
private String uuid = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
@ -170,6 +173,16 @@ public class FormatTest {
this.dateTime = dateTime; this.dateTime = dateTime;
} }
/**
**/
@ApiModelProperty(value = "")
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
/** /**
**/ **/
@ApiModelProperty(required = true, value = "") @ApiModelProperty(required = true, value = "")
@ -201,12 +214,13 @@ public class FormatTest {
Objects.equals(binary, formatTest.binary) && Objects.equals(binary, formatTest.binary) &&
Objects.equals(date, formatTest.date) && Objects.equals(date, formatTest.date) &&
Objects.equals(dateTime, formatTest.dateTime) && Objects.equals(dateTime, formatTest.dateTime) &&
Objects.equals(uuid, formatTest.uuid) &&
Objects.equals(password, formatTest.password); Objects.equals(password, formatTest.password);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password); return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
} }
@Override @Override
@ -225,6 +239,7 @@ public class FormatTest {
sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
sb.append(" date: ").append(toIndentedString(date)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).append("\n");
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID" git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID" git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -0,0 +1,53 @@
package io.swagger.client.model;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.annotations.SerializedName;
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AnimalFarm animalFarm = (AnimalFarm) o;
return true;
}
@Override
public int hashCode() {
return Objects.hash();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AnimalFarm {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.UUID;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
@ -49,7 +48,7 @@ public class FormatTest {
private Date dateTime = null; private Date dateTime = null;
@SerializedName("uuid") @SerializedName("uuid")
private UUID uuid = null; private String uuid = null;
@SerializedName("password") @SerializedName("password")
private String password = null; private String password = null;
@ -177,10 +176,10 @@ public class FormatTest {
/** /**
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public UUID getUuid() { public String getUuid() {
return uuid; return uuid;
} }
public void setUuid(UUID uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }

View File

@ -1,12 +1,12 @@
# swagger-petstore # swagger-petstore
SwaggerPetstore - JavaScript client for swagger-petstore SwaggerPetstore - JavaScript client for swagger-petstore
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
- Build date: 2016-05-01T12:08:53.092+08:00 - Build date: 2016-05-06T17:51:36.114+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation ## Installation
@ -53,18 +53,27 @@ Please follow the [installation](#installation) instruction and execute the foll
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var defaultClient = SwaggerPetstore.ApiClient.default; var api = new SwaggerPetstore.FakeApi()
// Configure OAuth2 access token for authorization: petstore_auth var _number = 3.4; // {Number} None
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var _double = 1.2; // {Number} None
var _string = "_string_example"; // {String} None
var _byte = "B"; // {String} None
var opts = { var opts = {
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store 'integer': 56, // {Integer} None
'int32': 56, // {Integer} None
'int64': 789, // {Integer} None
'_float': 3.4, // {Number} None
'binary': "B", // {String} None
'_date': new Date("2013-10-20"), // {Date} None
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // {Date} None
'password': "password_example" // {String} None
}; };
api.addPet(opts).then(function() { api.testEndpointParameters(_number, _double, _string, _byte, opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -79,6 +88,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
*SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
*SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
*SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
@ -103,9 +113,21 @@ Class | Method | HTTP request | Description
## Documentation for Models ## Documentation for Models
- [SwaggerPetstore.Animal](docs/Animal.md)
- [SwaggerPetstore.AnimalFarm](docs/AnimalFarm.md)
- [SwaggerPetstore.ApiResponse](docs/ApiResponse.md)
- [SwaggerPetstore.Cat](docs/Cat.md)
- [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.Category](docs/Category.md)
- [SwaggerPetstore.Dog](docs/Dog.md)
- [SwaggerPetstore.EnumClass](docs/EnumClass.md)
- [SwaggerPetstore.EnumTest](docs/EnumTest.md)
- [SwaggerPetstore.FormatTest](docs/FormatTest.md)
- [SwaggerPetstore.Model200Response](docs/Model200Response.md)
- [SwaggerPetstore.ModelReturn](docs/ModelReturn.md)
- [SwaggerPetstore.Name](docs/Name.md)
- [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.Order](docs/Order.md)
- [SwaggerPetstore.Pet](docs/Pet.md) - [SwaggerPetstore.Pet](docs/Pet.md)
- [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md)
- [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.Tag](docs/Tag.md)
- [SwaggerPetstore.User](docs/User.md) - [SwaggerPetstore.User](docs/User.md)
@ -113,12 +135,6 @@ Class | Method | HTTP request | Description
## Documentation for Authorization ## Documentation for Authorization
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
### petstore_auth ### petstore_auth
- **Type**: OAuth - **Type**: OAuth
@ -128,3 +144,9 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account - write:pets: modify pets in your account
- read:pets: read your pets - read:pets: read your pets
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

View File

@ -0,0 +1,7 @@
# SwaggerPetstore.AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -0,0 +1,10 @@
# SwaggerPetstore.ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# SwaggerPetstore.EnumClass
## Enum
* `_abc` (value: `"_abc"`)
* `-efg` (value: `"-efg"`)
* `(xyz)` (value: `"(xyz)"`)

View File

@ -0,0 +1,43 @@
# SwaggerPetstore.EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | **String** | | [optional]
**enumInteger** | **Integer** | | [optional]
**enumNumber** | **Number** | | [optional]
<a name="EnumStringEnum"></a>
## Enum: EnumStringEnum
* `UPPER` (value: `"UPPER"`)
* `lower` (value: `"lower"`)
<a name="EnumIntegerEnum"></a>
## Enum: EnumIntegerEnum
* `1` (value: `1`)
* `-1` (value: `-1`)
<a name="EnumNumberEnum"></a>
## Enum: EnumNumberEnum
* `1.1` (value: `1.1`)
* `-1.2` (value: `-1.2`)

View File

@ -0,0 +1,79 @@
# SwaggerPetstore.FakeApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(_number, _double, _string, _byte, opts)
Fake endpoint for testing various parameters
Fake endpoint for testing various parameters
### Example
```javascript
var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.FakeApi();
var _number = 3.4; // Number | None
var _double = 1.2; // Number | None
var _string = "_string_example"; // String | None
var _byte = "B"; // String | None
var opts = {
'integer': 56, // Integer | None
'int32': 56, // Integer | None
'int64': 789, // Integer | None
'_float': 3.4, // Number | None
'binary': "B", // String | None
'_date': new Date("2013-10-20"), // Date | None
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None
'password': "password_example" // String | None
};
apiInstance.testEndpointParameters(_number, _double, _string, _byte, opts).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**_number** | **Number**| None |
**_double** | **Number**| None |
**_string** | **String**| None |
**_byte** | **String**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Integer**| None | [optional]
**_float** | **Number**| None | [optional]
**binary** | **String**| None | [optional]
**_date** | **Date**| None | [optional]
**dateTime** | **Date**| None | [optional]
**password** | **String**| None | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -10,9 +10,11 @@ Name | Type | Description | Notes
**_float** | **Number** | | [optional] **_float** | **Number** | | [optional]
**_double** | **Number** | | [optional] **_double** | **Number** | | [optional]
**_string** | **String** | | [optional] **_string** | **String** | | [optional]
**_byte** | **String** | | [optional] **_byte** | **String** | |
**binary** | **String** | | [optional] **binary** | **String** | | [optional]
**_date** | **Date** | | [optional] **_date** | **Date** | |
**dateTime** | **String** | | [optional] **dateTime** | **Date** | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | |

View File

@ -1,13 +0,0 @@
# SwaggerPetstore.InlineResponse200
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tags** | [**[Tag]**](Tag.md) | | [optional]
**id** | **Integer** | |
**category** | **Object** | | [optional]
**status** | **String** | pet status in the store | [optional]
**name** | **String** | | [optional]
**photoUrls** | **[String]** | | [optional]

View File

@ -5,5 +5,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **Integer** | | **name** | **Integer** | |
**snakeCase** | **Integer** | | [optional] **snakeCase** | **Integer** | | [optional]
**property** | **String** | | [optional]

View File

@ -8,6 +8,19 @@ Name | Type | Description | Notes
**quantity** | **Integer** | | [optional] **quantity** | **Integer** | | [optional]
**shipDate** | **Date** | | [optional] **shipDate** | **Date** | | [optional]
**status** | **String** | Order Status | [optional] **status** | **String** | Order Status | [optional]
**complete** | **Boolean** | | [optional] **complete** | **Boolean** | | [optional] [default to false]
<a name="StatusEnum"></a>
## Enum: StatusEnum
* `placed` (value: `"placed"`)
* `approved` (value: `"approved"`)
* `delivered` (value: `"delivered"`)

View File

@ -11,3 +11,16 @@ Name | Type | Description | Notes
**status** | **String** | pet status in the store | [optional] **status** | **String** | pet status in the store | [optional]
<a name="StatusEnum"></a>
## Enum: StatusEnum
* `available` (value: `"available"`)
* `pending` (value: `"pending"`)
* `sold` (value: `"sold"`)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="addPet"></a> <a name="addPet"></a>
# **addPet** # **addPet**
> addPet(opts) > addPet(body)
Add a new pet to the store Add a new pet to the store
@ -33,10 +33,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var opts = { var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
}; apiInstance.addPet(body).then(function() {
apiInstance.addPet(opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -48,7 +47,7 @@ apiInstance.addPet(opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -61,7 +60,7 @@ null (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="deletePet"></a> <a name="deletePet"></a>
# **deletePet** # **deletePet**
@ -113,15 +112,15 @@ null (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> [Pet] findPetsByStatus(opts) > [Pet] findPetsByStatus(status)
Finds Pets by status Finds Pets by status
Multiple status values can be provided with comma seperated strings Multiple status values can be provided with comma separated strings
### Example ### Example
```javascript ```javascript
@ -134,10 +133,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var opts = { var status = ["status_example"]; // [String] | Status values that need to be considered for filter
'status': ["available"] // [String] | Status values that need to be considered for filter
}; apiInstance.findPetsByStatus(status).then(function(data) {
apiInstance.findPetsByStatus(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -149,7 +147,7 @@ apiInstance.findPetsByStatus(opts).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**[String]**](String.md)| Status values that need to be considered for filter | [optional] [default to available] **status** | [**[String]**](String.md)| Status values that need to be considered for filter |
### Return type ### Return type
@ -162,15 +160,15 @@ Name | Type | Description | Notes
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> [Pet] findPetsByTags(opts) > [Pet] findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example ### Example
```javascript ```javascript
@ -183,10 +181,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var opts = { var tags = ["tags_example"]; // [String] | Tags to filter by
'tags': ["tags_example"] // [String] | Tags to filter by
}; apiInstance.findPetsByTags(tags).then(function(data) {
apiInstance.findPetsByTags(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -198,7 +195,7 @@ apiInstance.findPetsByTags(opts).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**[String]**](String.md)| Tags to filter by | [optional] **tags** | [**[String]**](String.md)| Tags to filter by |
### Return type ### Return type
@ -211,7 +208,7 @@ Name | Type | Description | Notes
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="getPetById"></a> <a name="getPetById"></a>
# **getPetById** # **getPetById**
@ -219,7 +216,7 @@ Name | Type | Description | Notes
Find pet by ID Find pet by ID
Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions Returns a single pet
### Example ### Example
```javascript ```javascript
@ -232,13 +229,9 @@ api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token'; //api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet that needs to be fetched var petId = 789; // Integer | ID of pet to return
apiInstance.getPetById(petId).then(function(data) { apiInstance.getPetById(petId).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
@ -252,7 +245,7 @@ apiInstance.getPetById(petId).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet that needs to be fetched | **petId** | **Integer**| ID of pet to return |
### Return type ### Return type
@ -260,16 +253,16 @@ Name | Type | Description | Notes
### Authorization ### Authorization
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) [api_key](../README.md#api_key)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="updatePet"></a> <a name="updatePet"></a>
# **updatePet** # **updatePet**
> updatePet(opts) > updatePet(body)
Update an existing pet Update an existing pet
@ -286,10 +279,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var opts = { var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
}; apiInstance.updatePet(body).then(function() {
apiInstance.updatePet(opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -301,7 +293,7 @@ apiInstance.updatePet(opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -314,7 +306,7 @@ null (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="updatePetWithForm"></a> <a name="updatePetWithForm"></a>
# **updatePetWithForm** # **updatePetWithForm**
@ -335,7 +327,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi(); var apiInstance = new SwaggerPetstore.PetApi();
var petId = "petId_example"; // String | ID of pet that needs to be updated var petId = 789; // Integer | ID of pet that needs to be updated
var opts = { var opts = {
'name': "name_example", // String | Updated name of the pet 'name': "name_example", // String | Updated name of the pet
@ -353,7 +345,7 @@ apiInstance.updatePetWithForm(petId, opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **String**| ID of pet that needs to be updated | **petId** | **Integer**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional] **name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional] **status** | **String**| Updated status of the pet | [optional]
@ -368,11 +360,11 @@ null (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded - **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="uploadFile"></a> <a name="uploadFile"></a>
# **uploadFile** # **uploadFile**
> uploadFile(petId, opts) > ApiResponse uploadFile(petId, opts)
uploads an image uploads an image
@ -395,8 +387,8 @@ var opts = {
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server 'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
'file': "/path/to/file.txt" // File | file to upload 'file': "/path/to/file.txt" // File | file to upload
}; };
apiInstance.uploadFile(petId, opts).then(function() { apiInstance.uploadFile(petId, opts).then(function(data) {
console.log('API called successfully.'); console.log('API called successfully. Returned data: ' + data);
}, function(error) { }, function(error) {
console.error(error); console.error(error);
}); });
@ -413,7 +405,7 @@ Name | Type | Description | Notes
### Return type ### Return type
null (empty response body) [**ApiResponse**](ApiResponse.md)
### Authorization ### Authorization
@ -422,5 +414,5 @@ null (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: multipart/form-data - **Content-Type**: multipart/form-data
- **Accept**: application/json, application/xml - **Accept**: application/json

View File

@ -51,7 +51,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="getInventory"></a> <a name="getInventory"></a>
# **getInventory** # **getInventory**
@ -95,7 +95,7 @@ This endpoint does not need any parameter.
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/json
<a name="getOrderById"></a> <a name="getOrderById"></a>
# **getOrderById** # **getOrderById**
@ -111,7 +111,7 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.StoreApi(); var apiInstance = new SwaggerPetstore.StoreApi();
var orderId = "orderId_example"; // String | ID of pet that needs to be fetched var orderId = 789; // Integer | ID of pet that needs to be fetched
apiInstance.getOrderById(orderId).then(function(data) { apiInstance.getOrderById(orderId).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
@ -125,7 +125,7 @@ apiInstance.getOrderById(orderId).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of pet that needs to be fetched | **orderId** | **Integer**| ID of pet that needs to be fetched |
### Return type ### Return type
@ -138,11 +138,11 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="placeOrder"></a> <a name="placeOrder"></a>
# **placeOrder** # **placeOrder**
> Order placeOrder(opts) > Order placeOrder(body)
Place an order for a pet Place an order for a pet
@ -154,10 +154,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.StoreApi(); var apiInstance = new SwaggerPetstore.StoreApi();
var opts = { var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
'body': new SwaggerPetstore.Order() // Order | order placed for purchasing the pet
}; apiInstance.placeOrder(body).then(function(data) {
apiInstance.placeOrder(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -169,7 +168,7 @@ apiInstance.placeOrder(opts).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] **body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type ### Return type
@ -182,5 +181,5 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createUser"></a> <a name="createUser"></a>
# **createUser** # **createUser**
> createUser(opts) > createUser(body)
Create user Create user
@ -28,10 +28,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi(); var apiInstance = new SwaggerPetstore.UserApi();
var opts = { var body = new SwaggerPetstore.User(); // User | Created user object
'body': new SwaggerPetstore.User() // User | Created user object
}; apiInstance.createUser(body).then(function() {
apiInstance.createUser(opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -43,7 +42,7 @@ apiInstance.createUser(opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | [optional] **body** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -56,11 +55,11 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="createUsersWithArrayInput"></a> <a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput** # **createUsersWithArrayInput**
> createUsersWithArrayInput(opts) > createUsersWithArrayInput(body)
Creates list of users with given input array Creates list of users with given input array
@ -72,10 +71,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi(); var apiInstance = new SwaggerPetstore.UserApi();
var opts = { var body = [new SwaggerPetstore.User()]; // [User] | List of user object
'body': [new SwaggerPetstore.User()] // [User] | List of user object
}; apiInstance.createUsersWithArrayInput(body).then(function() {
apiInstance.createUsersWithArrayInput(opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -87,7 +85,7 @@ apiInstance.createUsersWithArrayInput(opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**[User]**](User.md)| List of user object | [optional] **body** | [**[User]**](User.md)| List of user object |
### Return type ### Return type
@ -100,11 +98,11 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="createUsersWithListInput"></a> <a name="createUsersWithListInput"></a>
# **createUsersWithListInput** # **createUsersWithListInput**
> createUsersWithListInput(opts) > createUsersWithListInput(body)
Creates list of users with given input array Creates list of users with given input array
@ -116,10 +114,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi(); var apiInstance = new SwaggerPetstore.UserApi();
var opts = { var body = [new SwaggerPetstore.User()]; // [User] | List of user object
'body': [new SwaggerPetstore.User()] // [User] | List of user object
}; apiInstance.createUsersWithListInput(body).then(function() {
apiInstance.createUsersWithListInput(opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -131,7 +128,7 @@ apiInstance.createUsersWithListInput(opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**[User]**](User.md)| List of user object | [optional] **body** | [**[User]**](User.md)| List of user object |
### Return type ### Return type
@ -144,7 +141,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="deleteUser"></a> <a name="deleteUser"></a>
# **deleteUser** # **deleteUser**
@ -187,7 +184,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="getUserByName"></a> <a name="getUserByName"></a>
# **getUserByName** # **getUserByName**
@ -230,11 +227,11 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="loginUser"></a> <a name="loginUser"></a>
# **loginUser** # **loginUser**
> &#39;String&#39; loginUser(opts) > &#39;String&#39; loginUser(username, password)
Logs user into the system Logs user into the system
@ -246,11 +243,11 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi(); var apiInstance = new SwaggerPetstore.UserApi();
var opts = { var username = "username_example"; // String | The user name for login
'username': "username_example", // String | The user name for login
'password': "password_example" // String | The password for login in clear text var password = "password_example"; // String | The password for login in clear text
};
apiInstance.loginUser(opts).then(function(data) { apiInstance.loginUser(username, password).then(function(data) {
console.log('API called successfully. Returned data: ' + data); console.log('API called successfully. Returned data: ' + data);
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -262,8 +259,8 @@ apiInstance.loginUser(opts).then(function(data) {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login | [optional] **username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text | [optional] **password** | **String**| The password for login in clear text |
### Return type ### Return type
@ -276,7 +273,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="logoutUser"></a> <a name="logoutUser"></a>
# **logoutUser** # **logoutUser**
@ -313,11 +310,11 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json
<a name="updateUser"></a> <a name="updateUser"></a>
# **updateUser** # **updateUser**
> updateUser(username, opts) > updateUser(username, body)
Updated user Updated user
@ -331,10 +328,9 @@ var apiInstance = new SwaggerPetstore.UserApi();
var username = "username_example"; // String | name that need to be deleted var username = "username_example"; // String | name that need to be deleted
var opts = { var body = new SwaggerPetstore.User(); // User | Updated user object
'body': new SwaggerPetstore.User() // User | Updated user object
}; apiInstance.updateUser(username, body).then(function() {
apiInstance.updateUser(username, opts).then(function() {
console.log('API called successfully.'); console.log('API called successfully.');
}, function(error) { }, function(error) {
console.error(error); console.error(error);
@ -347,7 +343,7 @@ apiInstance.updateUser(username, opts).then(function() {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted | **username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | [optional] **body** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -360,5 +356,5 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json, application/xml - **Accept**: application/xml, application/json

View File

@ -1,7 +1,7 @@
{ {
"name": "swagger-petstore", "name": "swagger-petstore",
"version": "1.0.0", "version": "1.0.0",
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters", "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.",
"license": "Apache 2.0", "license": "Apache 2.0",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {

View File

@ -40,8 +40,8 @@
* @type {Array.<String>} * @type {Array.<String>}
*/ */
this.authentications = { this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, 'petstore_auth': {type: 'oauth2'},
'petstore_auth': {type: 'oauth2'} 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}
}; };
/** /**
* The default HTTP headers to be included for all API calls. * The default HTTP headers to be included for all API calls.

View File

@ -0,0 +1,113 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Fake service.
* @module api/FakeApi
* @version 1.0.0
*/
/**
* Constructs a new FakeApi.
* @alias module:api/FakeApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Fake endpoint for testing various parameters
* Fake endpoint for testing various parameters
* @param {Number} _number None
* @param {Number} _double None
* @param {String} _string None
* @param {String} _byte None
* @param {Object} opts Optional parameters
* @param {Integer} opts.integer None
* @param {Integer} opts.int32 None
* @param {Integer} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts.binary None
* @param {Date} opts._date None
* @param {Date} opts.dateTime None
* @param {String} opts.password None
*/
this.testEndpointParameters = function(_number, _double, _string, _byte, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter '_number' is set
if (_number == undefined || _number == null) {
throw "Missing the required parameter '_number' when calling testEndpointParameters";
}
// verify the required parameter '_double' is set
if (_double == undefined || _double == null) {
throw "Missing the required parameter '_double' when calling testEndpointParameters";
}
// verify the required parameter '_string' is set
if (_string == undefined || _string == null) {
throw "Missing the required parameter '_string' when calling testEndpointParameters";
}
// verify the required parameter '_byte' is set
if (_byte == undefined || _byte == null) {
throw "Missing the required parameter '_byte' when calling testEndpointParameters";
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'integer': opts['integer'],
'int32': opts['int32'],
'int64': opts['int64'],
'number': _number,
'float': opts['_float'],
'double': _double,
'string': _string,
'byte': _byte,
'binary': opts['binary'],
'date': opts['_date'],
'dateTime': opts['dateTime'],
'password': opts['password']
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/fake', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
};
return exports;
}));

View File

@ -1,18 +1,18 @@
(function(root, factory) { (function(root, factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['ApiClient', 'model/Pet'], factory); define(['ApiClient', 'model/Pet', 'model/ApiResponse'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Pet')); module.exports = factory(require('../ApiClient'), require('../model/Pet'), require('../model/ApiResponse'));
} else { } else {
// Browser globals (root is window) // Browser globals (root is window)
if (!root.SwaggerPetstore) { if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {}; root.SwaggerPetstore = {};
} }
root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet); root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet, root.SwaggerPetstore.ApiResponse);
} }
}(this, function(ApiClient, Pet) { }(this, function(ApiClient, Pet, ApiResponse) {
'use strict'; 'use strict';
/** /**
@ -36,12 +36,15 @@
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
* @param {Object} opts Optional parameters * @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} opts.body Pet object that needs to be added to the store
*/ */
this.addPet = function(opts) { this.addPet = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling addPet";
}
var pathParams = { var pathParams = {
@ -55,7 +58,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml']; var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -96,7 +99,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -109,20 +112,23 @@
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma seperated strings * Multiple status values can be provided with comma separated strings
* @param {Object} opts Optional parameters * @param {Array.<String>} status Status values that need to be considered for filter
* @param {Array.<String>} opts.status Status values that need to be considered for filter (default to available)
* data is of type: {Array.<module:model/Pet>} * data is of type: {Array.<module:model/Pet>}
*/ */
this.findPetsByStatus = function(opts) { this.findPetsByStatus = function(status) {
opts = opts || {};
var postBody = null; var postBody = null;
// verify the required parameter 'status' is set
if (status == undefined || status == null) {
throw "Missing the required parameter 'status' when calling findPetsByStatus";
}
var pathParams = { var pathParams = {
}; };
var queryParams = { var queryParams = {
'status': this.apiClient.buildCollectionParam(opts['status'], 'multi') 'status': this.apiClient.buildCollectionParam(status, 'csv')
}; };
var headerParams = { var headerParams = {
}; };
@ -131,7 +137,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = [Pet]; var returnType = [Pet];
return this.apiClient.callApi( return this.apiClient.callApi(
@ -144,20 +150,23 @@
/** /**
* Finds Pets by tags * Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param {Object} opts Optional parameters * @param {Array.<String>} tags Tags to filter by
* @param {Array.<String>} opts.tags Tags to filter by
* data is of type: {Array.<module:model/Pet>} * data is of type: {Array.<module:model/Pet>}
*/ */
this.findPetsByTags = function(opts) { this.findPetsByTags = function(tags) {
opts = opts || {};
var postBody = null; var postBody = null;
// verify the required parameter 'tags' is set
if (tags == undefined || tags == null) {
throw "Missing the required parameter 'tags' when calling findPetsByTags";
}
var pathParams = { var pathParams = {
}; };
var queryParams = { var queryParams = {
'tags': this.apiClient.buildCollectionParam(opts['tags'], 'multi') 'tags': this.apiClient.buildCollectionParam(tags, 'csv')
}; };
var headerParams = { var headerParams = {
}; };
@ -166,7 +175,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = [Pet]; var returnType = [Pet];
return this.apiClient.callApi( return this.apiClient.callApi(
@ -179,8 +188,8 @@
/** /**
* Find pet by ID * Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions * Returns a single pet
* @param {Integer} petId ID of pet that needs to be fetched * @param {Integer} petId ID of pet to return
* data is of type: {module:model/Pet} * data is of type: {module:model/Pet}
*/ */
this.getPetById = function(petId) { this.getPetById = function(petId) {
@ -202,9 +211,9 @@
var formParams = { var formParams = {
}; };
var authNames = ['api_key', 'petstore_auth']; var authNames = ['api_key'];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = Pet; var returnType = Pet;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -218,12 +227,15 @@
/** /**
* Update an existing pet * Update an existing pet
* *
* @param {Object} opts Optional parameters * @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} opts.body Pet object that needs to be added to the store
*/ */
this.updatePet = function(opts) { this.updatePet = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling updatePet";
}
var pathParams = { var pathParams = {
@ -237,7 +249,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml']; var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -251,7 +263,7 @@
/** /**
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param {String} petId ID of pet that needs to be updated * @param {Integer} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters * @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet * @param {String} opts.name Updated name of the pet
* @param {String} opts.status Updated status of the pet * @param {String} opts.status Updated status of the pet
@ -280,7 +292,7 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = ['application/x-www-form-urlencoded']; var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -298,6 +310,7 @@
* @param {Object} opts Optional parameters * @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server * @param {String} opts.additionalMetadata Additional data to pass to server
* @param {File} opts.file file to upload * @param {File} opts.file file to upload
* data is of type: {module:model/ApiResponse}
*/ */
this.uploadFile = function(petId, opts) { this.uploadFile = function(petId, opts) {
opts = opts || {}; opts = opts || {};
@ -323,8 +336,8 @@
var authNames = ['petstore_auth']; var authNames = ['petstore_auth'];
var contentTypes = ['multipart/form-data']; var contentTypes = ['multipart/form-data'];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/json'];
var returnType = null; var returnType = ApiResponse;
return this.apiClient.callApi( return this.apiClient.callApi(
'/pet/{petId}/uploadImage', 'POST', '/pet/{petId}/uploadImage', 'POST',

View File

@ -59,7 +59,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -90,7 +90,7 @@
var authNames = ['api_key']; var authNames = ['api_key'];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/json'];
var returnType = {'String': 'Integer'}; var returnType = {'String': 'Integer'};
return this.apiClient.callApi( return this.apiClient.callApi(
@ -104,7 +104,7 @@
/** /**
* Find purchase order by ID * Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions * For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {String} orderId ID of pet that needs to be fetched * @param {Integer} orderId ID of pet that needs to be fetched
* data is of type: {module:model/Order} * data is of type: {module:model/Order}
*/ */
this.getOrderById = function(orderId) { this.getOrderById = function(orderId) {
@ -128,7 +128,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = Order; var returnType = Order;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -142,13 +142,16 @@
/** /**
* Place an order for a pet * Place an order for a pet
* *
* @param {Object} opts Optional parameters * @param {module:model/Order} body order placed for purchasing the pet
* @param {module:model/Order} opts.body order placed for purchasing the pet
* data is of type: {module:model/Order} * data is of type: {module:model/Order}
*/ */
this.placeOrder = function(opts) { this.placeOrder = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling placeOrder";
}
var pathParams = { var pathParams = {
@ -162,7 +165,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = Order; var returnType = Order;
return this.apiClient.callApi( return this.apiClient.callApi(

View File

@ -36,12 +36,15 @@
/** /**
* Create user * Create user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param {Object} opts Optional parameters * @param {module:model/User} body Created user object
* @param {module:model/User} opts.body Created user object
*/ */
this.createUser = function(opts) { this.createUser = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUser";
}
var pathParams = { var pathParams = {
@ -55,7 +58,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -69,12 +72,15 @@
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param {Object} opts Optional parameters * @param {Array.<module:model/User>} body List of user object
* @param {Array.<module:model/User>} opts.body List of user object
*/ */
this.createUsersWithArrayInput = function(opts) { this.createUsersWithArrayInput = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUsersWithArrayInput";
}
var pathParams = { var pathParams = {
@ -88,7 +94,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -102,12 +108,15 @@
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param {Object} opts Optional parameters * @param {Array.<module:model/User>} body List of user object
* @param {Array.<module:model/User>} opts.body List of user object
*/ */
this.createUsersWithListInput = function(opts) { this.createUsersWithListInput = function(body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUsersWithListInput";
}
var pathParams = { var pathParams = {
@ -121,7 +130,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -158,7 +167,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -196,7 +205,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = User; var returnType = User;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -210,21 +219,29 @@
/** /**
* Logs user into the system * Logs user into the system
* *
* @param {Object} opts Optional parameters * @param {String} username The user name for login
* @param {String} opts.username The user name for login * @param {String} password The password for login in clear text
* @param {String} opts.password The password for login in clear text
* data is of type: {'String'} * data is of type: {'String'}
*/ */
this.loginUser = function(opts) { this.loginUser = function(username, password) {
opts = opts || {};
var postBody = null; var postBody = null;
// verify the required parameter 'username' is set
if (username == undefined || username == null) {
throw "Missing the required parameter 'username' when calling loginUser";
}
// verify the required parameter 'password' is set
if (password == undefined || password == null) {
throw "Missing the required parameter 'password' when calling loginUser";
}
var pathParams = { var pathParams = {
}; };
var queryParams = { var queryParams = {
'username': opts['username'], 'username': username,
'password': opts['password'] 'password': password
}; };
var headerParams = { var headerParams = {
}; };
@ -233,7 +250,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = 'String'; var returnType = 'String';
return this.apiClient.callApi( return this.apiClient.callApi(
@ -263,7 +280,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
@ -278,18 +295,21 @@
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param {String} username name that need to be deleted * @param {String} username name that need to be deleted
* @param {Object} opts Optional parameters * @param {module:model/User} body Updated user object
* @param {module:model/User} opts.body Updated user object
*/ */
this.updateUser = function(username, opts) { this.updateUser = function(username, body) {
opts = opts || {}; var postBody = body;
var postBody = opts['body'];
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == undefined || username == null) { if (username == undefined || username == null) {
throw "Missing the required parameter 'username' when calling updateUser"; throw "Missing the required parameter 'username' when calling updateUser";
} }
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling updateUser";
}
var pathParams = { var pathParams = {
'username': username 'username': username
@ -303,7 +323,7 @@
var authNames = []; var authNames = [];
var contentTypes = []; var contentTypes = [];
var accepts = ['application/json', 'application/xml']; var accepts = ['application/xml', 'application/json'];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(

View File

@ -1,16 +1,16 @@
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['ApiClient', 'model/Category', 'model/Order', 'model/Pet', 'model/Tag', 'model/User', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); define(['ApiClient', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/Cat', 'model/Category', 'model/Dog', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/Order'), require('./model/Pet'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); module.exports = factory(require('./ApiClient'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/Cat'), require('./model/Category'), require('./model/Dog'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
} }
}(function(ApiClient, Category, Order, Pet, Tag, User, PetApi, StoreApi, UserApi) { }(function(ApiClient, Animal, AnimalFarm, ApiResponse, Cat, Category, Dog, EnumClass, EnumTest, FormatTest, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) {
'use strict'; 'use strict';
/** /**
* This is a sample server Petstore server. You can find out more about Swagger at &lt;a href&#x3D;\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters.<br> * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose..<br>
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API. * The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
* <p> * <p>
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
@ -46,11 +46,66 @@
* @property {module:ApiClient} * @property {module:ApiClient}
*/ */
ApiClient: ApiClient, ApiClient: ApiClient,
/**
* The Animal model constructor.
* @property {module:model/Animal}
*/
Animal: Animal,
/**
* The AnimalFarm model constructor.
* @property {module:model/AnimalFarm}
*/
AnimalFarm: AnimalFarm,
/**
* The ApiResponse model constructor.
* @property {module:model/ApiResponse}
*/
ApiResponse: ApiResponse,
/**
* The Cat model constructor.
* @property {module:model/Cat}
*/
Cat: Cat,
/** /**
* The Category model constructor. * The Category model constructor.
* @property {module:model/Category} * @property {module:model/Category}
*/ */
Category: Category, Category: Category,
/**
* The Dog model constructor.
* @property {module:model/Dog}
*/
Dog: Dog,
/**
* The EnumClass model constructor.
* @property {module:model/EnumClass}
*/
EnumClass: EnumClass,
/**
* The EnumTest model constructor.
* @property {module:model/EnumTest}
*/
EnumTest: EnumTest,
/**
* The FormatTest model constructor.
* @property {module:model/FormatTest}
*/
FormatTest: FormatTest,
/**
* The Model200Response model constructor.
* @property {module:model/Model200Response}
*/
Model200Response: Model200Response,
/**
* The ModelReturn model constructor.
* @property {module:model/ModelReturn}
*/
ModelReturn: ModelReturn,
/**
* The Name model constructor.
* @property {module:model/Name}
*/
Name: Name,
/** /**
* The Order model constructor. * The Order model constructor.
* @property {module:model/Order} * @property {module:model/Order}
@ -61,6 +116,11 @@
* @property {module:model/Pet} * @property {module:model/Pet}
*/ */
Pet: Pet, Pet: Pet,
/**
* The SpecialModelName model constructor.
* @property {module:model/SpecialModelName}
*/
SpecialModelName: SpecialModelName,
/** /**
* The Tag model constructor. * The Tag model constructor.
* @property {module:model/Tag} * @property {module:model/Tag}
@ -71,6 +131,11 @@
* @property {module:model/User} * @property {module:model/User}
*/ */
User: User, User: User,
/**
* The FakeApi service constructor.
* @property {module:api/FakeApi}
*/
FakeApi: FakeApi,
/** /**
* The PetApi service constructor. * The PetApi service constructor.
* @property {module:api/PetApi} * @property {module:api/PetApi}

View File

@ -1,7 +1,7 @@
(function(root, factory) { (function(root, factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['../ApiClient'], factory); define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient')); module.exports = factory(require('../ApiClient'));
@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Animal model module. * The Animal model module.
* @module model/Animal * @module model/Animal
@ -28,8 +31,9 @@
* @param className * @param className
*/ */
var exports = function(className) { var exports = function(className) {
var _this = this;
this['className'] = className; _this['className'] = className;
}; };
/** /**
@ -50,7 +54,6 @@
return obj; return obj;
} }
/** /**
* @member {String} className * @member {String} className
*/ */
@ -61,3 +64,5 @@
return exports; return exports;
})); }));

View File

@ -0,0 +1,64 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.AnimalFarm = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The AnimalFarm model module.
* @module model/AnimalFarm
* @version 1.0.0
*/
/**
* Constructs a new <code>AnimalFarm</code>.
* @alias module:model/AnimalFarm
* @class
* @extends Array
*/
var exports = function() {
var _this = this;
_this = new Array();
Object.setPrototypeOf(_this, exports);
return _this;
};
/**
* Constructs a <code>AnimalFarm</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AnimalFarm} obj Optional instance to populate.
* @return {module:model/AnimalFarm} The populated <code>AnimalFarm</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
ApiClient.constructFromObject(data, obj, Animal);
}
return obj;
}
return exports;
}));

View File

@ -0,0 +1,83 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ApiResponse model module.
* @module model/ApiResponse
* @version 1.0.0
*/
/**
* Constructs a new <code>ApiResponse</code>.
* @alias module:model/ApiResponse
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ApiResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ApiResponse} obj Optional instance to populate.
* @return {module:model/ApiResponse} The populated <code>ApiResponse</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Integer');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('message')) {
obj['message'] = ApiClient.convertToType(data['message'], 'String');
}
}
return obj;
}
/**
* @member {Integer} code
*/
exports.prototype['code'] = undefined;
/**
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* @member {String} message
*/
exports.prototype['message'] = undefined;
return exports;
}));

View File

@ -1,7 +1,7 @@
(function(root, factory) { (function(root, factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['../ApiClient', './Animal'], factory); define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal')); module.exports = factory(require('../ApiClient'), require('./Animal'));
@ -15,6 +15,9 @@
}(this, function(ApiClient, Animal) { }(this, function(ApiClient, Animal) {
'use strict'; 'use strict';
/** /**
* The Cat model module. * The Cat model module.
* @module model/Cat * @module model/Cat
@ -29,7 +32,8 @@
* @param className * @param className
*/ */
var exports = function(className) { var exports = function(className) {
Animal.call(this, className); var _this = this;
Animal.call(_this, className);
}; };
@ -54,7 +58,6 @@
exports.prototype = Object.create(Animal.prototype); exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports; exports.prototype.constructor = exports;
/** /**
* @member {Boolean} declawed * @member {Boolean} declawed
*/ */
@ -65,3 +68,5 @@
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Category model module. * The Category model module.
* @module model/Category * @module model/Category
@ -54,12 +57,10 @@
return obj; return obj;
} }
/** /**
* @member {Integer} id * @member {Integer} id
*/ */
exports.prototype['id'] = undefined; exports.prototype['id'] = undefined;
/** /**
* @member {String} name * @member {String} name
*/ */
@ -70,3 +71,5 @@
return exports; return exports;
})); }));

View File

@ -1,7 +1,7 @@
(function(root, factory) { (function(root, factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['../ApiClient', './Animal'], factory); define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal')); module.exports = factory(require('../ApiClient'), require('./Animal'));
@ -15,6 +15,9 @@
}(this, function(ApiClient, Animal) { }(this, function(ApiClient, Animal) {
'use strict'; 'use strict';
/** /**
* The Dog model module. * The Dog model module.
* @module model/Dog * @module model/Dog
@ -29,7 +32,8 @@
* @param className * @param className
*/ */
var exports = function(className) { var exports = function(className) {
Animal.call(this, className); var _this = this;
Animal.call(_this, className);
}; };
@ -54,7 +58,6 @@
exports.prototype = Object.create(Animal.prototype); exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports; exports.prototype.constructor = exports;
/** /**
* @member {String} breed * @member {String} breed
*/ */
@ -65,3 +68,5 @@
return exports; return exports;
})); }));

View File

@ -0,0 +1,44 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Enum class EnumClass.
* @enum {}
* @readonly
*/
var exports = {
/**
* value: "_abc"
* @const
*/
"_abc": "_abc",
/**
* value: "-efg"
* @const
*/
"-efg": "-efg",
/**
* value: "(xyz)"
* @const
*/
"(xyz)": "(xyz)" };
return exports;
}));

View File

@ -0,0 +1,131 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The EnumTest model module.
* @module model/EnumTest
* @version 1.0.0
*/
/**
* Constructs a new <code>EnumTest</code>.
* @alias module:model/EnumTest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>EnumTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/EnumTest} obj Optional instance to populate.
* @return {module:model/EnumTest} The populated <code>EnumTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('enum_string')) {
obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String');
}
if (data.hasOwnProperty('enum_integer')) {
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Integer');
}
if (data.hasOwnProperty('enum_number')) {
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
}
}
return obj;
}
/**
* @member {module:model/EnumTest.EnumStringEnum} enum_string
*/
exports.prototype['enum_string'] = undefined;
/**
* @member {module:model/EnumTest.EnumIntegerEnum} enum_integer
*/
exports.prototype['enum_integer'] = undefined;
/**
* @member {module:model/EnumTest.EnumNumberEnum} enum_number
*/
exports.prototype['enum_number'] = undefined;
/**
* Allowed values for the <code>enum_string</code> property.
* @enum {String}
* @readonly
*/
exports.EnumStringEnum = {
/**
* value: "UPPER"
* @const
*/
"UPPER": "UPPER",
/**
* value: "lower"
* @const
*/
"lower": "lower" };
/**
* Allowed values for the <code>enum_integer</code> property.
* @enum {Integer}
* @readonly
*/
exports.EnumIntegerEnum = {
/**
* value: 1
* @const
*/
"1": 1,
/**
* value: -1
* @const
*/
"-1": -1 };
/**
* Allowed values for the <code>enum_number</code> property.
* @enum {Number}
* @readonly
*/
exports.EnumNumberEnum = {
/**
* value: 1.1
* @const
*/
"1.1": 1.1,
/**
* value: -1.2
* @const
*/
"-1.2": -1.2 };
return exports;
}));

View File

@ -1,7 +1,7 @@
(function(root, factory) { (function(root, factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['../ApiClient'], factory); define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) { } else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node. // CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient')); module.exports = factory(require('../ApiClient'));
@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The FormatTest model module. * The FormatTest model module.
* @module model/FormatTest * @module model/FormatTest
@ -26,20 +29,26 @@
* @alias module:model/FormatTest * @alias module:model/FormatTest
* @class * @class
* @param _number * @param _number
* @param _byte
* @param _date
* @param password
*/ */
var exports = function(_number) { var exports = function(_number, _byte, _date, password) {
var _this = this;
this['number'] = _number; _this['number'] = _number;
_this['byte'] = _byte;
_this['date'] = _date;
_this['password'] = password;
}; };
/** /**
@ -84,70 +93,75 @@
obj['date'] = ApiClient.convertToType(data['date'], 'Date'); obj['date'] = ApiClient.convertToType(data['date'], 'Date');
} }
if (data.hasOwnProperty('dateTime')) { if (data.hasOwnProperty('dateTime')) {
obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'String'); obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date');
}
if (data.hasOwnProperty('uuid')) {
obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String');
}
if (data.hasOwnProperty('password')) {
obj['password'] = ApiClient.convertToType(data['password'], 'String');
} }
} }
return obj; return obj;
} }
/** /**
* @member {Integer} integer * @member {Integer} integer
*/ */
exports.prototype['integer'] = undefined; exports.prototype['integer'] = undefined;
/** /**
* @member {Integer} int32 * @member {Integer} int32
*/ */
exports.prototype['int32'] = undefined; exports.prototype['int32'] = undefined;
/** /**
* @member {Integer} int64 * @member {Integer} int64
*/ */
exports.prototype['int64'] = undefined; exports.prototype['int64'] = undefined;
/** /**
* @member {Number} number * @member {Number} number
*/ */
exports.prototype['number'] = undefined; exports.prototype['number'] = undefined;
/** /**
* @member {Number} float * @member {Number} float
*/ */
exports.prototype['float'] = undefined; exports.prototype['float'] = undefined;
/** /**
* @member {Number} double * @member {Number} double
*/ */
exports.prototype['double'] = undefined; exports.prototype['double'] = undefined;
/** /**
* @member {String} string * @member {String} string
*/ */
exports.prototype['string'] = undefined; exports.prototype['string'] = undefined;
/** /**
* @member {String} byte * @member {String} byte
*/ */
exports.prototype['byte'] = undefined; exports.prototype['byte'] = undefined;
/** /**
* @member {String} binary * @member {String} binary
*/ */
exports.prototype['binary'] = undefined; exports.prototype['binary'] = undefined;
/** /**
* @member {Date} date * @member {Date} date
*/ */
exports.prototype['date'] = undefined; exports.prototype['date'] = undefined;
/** /**
* @member {String} dateTime * @member {Date} dateTime
*/ */
exports.prototype['dateTime'] = undefined; exports.prototype['dateTime'] = undefined;
/**
* @member {String} uuid
*/
exports.prototype['uuid'] = undefined;
/**
* @member {String} password
*/
exports.prototype['password'] = undefined;
return exports; return exports;
})); }));

View File

@ -1,132 +0,0 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tag'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.InlineResponse200 = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Tag);
}
}(this, function(ApiClient, Tag) {
'use strict';
/**
* The InlineResponse200 model module.
* @module model/InlineResponse200
* @version 1.0.0
*/
/**
* Constructs a new <code>InlineResponse200</code>.
* @alias module:model/InlineResponse200
* @class
* @param id
*/
var exports = function(id) {
this['id'] = id;
};
/**
* Constructs a <code>InlineResponse200</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/InlineResponse200} obj Optional instance to populate.
* @return {module:model/InlineResponse200} The populated <code>InlineResponse200</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('tags')) {
obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
}
if (data.hasOwnProperty('category')) {
obj['category'] = ApiClient.convertToType(data['category'], Object);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('photoUrls')) {
obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
}
}
return obj;
}
/**
* @member {Array.<module:model/Tag>} tags
*/
exports.prototype['tags'] = undefined;
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Object} category
*/
exports.prototype['category'] = undefined;
/**
* pet status in the store
* @member {module:model/InlineResponse200.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Array.<String>} photoUrls
*/
exports.prototype['photoUrls'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: available
* @const
*/
AVAILABLE: "available",
/**
* value: pending
* @const
*/
PENDING: "pending",
/**
* value: sold
* @const
*/
SOLD: "sold"
};
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Model200Response model module. * The Model200Response model module.
* @module model/Model200Response * @module model/Model200Response
@ -28,6 +31,7 @@
* @class * @class
*/ */
var exports = function() { var exports = function() {
var _this = this;
}; };
@ -50,7 +54,6 @@
return obj; return obj;
} }
/** /**
* @member {Integer} name * @member {Integer} name
*/ */
@ -61,3 +64,5 @@
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The ModelReturn model module. * The ModelReturn model module.
* @module model/ModelReturn * @module model/ModelReturn
@ -28,6 +31,7 @@
* @class * @class
*/ */
var exports = function() { var exports = function() {
var _this = this;
}; };
@ -50,7 +54,6 @@
return obj; return obj;
} }
/** /**
* @member {Integer} return * @member {Integer} return
*/ */
@ -61,3 +64,5 @@
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Name model module. * The Name model module.
* @module model/Name * @module model/Name
@ -29,8 +32,10 @@
* @param name * @param name
*/ */
var exports = function(name) { var exports = function(name) {
var _this = this;
_this['name'] = name;
this['name'] = name;
}; };
@ -51,23 +56,30 @@
if (data.hasOwnProperty('snake_case')) { if (data.hasOwnProperty('snake_case')) {
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer'); obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
} }
if (data.hasOwnProperty('property')) {
obj['property'] = ApiClient.convertToType(data['property'], 'String');
}
} }
return obj; return obj;
} }
/** /**
* @member {Integer} name * @member {Integer} name
*/ */
exports.prototype['name'] = undefined; exports.prototype['name'] = undefined;
/** /**
* @member {Integer} snake_case * @member {Integer} snake_case
*/ */
exports.prototype['snake_case'] = undefined; exports.prototype['snake_case'] = undefined;
/**
* @member {String} property
*/
exports.prototype['property'] = undefined;
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Order model module. * The Order model module.
* @module model/Order * @module model/Order
@ -70,37 +73,32 @@
return obj; return obj;
} }
/** /**
* @member {Integer} id * @member {Integer} id
*/ */
exports.prototype['id'] = undefined; exports.prototype['id'] = undefined;
/** /**
* @member {Integer} petId * @member {Integer} petId
*/ */
exports.prototype['petId'] = undefined; exports.prototype['petId'] = undefined;
/** /**
* @member {Integer} quantity * @member {Integer} quantity
*/ */
exports.prototype['quantity'] = undefined; exports.prototype['quantity'] = undefined;
/** /**
* @member {Date} shipDate * @member {Date} shipDate
*/ */
exports.prototype['shipDate'] = undefined; exports.prototype['shipDate'] = undefined;
/** /**
* Order Status * Order Status
* @member {module:model/Order.StatusEnum} status * @member {module:model/Order.StatusEnum} status
*/ */
exports.prototype['status'] = undefined; exports.prototype['status'] = undefined;
/** /**
* @member {Boolean} complete * @member {Boolean} complete
* @default false
*/ */
exports.prototype['complete'] = undefined; exports.prototype['complete'] = false;
/** /**
@ -110,23 +108,23 @@
*/ */
exports.StatusEnum = { exports.StatusEnum = {
/** /**
* value: placed * value: "placed"
* @const * @const
*/ */
PLACED: "placed", "placed": "placed",
/** /**
* value: approved * value: "approved"
* @const * @const
*/ */
APPROVED: "approved", "approved": "approved",
/** /**
* value: delivered * value: "delivered"
* @const * @const
*/ */
DELIVERED: "delivered" "delivered": "delivered" };
};
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient, Category, Tag) { }(this, function(ApiClient, Category, Tag) {
'use strict'; 'use strict';
/** /**
* The Pet model module. * The Pet model module.
* @module model/Pet * @module model/Pet
@ -72,32 +75,26 @@
return obj; return obj;
} }
/** /**
* @member {Integer} id * @member {Integer} id
*/ */
exports.prototype['id'] = undefined; exports.prototype['id'] = undefined;
/** /**
* @member {module:model/Category} category * @member {module:model/Category} category
*/ */
exports.prototype['category'] = undefined; exports.prototype['category'] = undefined;
/** /**
* @member {String} name * @member {String} name
*/ */
exports.prototype['name'] = undefined; exports.prototype['name'] = undefined;
/** /**
* @member {Array.<String>} photoUrls * @member {Array.<String>} photoUrls
*/ */
exports.prototype['photoUrls'] = undefined; exports.prototype['photoUrls'] = undefined;
/** /**
* @member {Array.<module:model/Tag>} tags * @member {Array.<module:model/Tag>} tags
*/ */
exports.prototype['tags'] = undefined; exports.prototype['tags'] = undefined;
/** /**
* pet status in the store * pet status in the store
* @member {module:model/Pet.StatusEnum} status * @member {module:model/Pet.StatusEnum} status
@ -112,23 +109,23 @@
*/ */
exports.StatusEnum = { exports.StatusEnum = {
/** /**
* value: available * value: "available"
* @const * @const
*/ */
AVAILABLE: "available", "available": "available",
/** /**
* value: pending * value: "pending"
* @const * @const
*/ */
PENDING: "pending", "pending": "pending",
/** /**
* value: sold * value: "sold"
* @const * @const
*/ */
SOLD: "sold" "sold": "sold" };
};
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The SpecialModelName model module. * The SpecialModelName model module.
* @module model/SpecialModelName * @module model/SpecialModelName
@ -27,6 +30,7 @@
* @class * @class
*/ */
var exports = function() { var exports = function() {
var _this = this;
}; };
@ -49,7 +53,6 @@
return obj; return obj;
} }
/** /**
* @member {Integer} $special[property.name] * @member {Integer} $special[property.name]
*/ */
@ -60,3 +63,5 @@
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The Tag model module. * The Tag model module.
* @module model/Tag * @module model/Tag
@ -54,12 +57,10 @@
return obj; return obj;
} }
/** /**
* @member {Integer} id * @member {Integer} id
*/ */
exports.prototype['id'] = undefined; exports.prototype['id'] = undefined;
/** /**
* @member {String} name * @member {String} name
*/ */
@ -70,3 +71,5 @@
return exports; return exports;
})); }));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
/** /**
* The User model module. * The User model module.
* @module model/User * @module model/User
@ -78,42 +81,34 @@
return obj; return obj;
} }
/** /**
* @member {Integer} id * @member {Integer} id
*/ */
exports.prototype['id'] = undefined; exports.prototype['id'] = undefined;
/** /**
* @member {String} username * @member {String} username
*/ */
exports.prototype['username'] = undefined; exports.prototype['username'] = undefined;
/** /**
* @member {String} firstName * @member {String} firstName
*/ */
exports.prototype['firstName'] = undefined; exports.prototype['firstName'] = undefined;
/** /**
* @member {String} lastName * @member {String} lastName
*/ */
exports.prototype['lastName'] = undefined; exports.prototype['lastName'] = undefined;
/** /**
* @member {String} email * @member {String} email
*/ */
exports.prototype['email'] = undefined; exports.prototype['email'] = undefined;
/** /**
* @member {String} password * @member {String} password
*/ */
exports.prototype['password'] = undefined; exports.prototype['password'] = undefined;
/** /**
* @member {String} phone * @member {String} phone
*/ */
exports.prototype['phone'] = undefined; exports.prototype['phone'] = undefined;
/** /**
* User Status * User Status
* @member {Integer} userStatus * @member {Integer} userStatus
@ -125,3 +120,5 @@
return exports; return exports;
})); }));

Some files were not shown because too many files have changed in this diff Show More