Merge branch 'arikon-feature/js-fix-types'

This commit is contained in:
wing328 2016-08-12 10:31:09 +08:00
commit 1dd8c2be9d
72 changed files with 283 additions and 219 deletions

View File

@ -113,7 +113,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
);
languageSpecificPrimitives = new HashSet<String>(
Arrays.asList("String", "Boolean", "Integer", "Number", "Array", "Object", "Date", "File")
Arrays.asList("String", "Boolean", "Number", "Array", "Object", "Date", "File")
);
defaultIncludes = new HashSet<String>(languageSpecificPrimitives);
@ -126,17 +126,17 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
typeMapping.put("List", "Array");
typeMapping.put("boolean", "Boolean");
typeMapping.put("string", "String");
typeMapping.put("int", "Integer"); // Huh? What is JS Integer?
typeMapping.put("int", "Number");
typeMapping.put("float", "Number");
typeMapping.put("number", "Number");
typeMapping.put("DateTime", "Date"); // Should this be dateTime?
typeMapping.put("date", "Date"); // Should this be date?
typeMapping.put("long", "Integer");
typeMapping.put("short", "Integer");
typeMapping.put("DateTime", "Date");
typeMapping.put("date", "Date");
typeMapping.put("long", "Number");
typeMapping.put("short", "Number");
typeMapping.put("char", "String");
typeMapping.put("double", "Number");
typeMapping.put("object", "Object");
typeMapping.put("integer", "Integer");
typeMapping.put("integer", "Number");
// binary not supported in JavaScript client right now, using String as a workaround
typeMapping.put("ByteArray", "String"); // I don't see ByteArray defined in the Swagger docs.
typeMapping.put("binary", "String");

View File

@ -52,10 +52,10 @@ public class JavaScriptModelTest {
Assert.assertEquals(property1.baseName, "id");
Assert.assertEquals(property1.getter, "getId");
Assert.assertEquals(property1.setter, "setId");
Assert.assertEquals(property1.datatype, "Integer");
Assert.assertEquals(property1.datatype, "Number");
Assert.assertEquals(property1.name, "id");
Assert.assertEquals(property1.defaultValue, null);
Assert.assertEquals(property1.baseType, "Integer");
Assert.assertEquals(property1.baseType, "Number");
Assert.assertTrue(property1.hasMore);
Assert.assertTrue(property1.required);
Assert.assertTrue(property1.isNotContainer);

View File

@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-08-06T16:38:11.935+08:00
- Build date: 2016-08-12T10:09:30.190+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation
@ -74,7 +74,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*SwaggerPetstore.FakeApi* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
*SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
*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* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
@ -148,3 +148,7 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets
### http_basic_test
- **Type**: HTTP basic authentication

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**code** | **Number** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **[String]** | | [optional]
**arrayArrayOfInteger** | **[[Integer]]** | | [optional]
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**name** | **String** | | [optional]

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | **String** | | [optional]
**enumInteger** | **Integer** | | [optional]
**enumInteger** | **Number** | | [optional]
**enumNumber** | **Number** | | [optional]

View File

@ -6,7 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
<a name="testClientModel"></a>
@ -61,6 +61,12 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
### Example
```javascript
var SwaggerPetstore = require('swagger_petstore');
var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure HTTP basic authorization: http_basic_test
var http_basic_test = defaultClient.authentications['http_basic_test'];
http_basic_test.username = 'YOUR USERNAME';
http_basic_test.password = 'YOUR PASSWORD';
var apiInstance = new SwaggerPetstore.FakeApi();
@ -73,9 +79,9 @@ 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
'integer': 56, // Number | None
'int32': 56, // Number | None
'int64': 789, // Number | None
'_float': 3.4, // Number | None
'binary': "B", // String | None
'_date': new Date("2013-10-20"), // Date | None
@ -98,9 +104,9 @@ Name | Type | Description | Notes
**_double** | **Number**| None |
**_string** | **String**| None |
**_byte** | **String**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Integer**| None | [optional]
**integer** | **Number**| None | [optional]
**int32** | **Number**| None | [optional]
**int64** | **Number**| None | [optional]
**_float** | **Number**| None | [optional]
**binary** | **String**| None | [optional]
**_date** | **Date**| None | [optional]
@ -113,18 +119,18 @@ null (empty response body)
### Authorization
No authorization required
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
<a name="testEnumQueryParameters"></a>
# **testEnumQueryParameters**
> testEnumQueryParameters(opts)
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(opts)
To test enum query parameters
To test enum parameters
### Example
```javascript
@ -133,11 +139,16 @@ var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.FakeApi();
var opts = {
'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array)
'enumFormString': "-efg", // String | Form parameter enum test (string)
'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array)
'enumHeaderString': "-efg", // String | Header parameter enum test (string)
'enumQueryStringArray': ["enumQueryStringArray_example"], // [String] | Query parameter enum test (string array)
'enumQueryString': "-efg", // String | Query parameter enum test (string)
'enumQueryInteger': 3.4, // Number | Query parameter enum test (double)
'enumQueryDouble': 1.2 // Number | Query parameter enum test (double)
};
apiInstance.testEnumQueryParameters(opts).then(function() {
apiInstance.testEnumParameters(opts).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -149,6 +160,11 @@ apiInstance.testEnumQueryParameters(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg]
**enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg]
**enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg]
**enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer** | **Integer** | | [optional]
**int32** | **Integer** | | [optional]
**int64** | **Integer** | | [optional]
**integer** | **Number** | | [optional]
**int32** | **Number** | | [optional]
**int64** | **Number** | | [optional]
**_number** | **Number** | |
**_float** | **Number** | | [optional]
**_double** | **Number** | | [optional]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**name** | **Number** | | [optional]
**_class** | **String** | | [optional]

View File

@ -3,6 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | | [optional]
**_return** | **Number** | | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional]
**name** | **Number** | |
**snakeCase** | **Number** | | [optional]
**property** | **String** | | [optional]
**_123Number** | **Integer** | | [optional]
**_123Number** | **Number** | | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**petId** | **Integer** | | [optional]
**quantity** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**petId** | **Number** | | [optional]
**quantity** | **Number** | | [optional]
**shipDate** | **Date** | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **Boolean** | | [optional] [default to false]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **[String]** | |

