Bugfix/3929 do not set multipart (#3932)

* Do not set Content-Type to multipart/form-data
It causes superagent to not add the boundary in the Content-Type

* Run shell-scripts
This commit is contained in:
Andreas Franzén 2016-10-08 06:36:56 +02:00 committed by wing328
parent 04070b32c1
commit d21613c6ab
12 changed files with 106 additions and 94 deletions

View File

@ -363,7 +363,10 @@
var contentType = this.jsonPreferredMime(contentTypes); var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) { if (contentType) {
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
if(contentType != 'multipart/form-data') {
request.type(contentType); request.type(contentType);
}
} else if (!request.header['Content-Type']) { } else if (!request.header['Content-Type']) {
request.type('application/json'); request.type('application/json');
} }

View File

@ -1,12 +1,11 @@
# swagger_petstore____end # swagger_petstore____end____rn_n_r
SwaggerPetstoreEnd - JavaScript client for swagger_petstore____end SwaggerPetstoreEndRnNR - JavaScript client for swagger_petstore____end____rn_n_r
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
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 ' \" =end - API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
- Package version: 1.0.0 =end - Package version: 1.0.0 *_/ =end -- \r\n \n \r
- Build date: 2016-06-29T21:40:05.384+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation ## Installation
@ -21,7 +20,7 @@ please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.co
Then install it via: Then install it via:
```shell ```shell
npm install swagger_petstore____end --save npm install swagger_petstore____end____rn_n_r --save
``` ```
#### git #### git
@ -51,12 +50,12 @@ Then include *bundle.js* in the HTML pages.
Please follow the [installation](#installation) instruction and execute the following JS code: Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript ```javascript
var SwaggerPetstoreEnd = require('swagger_petstore____end'); var SwaggerPetstoreEndRnNR = require('swagger_petstore____end____rn_n_r');
var api = new SwaggerPetstoreEnd.FakeApi() var api = new SwaggerPetstoreEndRnNR.FakeApi()
var opts = { var opts = {
'testCodeInjectEnd': "testCodeInjectEnd_example" // {String} To test code injection ' \" =end 'testCodeInjectEndRnNR': "testCodeInjectEndRnNR_example" // {String} To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
}; };
var callback = function(error, data, response) { var callback = function(error, data, response) {
@ -66,22 +65,22 @@ var callback = function(error, data, response) {
console.log('API called successfully.'); console.log('API called successfully.');
} }
}; };
api.testCodeInjectEnd(opts, callback); api.testCodeInjectEndRnNR(opts, callback);
``` ```
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *https://petstore.swagger.io ' \" =end/v2 ' \" =end* All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*SwaggerPetstoreEnd.FakeApi* | [**testCodeInjectEnd**](docs/FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection ' \" =end *SwaggerPetstoreEndRnNR.FakeApi* | [**testCodeInjectEndRnNR**](docs/FakeApi.md#testCodeInjectEndRnNR) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
## Documentation for Models ## Documentation for Models
- [SwaggerPetstoreEnd.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstoreEndRnNR.ModelReturn](docs/ModelReturn.md)
## Documentation for Authorization ## Documentation for Authorization
@ -90,7 +89,7 @@ Class | Method | HTTP request | Description
### api_key ### api_key
- **Type**: API key - **Type**: API key
- **API key parameter name**: api_key */ ' " =end - **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
- **Location**: HTTP header - **Location**: HTTP header
### petstore_auth ### petstore_auth
@ -99,6 +98,6 @@ Class | Method | HTTP request | Description
- **Flow**: implicit - **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**: - **Scopes**:
- write:pets: modify pets in your account */ ' " =end - write:pets: modify pets in your account *_/ ' \" =end -- \\r\\n \\n \\r
- read:pets: read your pets */ ' " =end - read:pets: read your pets *_/ ' \" =end -- \\r\\n \\n \\r

View File

@ -1,26 +1,26 @@
# SwaggerPetstoreEnd.FakeApi # SwaggerPetstoreEndRnNR.FakeApi
All URIs are relative to *https://petstore.swagger.io ' \" =end/v2 ' \" =end* All URIs are relative to *https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection ' \" =end [**testCodeInjectEndRnNR**](FakeApi.md#testCodeInjectEndRnNR) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
<a name="testCodeInjectEnd"></a> <a name="testCodeInjectEndRnNR"></a>
# **testCodeInjectEnd** # **testCodeInjectEndRnNR**
> testCodeInjectEnd(opts) > testCodeInjectEndRnNR(opts)
To test code injection &#39; \&quot; &#x3D;end To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
### Example ### Example
```javascript ```javascript
var SwaggerPetstoreEnd = require('swagger_petstore____end'); var SwaggerPetstoreEndRnNR = require('swagger_petstore____end____rn_n_r');
var apiInstance = new SwaggerPetstoreEnd.FakeApi(); var apiInstance = new SwaggerPetstoreEndRnNR.FakeApi();
var opts = { var opts = {
'testCodeInjectEnd': "testCodeInjectEnd_example" // String | To test code injection ' \" =end 'testCodeInjectEndRnNR': "testCodeInjectEndRnNR_example" // String | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
}; };
var callback = function(error, data, response) { var callback = function(error, data, response) {
@ -30,14 +30,14 @@ var callback = function(error, data, response) {
console.log('API called successfully.'); console.log('API called successfully.');
} }
}; };
apiInstance.testCodeInjectEnd(opts, callback); apiInstance.testCodeInjectEndRnNR(opts, callback);
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**testCodeInjectEnd** | **String**| To test code injection &#39; \&quot; &#x3D;end | [optional] **testCodeInjectEndRnNR** | **String**| To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r | [optional]
### Return type ### Return type
@ -49,6 +49,6 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, */ =end - **Content-Type**: application/json, *_/ =end --
- **Accept**: application/json, */ =end - **Accept**: application/json, *_/ =end --

View File

@ -1,8 +1,8 @@
# SwaggerPetstoreEnd.ModelReturn # SwaggerPetstoreEndRnNR.ModelReturn
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**_return** | **Integer** | property description &#39; \&quot; &#x3D;end | [optional] **_return** | **Number** | property description *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r | [optional]

View File