View File

@ -81,7 +81,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | Pet id to delete
var petId = 789; // Number | Pet id to delete
var opts = {
'apiKey': "apiKey_example" // String |
@ -98,7 +98,7 @@ apiInstance.deletePet(petId, opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| Pet id to delete |
**petId** | **Number**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
@ -231,7 +231,7 @@ api_key.apiKey = 'YOUR API KEY';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet to return
var petId = 789; // Number | ID of pet to return
apiInstance.getPetById(petId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
@ -245,7 +245,7 @@ apiInstance.getPetById(petId).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet to return |
**petId** | **Number**| ID of pet to return |
### Return type
@ -327,7 +327,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet that needs to be updated
var petId = 789; // Number | ID of pet that needs to be updated
var opts = {
'name': "name_example", // String | Updated name of the pet
@ -345,7 +345,7 @@ apiInstance.updatePetWithForm(petId, opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet that needs to be updated |
**petId** | **Number**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
@ -381,7 +381,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet to update
var petId = 789; // Number | ID of pet to update
var opts = {
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
@ -399,7 +399,7 @@ apiInstance.uploadFile(petId, opts).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet to update |
**petId** | **Number**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **File**| file to upload | [optional]

View File

@ -3,6 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**specialPropertyName** | **Integer** | | [optional]
**specialPropertyName** | **Number** | | [optional]

View File

@ -55,7 +55,7 @@ No authorization required
<a name="getInventory"></a>
# **getInventory**
> {&#39;String&#39;: &#39;Integer&#39;} getInventory()
> {&#39;String&#39;: &#39;Number&#39;} getInventory()
Returns pet inventories by status
@ -86,7 +86,7 @@ This endpoint does not need any parameter.
### Return type
**{&#39;String&#39;: &#39;Integer&#39;}**
**{&#39;String&#39;: &#39;Number&#39;}**
### Authorization
@ -111,7 +111,7 @@ var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var orderId = 789; // Integer | ID of pet that needs to be fetched
var orderId = 789; // Number | ID of pet that needs to be fetched
apiInstance.getOrderById(orderId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
@ -125,7 +125,7 @@ apiInstance.getOrderById(orderId).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **Integer**| ID of pet that needs to be fetched |
**orderId** | **Number**| ID of pet that needs to be fetched |
### Return type

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**name** | **String** | | [optional]

View File

@ -3,13 +3,13 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **Integer** | User Status | [optional]
**userStatus** | **Number** | User Status | [optional]

View File

@ -65,7 +65,8 @@
*/
this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
'petstore_auth': {type: 'oauth2'}
'petstore_auth': {type: 'oauth2'},
'http_basic_test': {type: 'basic'}
};
/**
* The default HTTP headers to be included for all API calls.

View File

@ -101,9 +101,9 @@
* @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.integer None
* @param {Number} opts.int32 None
* @param {Number} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts.binary None
* @param {Date} opts._date None
@ -157,7 +157,7 @@
'password': opts['password']
};
var authNames = [];
var authNames = ['http_basic_test'];
var contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var returnType = null;
@ -171,14 +171,19 @@
/**
* To test enum query parameters
* To test enum parameters
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.enumFormStringArray Form parameter enum test (string array)
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg)
* @param {Array.<String>} opts.enumHeaderStringArray Header parameter enum test (string array)
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg)
* @param {Array.<module:model/String>} opts.enumQueryStringArray Query parameter enum test (string array)
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg)
* @param {Number} opts.enumQueryInteger Query parameter enum test (double)
* @param {Number} opts.enumQueryDouble Query parameter enum test (double)
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.testEnumQueryParameters = function(opts) {
this.testEnumParameters = function(opts) {
opts = opts || {};
var postBody = null;
@ -186,12 +191,17 @@
var pathParams = {
};
var queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger']
};
var headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
'enum_header_string': opts['enumHeaderString']
};
var formParams = {
'enum_query_string': opts['enumQueryString'],
'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
'enum_form_string': opts['enumFormString'],
'enum_query_double': opts['enumQueryDouble']
};

View File

@ -97,7 +97,7 @@
/**
* Deletes a pet
*
* @param {Integer} petId Pet id to delete
* @param {Number} petId Pet id to delete
* @param {Object} opts Optional parameters
* @param {String} opts.apiKey
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
@ -215,7 +215,7 @@
/**
* Find pet by ID
* Returns a single pet
* @param {Integer} petId ID of pet to return
* @param {Number} petId ID of pet to return
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet}
*/
this.getPetById = function(petId) {
@ -290,7 +290,7 @@
/**
* Updates a pet in the store with form data
*
* @param {Integer} petId ID of pet that needs to be updated
* @param {Number} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
* @param {String} opts.status Updated status of the pet
@ -334,7 +334,7 @@
/**
* uploads an image
*
* @param {Integer} petId ID of pet to update
* @param {Number} petId ID of pet to update
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server
* @param {File} opts.file file to upload

View File

@ -98,7 +98,7 @@
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.<String, {'String': 'Integer'}>}
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.<String, {'String': 'Number'}>}
*/
this.getInventory = function() {
var postBody = null;
@ -116,7 +116,7 @@
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = {'String': 'Integer'};
var returnType = {'String': 'Number'};
return this.apiClient.callApi(
'/store/inventory', 'GET',
@ -129,7 +129,7 @@
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {Integer} orderId ID of pet that needs to be fetched
* @param {Number} orderId ID of pet that needs to be fetched
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
*/
this.getOrderById = function(orderId) {

View File

@ -73,7 +73,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Integer');
obj['code'] = ApiClient.convertToType(data['code'], 'Number');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
@ -86,7 +86,7 @@
}
/**
* @member {Integer} code
* @member {Number} code
*/
exports.prototype['code'] = undefined;
/**

View File

@ -76,7 +76,7 @@
obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']);
}
if (data.hasOwnProperty('array_array_of_integer')) {
obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Integer']]);
obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]);
}
if (data.hasOwnProperty('array_array_of_model')) {
obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]);
@ -90,7 +90,7 @@
*/
exports.prototype['array_of_string'] = undefined;
/**
* @member {Array.<Array.<Integer>>} array_array_of_integer
* @member {Array.<Array.<Number>>} array_array_of_integer
*/
exports.prototype['array_array_of_integer'] = undefined;
/**

View File

@ -72,7 +72,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
@ -82,7 +82,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -76,7 +76,7 @@
obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String');
}
if (data.hasOwnProperty('enum_integer')) {
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Integer');
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number');
}
if (data.hasOwnProperty('enum_number')) {
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
@ -118,7 +118,7 @@
/**
* Allowed values for the <code>enum_integer</code> property.
* @enum {Integer}
* @enum {Number}
* @readonly
*/
exports.EnumIntegerEnum = {

View File

@ -87,13 +87,13 @@
obj = obj || new exports();
if (data.hasOwnProperty('integer')) {
obj['integer'] = ApiClient.convertToType(data['integer'], 'Integer');
obj['integer'] = ApiClient.convertToType(data['integer'], 'Number');
}
if (data.hasOwnProperty('int32')) {
obj['int32'] = ApiClient.convertToType(data['int32'], 'Integer');
obj['int32'] = ApiClient.convertToType(data['int32'], 'Number');
}
if (data.hasOwnProperty('int64')) {
obj['int64'] = ApiClient.convertToType(data['int64'], 'Integer');
obj['int64'] = ApiClient.convertToType(data['int64'], 'Number');
}
if (data.hasOwnProperty('number')) {
obj['number'] = ApiClient.convertToType(data['number'], 'Number');
@ -130,15 +130,15 @@
}
/**
* @member {Integer} integer
* @member {Number} integer
*/
exports.prototype['integer'] = undefined;
/**
* @member {Integer} int32
* @member {Number} int32
*/
exports.prototype['int32'] = undefined;
/**
* @member {Integer} int64
* @member {Number} int64
*/
exports.prototype['int64'] = undefined;
/**

View File

@ -73,7 +73,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('class')) {
obj['class'] = ApiClient.convertToType(data['class'], 'String');
@ -83,7 +83,7 @@
}
/**
* @member {Integer} name
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**

View File

@ -72,14 +72,14 @@
obj = obj || new exports();
if (data.hasOwnProperty('return')) {
obj['return'] = ApiClient.convertToType(data['return'], 'Integer');
obj['return'] = ApiClient.convertToType(data['return'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} return
* @member {Number} return
*/
exports.prototype['return'] = undefined;

View File

@ -53,7 +53,7 @@
* Model for testing model name same as property name
* @alias module:model/Name
* @class
* @param name {Integer}
* @param name {Number}
*/
var exports = function(name) {
var _this = this;
@ -76,27 +76,27 @@
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('snake_case')) {
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number');
}
if (data.hasOwnProperty('property')) {
obj['property'] = ApiClient.convertToType(data['property'], 'String');
}
if (data.hasOwnProperty('123Number')) {
obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Integer');
obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} name
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Integer} snake_case
* @member {Number} snake_case
*/
exports.prototype['snake_case'] = undefined;
/**
@ -104,7 +104,7 @@
*/
exports.prototype['property'] = undefined;
/**
* @member {Integer} 123Number
* @member {Number} 123Number
*/
exports.prototype['123Number'] = undefined;

View File

@ -76,13 +76,13 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('petId')) {
obj['petId'] = ApiClient.convertToType(data['petId'], 'Integer');
obj['petId'] = ApiClient.convertToType(data['petId'], 'Number');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Integer');
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number');
}
if (data.hasOwnProperty('shipDate')) {
obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date');
@ -98,15 +98,15 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Integer} petId
* @member {Number} petId
*/
exports.prototype['petId'] = undefined;
/**
* @member {Integer} quantity
* @member {Number} quantity
*/
exports.prototype['quantity'] = undefined;
/**

View File

@ -78,7 +78,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('category')) {
obj['category'] = Category.constructFromObject(data['category']);
@ -100,7 +100,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -71,14 +71,14 @@
obj = obj || new exports();
if (data.hasOwnProperty('$special[property.name]')) {
obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Integer');
obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} $special[property.name]
* @member {Number} $special[property.name]
*/
exports.prototype['$special[property.name]'] = undefined;

View File

@ -72,7 +72,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
@ -82,7 +82,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -78,7 +78,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('username')) {
obj['username'] = ApiClient.convertToType(data['username'], 'String');
@ -99,14 +99,14 @@
obj['phone'] = ApiClient.convertToType(data['phone'], 'String');
}
if (data.hasOwnProperty('userStatus')) {
obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Integer');
obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
@ -135,7 +135,7 @@
exports.prototype['phone'] = undefined;
/**
* User Status
* @member {Integer} userStatus
* @member {Number} userStatus
*/
exports.prototype['userStatus'] = undefined;

View File

@ -13,6 +13,7 @@ describe('ApiClient', function() {
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
http_basic_test: {type: 'basic'},
api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}
/* comment out the following as these fake security def (testing purpose)
* are removed from the spec, we'll add these back after updating the

View File

@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-08-06T16:38:09.393+08:00
- Build date: 2016-08-12T10:09:27.758+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation
@ -77,7 +77,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*SwaggerPetstore.FakeApi* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
*SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
*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* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
@ -151,3 +151,7 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets
### http_basic_test
- **Type**: HTTP basic authentication

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**code** | **Number** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **[String]** | | [optional]
**arrayArrayOfInteger** | **[[Integer]]** | | [optional]
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**name** | **String** | | [optional]

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | **String** | | [optional]
**enumInteger** | **Integer** | | [optional]
**enumInteger** | **Number** | | [optional]
**enumNumber** | **Number** | | [optional]

View File

@ -6,7 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
<a name="testClientModel"></a>
@ -64,6 +64,12 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
### Example
```javascript
var SwaggerPetstore = require('swagger_petstore');
var defaultClient = SwaggerPetstore.ApiClient.default;
// Configure HTTP basic authorization: http_basic_test
var http_basic_test = defaultClient.authentications['http_basic_test'];
http_basic_test.username = 'YOUR USERNAME';
http_basic_test.password = 'YOUR PASSWORD';
var apiInstance = new SwaggerPetstore.FakeApi();
@ -76,9 +82,9 @@ 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
'integer': 56, // Number | None
'int32': 56, // Number | None
'int64': 789, // Number | None
'_float': 3.4, // Number | None
'binary': "B", // String | None
'_date': new Date("2013-10-20"), // Date | None
@ -104,9 +110,9 @@ Name | Type | Description | Notes
**_double** | **Number**| None |
**_string** | **String**| None |
**_byte** | **String**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Integer**| None | [optional]
**integer** | **Number**| None | [optional]
**int32** | **Number**| None | [optional]
**int64** | **Number**| None | [optional]
**_float** | **Number**| None | [optional]
**binary** | **String**| None | [optional]
**_date** | **Date**| None | [optional]
@ -119,18 +125,18 @@ null (empty response body)
### Authorization
No authorization required
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
<a name="testEnumQueryParameters"></a>
# **testEnumQueryParameters**
> testEnumQueryParameters(opts)
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(opts)
To test enum query parameters
To test enum parameters
### Example
```javascript
@ -139,6 +145,11 @@ var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.FakeApi();
var opts = {
'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array)
'enumFormString': "-efg", // String | Form parameter enum test (string)
'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array)
'enumHeaderString': "-efg", // String | Header parameter enum test (string)
'enumQueryStringArray': ["enumQueryStringArray_example"], // [String] | Query parameter enum test (string array)
'enumQueryString': "-efg", // String | Query parameter enum test (string)
'enumQueryInteger': 3.4, // Number | Query parameter enum test (double)
'enumQueryDouble': 1.2 // Number | Query parameter enum test (double)
@ -151,13 +162,18 @@ var callback = function(error, data, response) {
console.log('API called successfully.');
}
};
apiInstance.testEnumQueryParameters(opts, callback);
apiInstance.testEnumParameters(opts, callback);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional]
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg]
**enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg]
**enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg]
**enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer** | **Integer** | | [optional]
**int32** | **Integer** | | [optional]
**int64** | **Integer** | | [optional]
**integer** | **Number** | | [optional]
**int32** | **Number** | | [optional]
**int64** | **Number** | | [optional]
**_number** | **Number** | |
**_float** | **Number** | | [optional]
**_double** | **Number** | | [optional]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**name** | **Number** | | [optional]
**_class** | **String** | | [optional]

View File

@ -3,6 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | | [optional]
**_return** | **Number** | | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional]
**name** | **Number** | |
**snakeCase** | **Number** | | [optional]
**property** | **String** | | [optional]
**_123Number** | **Integer** | | [optional]
**_123Number** | **Number** | | [optional]

View File

@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**petId** | **Integer** | | [optional]
**quantity** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**petId** | **Number** | | [optional]
**quantity** | **Number** | | [optional]
**shipDate** | **Date** | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **Boolean** | | [optional] [default to false]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **[String]** | |

View File

@ -84,7 +84,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | Pet id to delete
var petId = 789; // Number | Pet id to delete
var opts = {
'apiKey': "apiKey_example" // String |
@ -104,7 +104,7 @@ apiInstance.deletePet(petId, opts, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| Pet id to delete |
**petId** | **Number**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
@ -243,7 +243,7 @@ api_key.apiKey = 'YOUR API KEY';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet to return
var petId = 789; // Number | ID of pet to return
var callback = function(error, data, response) {
@ -260,7 +260,7 @@ apiInstance.getPetById(petId, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet to return |
**petId** | **Number**| ID of pet to return |
### Return type
@ -345,7 +345,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet that needs to be updated
var petId = 789; // Number | ID of pet that needs to be updated
var opts = {
'name': "name_example", // String | Updated name of the pet
@ -366,7 +366,7 @@ apiInstance.updatePetWithForm(petId, opts, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet that needs to be updated |
**petId** | **Number**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
@ -402,7 +402,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = 789; // Integer | ID of pet to update
var petId = 789; // Number | ID of pet to update
var opts = {
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
@ -423,7 +423,7 @@ apiInstance.uploadFile(petId, opts, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet to update |
**petId** | **Number**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **File**| file to upload | [optional]

View File

@ -3,6 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**specialPropertyName** | **Integer** | | [optional]
**specialPropertyName** | **Number** | | [optional]

View File

@ -58,7 +58,7 @@ No authorization required
<a name="getInventory"></a>
# **getInventory**
> {&#39;String&#39;: &#39;Integer&#39;} getInventory()
> {&#39;String&#39;: &#39;Number&#39;} getInventory()
Returns pet inventories by status
@ -92,7 +92,7 @@ This endpoint does not need any parameter.
### Return type
**{&#39;String&#39;: &#39;Integer&#39;}**
**{&#39;String&#39;: &#39;Number&#39;}**
### Authorization
@ -117,7 +117,7 @@ var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var orderId = 789; // Integer | ID of pet that needs to be fetched
var orderId = 789; // Number | ID of pet that needs to be fetched
var callback = function(error, data, response) {
@ -134,7 +134,7 @@ apiInstance.getOrderById(orderId, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **Integer**| ID of pet that needs to be fetched |
**orderId** | **Number**| ID of pet that needs to be fetched |
### Return type

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**name** | **String** | | [optional]

View File

@ -3,13 +3,13 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | | [optional]
**id** | **Number** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **Integer** | User Status | [optional]
**userStatus** | **Number** | User Status | [optional]

View File

@ -65,7 +65,8 @@
*/
this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
'petstore_auth': {type: 'oauth2'}
'petstore_auth': {type: 'oauth2'},
'http_basic_test': {type: 'basic'}
};
/**
* The default HTTP headers to be included for all API calls.

View File

@ -116,9 +116,9 @@
* @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.integer None
* @param {Number} opts.int32 None
* @param {Number} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts.binary None
* @param {Date} opts._date None
@ -172,7 +172,7 @@
'password': opts['password']
};
var authNames = [];
var authNames = ['http_basic_test'];
var contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var returnType = null;
@ -185,22 +185,27 @@
}
/**
* Callback function to receive the result of the testEnumQueryParameters operation.
* @callback module:api/FakeApi~testEnumQueryParametersCallback
* Callback function to receive the result of the testEnumParameters operation.
* @callback module:api/FakeApi~testEnumParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* To test enum query parameters
* To test enum parameters
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.enumFormStringArray Form parameter enum test (string array)
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg)
* @param {Array.<String>} opts.enumHeaderStringArray Header parameter enum test (string array)
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg)
* @param {Array.<module:model/String>} opts.enumQueryStringArray Query parameter enum test (string array)
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg)
* @param {Number} opts.enumQueryInteger Query parameter enum test (double)
* @param {Number} opts.enumQueryDouble Query parameter enum test (double)
* @param {module:api/FakeApi~testEnumQueryParametersCallback} callback The callback function, accepting three arguments: error, data, response
* @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.testEnumQueryParameters = function(opts, callback) {
this.testEnumParameters = function(opts, callback) {
opts = opts || {};
var postBody = null;
@ -208,12 +213,17 @@
var pathParams = {
};
var queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger']
};
var headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
'enum_header_string': opts['enumHeaderString']
};
var formParams = {
'enum_query_string': opts['enumQueryString'],
'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
'enum_form_string': opts['enumFormString'],
'enum_query_double': opts['enumQueryDouble']
};

View File

@ -111,7 +111,7 @@
/**
* Deletes a pet
*
* @param {Integer} petId Pet id to delete
* @param {Number} petId Pet id to delete
* @param {Object} opts Optional parameters
* @param {String} opts.apiKey
* @param {module:api/PetApi~deletePetCallback} callback The callback function, accepting three arguments: error, data, response
@ -252,7 +252,7 @@
/**
* Find pet by ID
* Returns a single pet
* @param {Integer} petId ID of pet to return
* @param {Number} petId ID of pet to return
* @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Pet}
*/
@ -342,7 +342,7 @@
/**
* Updates a pet in the store with form data
*
* @param {Integer} petId ID of pet that needs to be updated
* @param {Number} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
* @param {String} opts.status Updated status of the pet
@ -393,7 +393,7 @@
/**
* uploads an image
*
* @param {Integer} petId ID of pet to update
* @param {Number} petId ID of pet to update
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server
* @param {File} opts.file file to upload

View File

@ -105,7 +105,7 @@
* Callback function to receive the result of the getInventory operation.
* @callback module:api/StoreApi~getInventoryCallback
* @param {String} error Error message, if any.
* @param {Object.<String, {'String': 'Integer'}>} data The data returned by the service call.
* @param {Object.<String, {'String': 'Number'}>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
@ -113,7 +113,7 @@
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Object.<String, {'String': 'Integer'}>}
* data is of type: {@link Object.<String, {'String': 'Number'}>}
*/
this.getInventory = function(callback) {
var postBody = null;
@ -131,7 +131,7 @@
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = {'String': 'Integer'};
var returnType = {'String': 'Number'};
return this.apiClient.callApi(
'/store/inventory', 'GET',
@ -151,7 +151,7 @@
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {Integer} orderId ID of pet that needs to be fetched
* @param {Number} orderId ID of pet that needs to be fetched
* @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Order}
*/

View File

@ -73,7 +73,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Integer');
obj['code'] = ApiClient.convertToType(data['code'], 'Number');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
@ -86,7 +86,7 @@
}
/**
* @member {Integer} code
* @member {Number} code
*/
exports.prototype['code'] = undefined;
/**

View File

@ -76,7 +76,7 @@
obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']);
}
if (data.hasOwnProperty('array_array_of_integer')) {
obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Integer']]);
obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]);
}
if (data.hasOwnProperty('array_array_of_model')) {
obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]);
@ -90,7 +90,7 @@
*/
exports.prototype['array_of_string'] = undefined;
/**
* @member {Array.<Array.<Integer>>} array_array_of_integer
* @member {Array.<Array.<Number>>} array_array_of_integer
*/
exports.prototype['array_array_of_integer'] = undefined;
/**

View File

@ -72,7 +72,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
@ -82,7 +82,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -76,7 +76,7 @@
obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String');
}
if (data.hasOwnProperty('enum_integer')) {
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Integer');
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number');
}
if (data.hasOwnProperty('enum_number')) {
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
@ -118,7 +118,7 @@
/**
* Allowed values for the <code>enum_integer</code> property.
* @enum {Integer}
* @enum {Number}
* @readonly
*/
exports.EnumIntegerEnum = {

View File

@ -87,13 +87,13 @@
obj = obj || new exports();
if (data.hasOwnProperty('integer')) {
obj['integer'] = ApiClient.convertToType(data['integer'], 'Integer');
obj['integer'] = ApiClient.convertToType(data['integer'], 'Number');
}
if (data.hasOwnProperty('int32')) {
obj['int32'] = ApiClient.convertToType(data['int32'], 'Integer');
obj['int32'] = ApiClient.convertToType(data['int32'], 'Number');
}
if (data.hasOwnProperty('int64')) {
obj['int64'] = ApiClient.convertToType(data['int64'], 'Integer');
obj['int64'] = ApiClient.convertToType(data['int64'], 'Number');
}
if (data.hasOwnProperty('number')) {
obj['number'] = ApiClient.convertToType(data['number'], 'Number');
@ -130,15 +130,15 @@
}
/**
* @member {Integer} integer
* @member {Number} integer
*/
exports.prototype['integer'] = undefined;
/**
* @member {Integer} int32
* @member {Number} int32
*/
exports.prototype['int32'] = undefined;
/**
* @member {Integer} int64
* @member {Number} int64
*/
exports.prototype['int64'] = undefined;
/**

View File

@ -73,7 +73,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('class')) {
obj['class'] = ApiClient.convertToType(data['class'], 'String');
@ -83,7 +83,7 @@
}
/**
* @member {Integer} name
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**

View File

@ -72,14 +72,14 @@
obj = obj || new exports();
if (data.hasOwnProperty('return')) {
obj['return'] = ApiClient.convertToType(data['return'], 'Integer');
obj['return'] = ApiClient.convertToType(data['return'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} return
* @member {Number} return
*/
exports.prototype['return'] = undefined;

View File

@ -53,7 +53,7 @@
* Model for testing model name same as property name
* @alias module:model/Name
* @class
* @param name {Integer}
* @param name {Number}
*/
var exports = function(name) {
var _this = this;
@ -76,27 +76,27 @@
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('snake_case')) {
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number');
}
if (data.hasOwnProperty('property')) {
obj['property'] = ApiClient.convertToType(data['property'], 'String');
}
if (data.hasOwnProperty('123Number')) {
obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Integer');
obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} name
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Integer} snake_case
* @member {Number} snake_case
*/
exports.prototype['snake_case'] = undefined;
/**
@ -104,7 +104,7 @@
*/
exports.prototype['property'] = undefined;
/**
* @member {Integer} 123Number
* @member {Number} 123Number
*/
exports.prototype['123Number'] = undefined;

View File

@ -76,13 +76,13 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('petId')) {
obj['petId'] = ApiClient.convertToType(data['petId'], 'Integer');
obj['petId'] = ApiClient.convertToType(data['petId'], 'Number');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Integer');
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number');
}
if (data.hasOwnProperty('shipDate')) {
obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date');
@ -98,15 +98,15 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Integer} petId
* @member {Number} petId
*/
exports.prototype['petId'] = undefined;
/**
* @member {Integer} quantity
* @member {Number} quantity
*/
exports.prototype['quantity'] = undefined;
/**

View File

@ -78,7 +78,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('category')) {
obj['category'] = Category.constructFromObject(data['category']);
@ -100,7 +100,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -71,14 +71,14 @@
obj = obj || new exports();
if (data.hasOwnProperty('$special[property.name]')) {
obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Integer');
obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} $special[property.name]
* @member {Number} $special[property.name]
*/
exports.prototype['$special[property.name]'] = undefined;

View File

@ -72,7 +72,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
@ -82,7 +82,7 @@
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**

View File

@ -78,7 +78,7 @@
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('username')) {
obj['username'] = ApiClient.convertToType(data['username'], 'String');
@ -99,14 +99,14 @@
obj['phone'] = ApiClient.convertToType(data['phone'], 'String');
}
if (data.hasOwnProperty('userStatus')) {
obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Integer');
obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number');
}
}
return obj;
}
/**
* @member {Integer} id
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
@ -135,7 +135,7 @@
exports.prototype['phone'] = undefined;
/**
* User Status
* @member {Integer} userStatus
* @member {Number} userStatus
*/
exports.prototype['userStatus'] = undefined;

View File

@ -13,6 +13,7 @@ describe('ApiClient', function() {
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
http_basic_test: {type: 'basic'},
api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}
/* commented out the following as these fake security def (testing purpose)
* has been removed from the spec, we'll add it back after updating the