@ -1,7 +1,7 @@
{ {
"name": "swagger_petstore____end", "name": "swagger_petstore____end____rn_n_r",
"version": "1.0.0 =end", "version": "1.0.0 *_/ =end -- \r\n \n \r",
"description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters_______end", "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters_______end______",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {

View File

@ -1,9 +1,9 @@
/** /**
* Swagger Petstore ' \" =end * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
* *
* OpenAPI spec version: 1.0.0 ' \" =end * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io ' \" =end * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
* *
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
@ -31,17 +31,17 @@
module.exports = factory(require('superagent')); module.exports = factory(require('superagent'));
} else { } else {
// Browser globals (root is window) // Browser globals (root is window)
if (!root.SwaggerPetstoreEnd) { if (!root.SwaggerPetstoreEndRnNR) {
root.SwaggerPetstoreEnd = {}; root.SwaggerPetstoreEndRnNR = {};
} }
root.SwaggerPetstoreEnd.ApiClient = factory(root.superagent); root.SwaggerPetstoreEndRnNR.ApiClient = factory(root.superagent);
} }
}(this, function(superagent) { }(this, function(superagent) {
'use strict'; 'use strict';
/** /**
* @module ApiClient * @module ApiClient
* @version 1.0.0 &#x3D;end * @version 1.0.0 *_/ &#x3D;end -- \r\n \n \r
*/ */
/** /**
@ -55,16 +55,16 @@
/** /**
* The base URL against which to resolve every API call's (relative) path. * The base URL against which to resolve every API call's (relative) path.
* @type {String} * @type {String}
* @default https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end * @default https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r/v2 *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/ */
this.basePath = 'https://petstore.swagger.io &#39; \&quot; &#x3D;end/v2 &#39; \&quot; &#x3D;end'.replace(/\/+$/, ''); this.basePath = 'https://petstore.swagger.io *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r/v2 *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r'.replace(/\/+$/, '');
/** /**
* The authentication methods to be included for all API calls. * The authentication methods to be included for all API calls.
* @type {Array.<String>} * @type {Array.<String>}
*/ */
this.authentications = { this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key */ &#39; &quot; &#x3D;end'}, 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key */ &#39; &quot; &#x3D;end -- \r\n \n \r'},
'petstore_auth': {type: 'oauth2'} 'petstore_auth': {type: 'oauth2'}
}; };
/** /**
@ -376,7 +376,10 @@
var contentType = this.jsonPreferredMime(contentTypes); var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) { if (contentType) {
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
if(contentType != 'multipart/form-data') {
request.type(contentType); request.type(contentType);
}
} else if (!request.header['Content-Type']) { } else if (!request.header['Content-Type']) {
request.type('application/json'); request.type('application/json');
} }

View File

@ -1,9 +1,9 @@
/** /**
* Swagger Petstore ' \" =end * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
* *
* OpenAPI spec version: 1.0.0 ' \" =end * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io ' \" =end * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
* *
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
@ -31,10 +31,10 @@
module.exports = factory(require('../ApiClient')); module.exports = factory(require('../ApiClient'));
} else { } else {
// Browser globals (root is window) // Browser globals (root is window)
if (!root.SwaggerPetstoreEnd) { if (!root.SwaggerPetstoreEndRnNR) {
root.SwaggerPetstoreEnd = {}; root.SwaggerPetstoreEndRnNR = {};
} }
root.SwaggerPetstoreEnd.FakeApi = factory(root.SwaggerPetstoreEnd.ApiClient); root.SwaggerPetstoreEndRnNR.FakeApi = factory(root.SwaggerPetstoreEndRnNR.ApiClient);
} }
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
@ -42,7 +42,7 @@
/** /**
* Fake service. * Fake service.
* @module api/FakeApi * @module api/FakeApi
* @version 1.0.0 &#x3D;end * @version 1.0.0 *_/ &#x3D;end -- \r\n \n \r
*/ */
/** /**
@ -57,20 +57,20 @@
/** /**
* Callback function to receive the result of the testCodeInjectEnd operation. * Callback function to receive the result of the testCodeInjectEndRnNR operation.
* @callback module:api/FakeApi~testCodeInjectEndCallback * @callback module:api/FakeApi~testCodeInjectEndRnNRCallback
* @param {String} error Error message, if any. * @param {String} error Error message, if any.
* @param data This operation does not return a value. * @param data This operation does not return a value.
* @param {String} response The complete HTTP response. * @param {String} response The complete HTTP response.
*/ */
/** /**
* To test code injection &#39; \&quot; &#x3D;end * To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* @param {Object} opts Optional parameters * @param {Object} opts Optional parameters
* @param {String} opts.testCodeInjectEnd To test code injection &#39; \&quot; &#x3D;end * @param {String} opts.testCodeInjectEndRnNR To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* @param {module:api/FakeApi~testCodeInjectEndCallback} callback The callback function, accepting three arguments: error, data, response * @param {module:api/FakeApi~testCodeInjectEndRnNRCallback} callback The callback function, accepting three arguments: error, data, response
*/ */
this.testCodeInjectEnd = function(opts, callback) { this.testCodeInjectEndRnNR = function(opts, callback) {
opts = opts || {}; opts = opts || {};
var postBody = null; var postBody = null;
@ -82,12 +82,12 @@
var headerParams = { var headerParams = {
}; };
var formParams = { var formParams = {
'test code inject */ &#39; &quot; &#x3D;end': opts['testCodeInjectEnd'] 'test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r': opts['testCodeInjectEndRnNR']
}; };
var authNames = []; var authNames = [];
var contentTypes = ['application/json', '*/ =end']; var contentTypes = ['application/json', '*_/ =end -- '];
var accepts = ['application/json', '*/ =end']; var accepts = ['application/json', '*_/ =end -- '];
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(

View File

@ -1,9 +1,9 @@
/** /**
* Swagger Petstore ' \" =end * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
* *
* OpenAPI spec version: 1.0.0 ' \" =end * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io ' \" =end * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
* *
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
@ -34,14 +34,14 @@
'use strict'; 'use strict';
/** /**
* This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters_______end.<br> * This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters_______end______.<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:
* <pre> * <pre>
* var SwaggerPetstoreEnd = require('index'); // See note below*. * var SwaggerPetstoreEndRnNR = require('index'); // See note below*.
* var xxxSvc = new SwaggerPetstoreEnd.XxxApi(); // Allocate the API class we're going to use. * var xxxSvc = new SwaggerPetstoreEndRnNR.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new SwaggerPetstoreEnd.Yyy(); // Construct a model instance. * var yyyModel = new SwaggerPetstoreEndRnNR.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue'; * yyyModel.someProperty = 'someValue';
* ... * ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service. * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
@ -53,8 +53,8 @@
* <p> * <p>
* A non-AMD browser application (discouraged) might do something like this: * A non-AMD browser application (discouraged) might do something like this:
* <pre> * <pre>
* var xxxSvc = new SwaggerPetstoreEnd.XxxApi(); // Allocate the API class we're going to use. * var xxxSvc = new SwaggerPetstoreEndRnNR.XxxApi(); // Allocate the API class we're going to use.
* var yyy = new SwaggerPetstoreEnd.Yyy(); // Construct a model instance. * var yyy = new SwaggerPetstoreEndRnNR.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue'; * yyyModel.someProperty = 'someValue';
* ... * ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service. * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
@ -62,7 +62,7 @@
* </pre> * </pre>
* </p> * </p>
* @module index * @module index
* @version 1.0.0 &#x3D;end * @version 1.0.0 *_/ &#x3D;end -- \r\n \n \r
*/ */
var exports = { var exports = {
/** /**

View File

@ -1,9 +1,9 @@
/** /**
* Swagger Petstore ' \" =end * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
* *
* OpenAPI spec version: 1.0.0 ' \" =end * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: apiteam@swagger.io ' \" =end * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r
* *
* NOTE: This class is auto generated by the swagger code generator program. * NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
@ -31,10 +31,10 @@
module.exports = factory(require('../ApiClient')); module.exports = factory(require('../ApiClient'));
} else { } else {
// Browser globals (root is window) // Browser globals (root is window)
if (!root.SwaggerPetstoreEnd) { if (!root.SwaggerPetstoreEndRnNR) {
root.SwaggerPetstoreEnd = {}; root.SwaggerPetstoreEndRnNR = {};
} }
root.SwaggerPetstoreEnd.ModelReturn = factory(root.SwaggerPetstoreEnd.ApiClient); root.SwaggerPetstoreEndRnNR.ModelReturn = factory(root.SwaggerPetstoreEndRnNR.ApiClient);
} }
}(this, function(ApiClient) { }(this, function(ApiClient) {
'use strict'; 'use strict';
@ -45,12 +45,12 @@
/** /**
* The ModelReturn model module. * The ModelReturn model module.
* @module model/ModelReturn * @module model/ModelReturn
* @version 1.0.0 &#x3D;end * @version 1.0.0 *_/ &#x3D;end -- \r\n \n \r
*/ */
/** /**
* Constructs a new <code>ModelReturn</code>. * Constructs a new <code>ModelReturn</code>.
* Model for testing reserved words &#39; \&quot; &#x3D;end * Model for testing reserved words *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* @alias module:model/ModelReturn * @alias module:model/ModelReturn
* @class * @class
*/ */
@ -72,15 +72,15 @@
obj = obj || new exports(); obj = obj || new exports();
if (data.hasOwnProperty('return')) { if (data.hasOwnProperty('return')) {
obj['return'] = ApiClient.convertToType(data['return'], 'Integer'); obj['return'] = ApiClient.convertToType(data['return'], 'Number');
} }
} }
return obj; return obj;
} }
/** /**
* property description ' \" =end * property description *_/ ' \" =end -- \\r\\n \\n \\r
* @member {Integer} return * @member {Number} return
*/ */
exports.prototype['return'] = undefined; exports.prototype['return'] = undefined;

View File

@ -90,7 +90,8 @@ var opts = {
'binary': "B", // String | None 'binary': "B", // String | None
'_date': new Date("2013-10-20"), // Date | None '_date': new Date("2013-10-20"), // Date | None
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None 'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None
'password': "password_example" // String | None 'password': "password_example", // String | None
'callback': "callback_example" // String | None
}; };
var callback = function(error, data, response) { var callback = function(error, data, response) {
@ -120,6 +121,7 @@ Name | Type | Description | Notes
**_date** | **Date**| None | [optional] **_date** | **Date**| None | [optional]
**dateTime** | **Date**| None | [optional] **dateTime** | **Date**| None | [optional]
**password** | **String**| None | [optional] **password** | **String**| None | [optional]
**callback** | **String**| None | [optional]
### Return type ### Return type

View File

@ -377,7 +377,10 @@
var contentType = this.jsonPreferredMime(contentTypes); var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) { if (contentType) {
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
if(contentType != 'multipart/form-data') {
request.type(contentType); request.type(contentType);
}
} else if (!request.header['Content-Type']) { } else if (!request.header['Content-Type']) {
request.type('application/json'); request.type('application/json');
} }

View File

@ -125,6 +125,7 @@
* @param {Date} opts._date None * @param {Date} opts._date None
* @param {Date} opts.dateTime None * @param {Date} opts.dateTime None
* @param {String} opts.password None * @param {String} opts.password None
* @param {String} opts.callback None
* @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response * @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/ */
this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts, callback) { this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts, callback) {
@ -171,7 +172,8 @@
'binary': opts['binary'], 'binary': opts['binary'],
'date': opts['_date'], 'date': opts['_date'],
'dateTime': opts['dateTime'], 'dateTime': opts['dateTime'],
'password': opts['password'] 'password': opts['password'],
'callback': opts['callback']
}; };
var authNames = ['http_basic_test']; var authNames = ['http_basic_test'];