forked from loafle/openapi-generator-original
Improve jsdoc for API return values (#3327)
* Add jsdoc for usePromises, add @link for callbacks * Update petstore samples * Improve jsdoc for void return type + usePromises * Add back curly brackets correctly in model template * Add link to Promise doc in jsdoc comment * Fix jsdoc annotation for callApi method The return type annotation was also broken here.
This commit is contained in:
parent
8818cf9ff4
commit
c888434580
@ -762,9 +762,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
+ (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType;
|
+ (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private String getJSDocTypeWithBraces(CodegenModel cm, CodegenProperty cp) {
|
private String getJSDocTypeWithBraces(CodegenModel cm, CodegenProperty cp) {
|
||||||
return "{" + getJSDocType(cm, cp) + "}";
|
return "{" + getJSDocType(cm, cp) + "}";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private String getJSDocType(CodegenModel cm, CodegenProperty cp) {
|
private String getJSDocType(CodegenModel cm, CodegenProperty cp) {
|
||||||
if (Boolean.TRUE.equals(cp.isContainer)) {
|
if (Boolean.TRUE.equals(cp.isContainer)) {
|
||||||
@ -787,9 +789,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.datatype : cp.baseType);
|
return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.datatype : cp.baseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private String getJSDocTypeWithBraces(CodegenParameter cp) {
|
private String getJSDocTypeWithBraces(CodegenParameter cp) {
|
||||||
return "{" + getJSDocType(cp) + "}";
|
return "{" + getJSDocType(cp) + "}";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private String getJSDocType(CodegenParameter cp) {
|
private String getJSDocType(CodegenParameter cp) {
|
||||||
String dataType = trimBrackets(cp.dataType);
|
String dataType = trimBrackets(cp.dataType);
|
||||||
@ -808,10 +812,12 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.dataType : cp.baseType);
|
return cp.isEnum || !languageSpecificPrimitives.contains(cp.baseType == null ? cp.dataType : cp.baseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private String getJSDocTypeWithBraces(CodegenOperation co) {
|
private String getJSDocTypeWithBraces(CodegenOperation co) {
|
||||||
String jsDocType = getJSDocType(co);
|
String jsDocType = getJSDocType(co);
|
||||||
return jsDocType == null ? null : "{" + jsDocType + "}";
|
return jsDocType == null ? null : "{" + jsDocType + "}";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
private String getJSDocType(CodegenOperation co) {
|
private String getJSDocType(CodegenOperation co) {
|
||||||
String returnType = trimBrackets(co.returnType);
|
String returnType = trimBrackets(co.returnType);
|
||||||
@ -860,10 +866,10 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
|
|
||||||
// Store JSDoc type specification into vendor-extension: x-jsdoc-type.
|
// Store JSDoc type specification into vendor-extension: x-jsdoc-type.
|
||||||
for (CodegenParameter cp : operation.allParams) {
|
for (CodegenParameter cp : operation.allParams) {
|
||||||
String jsdocType = getJSDocTypeWithBraces(cp);
|
String jsdocType = getJSDocType(cp);
|
||||||
cp.vendorExtensions.put("x-jsdoc-type", jsdocType);
|
cp.vendorExtensions.put("x-jsdoc-type", jsdocType);
|
||||||
}
|
}
|
||||||
String jsdocType = getJSDocTypeWithBraces(operation);
|
String jsdocType = getJSDocType(operation);
|
||||||
operation.vendorExtensions.put("x-jsdoc-type", jsdocType);
|
operation.vendorExtensions.put("x-jsdoc-type", jsdocType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -889,7 +895,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
|
|
||||||
for (CodegenProperty var : cm.vars) {
|
for (CodegenProperty var : cm.vars) {
|
||||||
// Add JSDoc @type value for this property.
|
// Add JSDoc @type value for this property.
|
||||||
String jsDocType = getJSDocTypeWithBraces(cm, var);
|
String jsDocType = getJSDocType(cm, var);
|
||||||
var.vendorExtensions.put("x-jsdoc-type", jsDocType);
|
var.vendorExtensions.put("x-jsdoc-type", jsDocType);
|
||||||
|
|
||||||
if (Boolean.TRUE.equals(var.required)) {
|
if (Boolean.TRUE.equals(var.required)) {
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
{{#emitJSDoc}} /**
|
{{#emitJSDoc}} /**
|
||||||
* Checks whether the given parameter value represents file-like content.
|
* Checks whether the given parameter value represents file-like content.
|
||||||
* @param param The parameter to check.
|
* @param param The parameter to check.
|
||||||
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}} exports.prototype.isFileParam = function(param) {
|
{{/emitJSDoc}} exports.prototype.isFileParam = function(param) {
|
||||||
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
||||||
@ -185,7 +185,7 @@
|
|||||||
|
|
||||||
{{#emitJSDoc}} /**
|
{{#emitJSDoc}} /**
|
||||||
* Enumeration of collection format separator strategies.
|
* Enumeration of collection format separator strategies.
|
||||||
* @enum {String}
|
* @enum {String}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
exports.CollectionFormatEnum = {
|
exports.CollectionFormatEnum = {
|
||||||
@ -330,8 +330,8 @@
|
|||||||
* @param {Array.<String>} accepts An array of acceptable response MIME types.
|
* @param {Array.<String>} accepts An array of acceptable response MIME types.
|
||||||
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
|
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
|
||||||
* constructor for a complex type.{{^usePromises}}
|
* constructor for a complex type.{{^usePromises}}
|
||||||
* @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.
|
* @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.{{/usePromises}}
|
||||||
{{/usePromises}} * @returns {{#usePromises}}{Promise} A Promise object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}.
|
* @returns {{#usePromises}}{Promise} A {@link https://www.promisejs.org/|Promise} object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}.
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}} exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
|
{{/emitJSDoc}} exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
|
||||||
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
|
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
|
||||||
|
@ -38,18 +38,19 @@
|
|||||||
* Callback function to receive the result of the <operationId> operation.
|
* Callback function to receive the result of the <operationId> operation.
|
||||||
* @callback module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>~<operationId>Callback
|
* @callback module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>~<operationId>Callback
|
||||||
* @param {String} error Error message, if any.
|
* @param {String} error Error message, if any.
|
||||||
* @param <#vendorExtensions.x-jsdoc-type><&vendorExtensions.x-jsdoc-type> data The data returned by the service call.</vendorExtensions.x-jsdoc-type><^vendorExtensions.x-jsdoc-type>data This operation does not return a value.</vendorExtensions.x-jsdoc-type>
|
* @param <#vendorExtensions.x-jsdoc-type>{<&vendorExtensions.x-jsdoc-type>} data The data returned by the service call.</vendorExtensions.x-jsdoc-type><^vendorExtensions.x-jsdoc-type>data This operation does not return a value.</vendorExtensions.x-jsdoc-type>
|
||||||
* @param {String} response The complete HTTP response.
|
* @param {String} response The complete HTTP response.
|
||||||
*/</usePromises>
|
*/</usePromises>
|
||||||
|
|
||||||
/**<#summary>
|
/**<#summary>
|
||||||
* <summary></summary><#notes>
|
* <summary></summary><#notes>
|
||||||
* <notes></notes><#allParams><#required>
|
* <notes></notes><#allParams><#required>
|
||||||
* @param <&vendorExtensions.x-jsdoc-type> <paramName> <description></required></allParams><#hasOptionalParams>
|
* @param {<&vendorExtensions.x-jsdoc-type>} <paramName> <description></required></allParams><#hasOptionalParams>
|
||||||
* @param {Object} opts Optional parameters<#allParams><^required>
|
* @param {Object} opts Optional parameters<#allParams><^required>
|
||||||
* @param <&vendorExtensions.x-jsdoc-type> opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></allParams></hasOptionalParams><^usePromises>
|
* @param {<&vendorExtensions.x-jsdoc-type>} opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></allParams></hasOptionalParams><^usePromises>
|
||||||
* @param {module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><&classname>~<operationId>Callback} callback The callback function, accepting three arguments: error, data, response</usePromises><#returnType>
|
* @param {module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><&classname>~<operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType>
|
||||||
* data is of type: <&vendorExtensions.x-jsdoc-type></returnType>
|
* data is of type: {@link <&vendorExtensions.x-jsdoc-type>}</returnType></usePromises><#usePromises>
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>}</returnType></usePromises>
|
||||||
*/
|
*/
|
||||||
</emitJSDoc> this.<operationId> = function(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams>
|
</emitJSDoc> this.<operationId> = function(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams>
|
||||||
opts = opts || {};</hasOptionalParams>
|
opts = opts || {};</hasOptionalParams>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* @class{{#useInheritance}}{{#parent}}
|
* @class{{#useInheritance}}{{#parent}}
|
||||||
* @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}}
|
* @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}}
|
||||||
* @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
* @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
||||||
* @param {{name}} {{{vendorExtensions.x-jsdoc-type}}} {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}}
|
* @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}}
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
var exports = function({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
var exports = function({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
||||||
@ -56,7 +56,7 @@
|
|||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**{{#description}}
|
/**{{#description}}
|
||||||
* {{{description}}}{{/description}}
|
* {{{description}}}{{/description}}
|
||||||
* @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}}
|
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
@ -66,7 +66,7 @@
|
|||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**{{#description}}
|
/**{{#description}}
|
||||||
* {{{description}}}{{/description}}
|
* {{{description}}}{{/description}}
|
||||||
* @member {{{vendorExtensions.x-jsdoc-type}}} {{baseName}}{{#defaultValue}}
|
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
|
||||||
* @default {{{defaultValue}}}{{/defaultValue}}
|
* @default {{{defaultValue}}}{{/defaultValue}}
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
@ -78,7 +78,7 @@ exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaul
|
|||||||
* Returns {{{description}}}{{/description}}{{#minimum}}
|
* Returns {{{description}}}{{/description}}{{#minimum}}
|
||||||
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
|
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
|
||||||
* maximum: {{maximum}}{{/maximum}}
|
* maximum: {{maximum}}{{/maximum}}
|
||||||
* @return {{{vendorExtensions.x-jsdoc-type}}}
|
* @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=>
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
exports.prototype.{{getter}} = function() {
|
exports.prototype.{{getter}} = function() {
|
||||||
@ -88,7 +88,7 @@ exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaul
|
|||||||
{{#emitJSDoc}}
|
{{#emitJSDoc}}
|
||||||
/**{{#description}}
|
/**{{#description}}
|
||||||
* Sets {{{description}}}{{/description}}
|
* Sets {{{description}}}{{/description}}
|
||||||
* @param {{{vendorExtensions.x-jsdoc-type}}} {{name}}{{#description}} {{{description}}}{{/description}}
|
* @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}}
|
||||||
*/
|
*/
|
||||||
{{/emitJSDoc}}
|
{{/emitJSDoc}}
|
||||||
exports.prototype.{{setter}} = function({{name}}) {
|
exports.prototype.{{setter}} = function({{name}}) {
|
||||||
|
@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-06-29T13:53:04.955-07:00
|
- Build date: 2016-07-11T21:45:36.147-07:00
|
||||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@ -55,10 +55,25 @@ var SwaggerPetstore = require('swagger_petstore');
|
|||||||
|
|
||||||
var api = new SwaggerPetstore.FakeApi()
|
var api = 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 = {
|
var opts = {
|
||||||
'testCodeInjectEnd': "testCodeInjectEnd_example" // {String} To test code injection =end
|
'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.testCodeInjectEnd(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);
|
||||||
@ -73,7 +88,6 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*SwaggerPetstore.FakeApi* | [**testCodeInjectEnd**](docs/FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection =end
|
|
||||||
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
*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* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query 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
|
||||||
|
@ -4,53 +4,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection =end
|
|
||||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||||
|
|
||||||
|
|
||||||
<a name="testCodeInjectEnd"></a>
|
|
||||||
# **testCodeInjectEnd**
|
|
||||||
> testCodeInjectEnd(opts)
|
|
||||||
|
|
||||||
To test code injection =end
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var SwaggerPetstore = require('swagger_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
|
||||||
|
|
||||||
var opts = {
|
|
||||||
'testCodeInjectEnd': "testCodeInjectEnd_example" // String | To test code injection =end
|
|
||||||
};
|
|
||||||
apiInstance.testCodeInjectEnd(opts).then(function() {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}, function(error) {
|
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**testCodeInjectEnd** | **String**| To test code injection =end | [optional]
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json, */ =end));(phpinfo(
|
|
||||||
- **Accept**: application/json, */ end
|
|
||||||
|
|
||||||
<a name="testEndpointParameters"></a>
|
<a name="testEndpointParameters"></a>
|
||||||
# **testEndpointParameters**
|
# **testEndpointParameters**
|
||||||
> testEndpointParameters(_number, _double, _string, _byte, opts)
|
> testEndpointParameters(_number, _double, _string, _byte, opts)
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
/**
|
/**
|
||||||
* Checks whether the given parameter value represents file-like content.
|
* Checks whether the given parameter value represents file-like content.
|
||||||
* @param param The parameter to check.
|
* @param param The parameter to check.
|
||||||
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
||||||
*/
|
*/
|
||||||
exports.prototype.isFileParam = function(param) {
|
exports.prototype.isFileParam = function(param) {
|
||||||
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
||||||
@ -206,7 +206,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumeration of collection format separator strategies.
|
* Enumeration of collection format separator strategies.
|
||||||
* @enum {String}
|
* @enum {String}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
exports.CollectionFormatEnum = {
|
exports.CollectionFormatEnum = {
|
||||||
@ -342,7 +342,8 @@
|
|||||||
* @param {Array.<String>} contentTypes An array of request MIME types.
|
* @param {Array.<String>} contentTypes An array of request MIME types.
|
||||||
* @param {Array.<String>} accepts An array of acceptable response MIME types.
|
* @param {Array.<String>} accepts An array of acceptable response MIME types.
|
||||||
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
|
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
|
||||||
* constructor for a complex type. * @returns {Promise} A Promise object.
|
* constructor for a complex type.
|
||||||
|
* @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
|
||||||
*/
|
*/
|
||||||
exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
|
exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
|
||||||
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
|
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
|
||||||
|
@ -57,39 +57,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To test code injection =end
|
|
||||||
* @param {Object} opts Optional parameters
|
|
||||||
* @param {String} opts.testCodeInjectEnd To test code injection =end
|
|
||||||
*/
|
|
||||||
this.testCodeInjectEnd = function(opts) {
|
|
||||||
opts = opts || {};
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
'test code inject */ =end': opts['testCodeInjectEnd']
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = [];
|
|
||||||
var contentTypes = ['application/json', '*/ =end));(phpinfo('];
|
|
||||||
var accepts = ['application/json', '*/ end'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/fake', 'PUT',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
@ -106,6 +73,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
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.testEndpointParameters = function(_number, _double, _string, _byte, opts) {
|
this.testEndpointParameters = function(_number, _double, _string, _byte, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
@ -172,6 +140,7 @@
|
|||||||
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg)
|
* @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.enumQueryInteger Query parameter enum test (double)
|
||||||
* @param {Number} opts.enumQueryDouble 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.testEnumQueryParameters = function(opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.addPet = function(body) {
|
this.addPet = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
@ -99,6 +100,7 @@
|
|||||||
* @param {Integer} petId Pet id to delete
|
* @param {Integer} petId Pet id to delete
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {String} opts.apiKey
|
* @param {String} opts.apiKey
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.deletePet = function(petId, opts) {
|
this.deletePet = function(petId, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
@ -138,7 +140,7 @@
|
|||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
|
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
this.findPetsByStatus = function(status) {
|
this.findPetsByStatus = function(status) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -176,7 +178,7 @@
|
|||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
* @param {Array.<String>} tags Tags to filter by
|
* @param {Array.<String>} tags Tags to filter by
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
this.findPetsByTags = function(tags) {
|
this.findPetsByTags = function(tags) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -214,7 +216,7 @@
|
|||||||
* Find pet by ID
|
* Find pet by ID
|
||||||
* Returns a single pet
|
* Returns a single pet
|
||||||
* @param {Integer} petId ID of pet to return
|
* @param {Integer} petId ID of pet to return
|
||||||
* data is of type: {module:model/Pet}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet}
|
||||||
*/
|
*/
|
||||||
this.getPetById = function(petId) {
|
this.getPetById = function(petId) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -252,6 +254,7 @@
|
|||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.updatePet = function(body) {
|
this.updatePet = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
@ -291,6 +294,7 @@
|
|||||||
* @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
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.updatePetWithForm = function(petId, opts) {
|
this.updatePetWithForm = function(petId, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
@ -334,7 +338,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}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse}
|
||||||
*/
|
*/
|
||||||
this.uploadFile = function(petId, opts) {
|
this.uploadFile = function(petId, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
* @param {String} orderId ID of the order that needs to be deleted
|
* @param {String} orderId ID of the order that needs to be deleted
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.deleteOrder = function(orderId) {
|
this.deleteOrder = function(orderId) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -97,7 +98,7 @@
|
|||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
* data is of type: {Object.<String, {'String': 'Integer'}>}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.<String, {'String': 'Integer'}>}
|
||||||
*/
|
*/
|
||||||
this.getInventory = function() {
|
this.getInventory = function() {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -129,7 +130,7 @@
|
|||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
* @param {Integer} 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}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
|
||||||
*/
|
*/
|
||||||
this.getOrderById = function(orderId) {
|
this.getOrderById = function(orderId) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -167,7 +168,7 @@
|
|||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
* @param {module:model/Order} body order placed for purchasing the pet
|
* @param {module:model/Order} body order placed for purchasing the pet
|
||||||
* data is of type: {module:model/Order}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
|
||||||
*/
|
*/
|
||||||
this.placeOrder = function(body) {
|
this.placeOrder = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
* 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 {module:model/User} body Created user object
|
* @param {module:model/User} body Created user object
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.createUser = function(body) {
|
this.createUser = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
@ -97,6 +98,7 @@
|
|||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param {Array.<module:model/User>} body List of user object
|
* @param {Array.<module:model/User>} body List of user object
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.createUsersWithArrayInput = function(body) {
|
this.createUsersWithArrayInput = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
@ -133,6 +135,7 @@
|
|||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
* @param {Array.<module:model/User>} body List of user object
|
* @param {Array.<module:model/User>} body List of user object
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.createUsersWithListInput = function(body) {
|
this.createUsersWithListInput = function(body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
@ -169,6 +172,7 @@
|
|||||||
* Delete user
|
* Delete user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param {String} username The name that needs to be deleted
|
* @param {String} username The name that needs to be deleted
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.deleteUser = function(username) {
|
this.deleteUser = function(username) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -206,7 +210,7 @@
|
|||||||
* Get user by user name
|
* Get user by user name
|
||||||
*
|
*
|
||||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||||
* data is of type: {module:model/User}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
|
||||||
*/
|
*/
|
||||||
this.getUserByName = function(username) {
|
this.getUserByName = function(username) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -245,7 +249,7 @@
|
|||||||
*
|
*
|
||||||
* @param {String} username The user name for login
|
* @param {String} username The user name for login
|
||||||
* @param {String} password The password for login in clear text
|
* @param {String} password The password for login in clear text
|
||||||
* data is of type: {'String'}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'}
|
||||||
*/
|
*/
|
||||||
this.loginUser = function(username, password) {
|
this.loginUser = function(username, password) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -288,6 +292,7 @@
|
|||||||
/**
|
/**
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
*
|
*
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.logoutUser = function() {
|
this.logoutUser = function() {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -320,6 +325,7 @@
|
|||||||
* 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 {module:model/User} body Updated user object
|
* @param {module:model/User} body Updated user object
|
||||||
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
this.updateUser = function(username, body) {
|
this.updateUser = function(username, body) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
|
@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-06-29T13:53:00.479-07:00
|
- Build date: 2016-07-11T21:45:28.055-07:00
|
||||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@ -55,8 +55,23 @@ var SwaggerPetstore = require('swagger_petstore');
|
|||||||
|
|
||||||
var api = new SwaggerPetstore.FakeApi()
|
var api = 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 = {
|
var opts = {
|
||||||
'testCodeInjectEnd': "testCodeInjectEnd_example" // {String} To test code injection =end
|
'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
|
||||||
};
|
};
|
||||||
|
|
||||||
var callback = function(error, data, response) {
|
var callback = function(error, data, response) {
|
||||||
@ -66,7 +81,7 @@ var callback = function(error, data, response) {
|
|||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
api.testCodeInjectEnd(opts, callback);
|
api.testEndpointParameters(_number, _double, _string, _byte, opts, callback);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -76,7 +91,6 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*SwaggerPetstore.FakeApi* | [**testCodeInjectEnd**](docs/FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection =end
|
|
||||||
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
*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* | [**testEnumQueryParameters**](docs/FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query 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
|
||||||
|
@ -4,56 +4,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
|||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**testCodeInjectEnd**](FakeApi.md#testCodeInjectEnd) | **PUT** /fake | To test code injection =end
|
|
||||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
|
||||||
|
|
||||||
|
|
||||||
<a name="testCodeInjectEnd"></a>
|
|
||||||
# **testCodeInjectEnd**
|
|
||||||
> testCodeInjectEnd(opts)
|
|
||||||
|
|
||||||
To test code injection =end
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var SwaggerPetstore = require('swagger_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
|
||||||
|
|
||||||
var opts = {
|
|
||||||
'testCodeInjectEnd': "testCodeInjectEnd_example" // String | To test code injection =end
|
|
||||||
};
|
|
||||||
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testCodeInjectEnd(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**testCodeInjectEnd** | **String**| To test code injection =end | [optional]
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json, */ =end));(phpinfo(
|
|
||||||
- **Accept**: application/json, */ end
|
|
||||||
|
|
||||||
<a name="testEndpointParameters"></a>
|
<a name="testEndpointParameters"></a>
|
||||||
# **testEndpointParameters**
|
# **testEndpointParameters**
|
||||||
> testEndpointParameters(_number, _double, _string, _byte, opts)
|
> testEndpointParameters(_number, _double, _string, _byte, opts)
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
/**
|
/**
|
||||||
* Checks whether the given parameter value represents file-like content.
|
* Checks whether the given parameter value represents file-like content.
|
||||||
* @param param The parameter to check.
|
* @param param The parameter to check.
|
||||||
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
||||||
*/
|
*/
|
||||||
exports.prototype.isFileParam = function(param) {
|
exports.prototype.isFileParam = function(param) {
|
||||||
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
// fs.ReadStream in Node.js (but not in runtime like browserify)
|
||||||
@ -206,7 +206,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumeration of collection format separator strategies.
|
* Enumeration of collection format separator strategies.
|
||||||
* @enum {String}
|
* @enum {String}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
exports.CollectionFormatEnum = {
|
exports.CollectionFormatEnum = {
|
||||||
|
@ -56,47 +56,6 @@
|
|||||||
this.apiClient = apiClient || ApiClient.instance;
|
this.apiClient = apiClient || ApiClient.instance;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback function to receive the result of the testCodeInjectEnd operation.
|
|
||||||
* @callback module:api/FakeApi~testCodeInjectEndCallback
|
|
||||||
* @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 code injection =end
|
|
||||||
* @param {Object} opts Optional parameters
|
|
||||||
* @param {String} opts.testCodeInjectEnd To test code injection =end
|
|
||||||
* @param {module:api/FakeApi~testCodeInjectEndCallback} callback The callback function, accepting three arguments: error, data, response
|
|
||||||
*/
|
|
||||||
this.testCodeInjectEnd = function(opts, callback) {
|
|
||||||
opts = opts || {};
|
|
||||||
var postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
var pathParams = {
|
|
||||||
};
|
|
||||||
var queryParams = {
|
|
||||||
};
|
|
||||||
var headerParams = {
|
|
||||||
};
|
|
||||||
var formParams = {
|
|
||||||
'test code inject */ =end': opts['testCodeInjectEnd']
|
|
||||||
};
|
|
||||||
|
|
||||||
var authNames = [];
|
|
||||||
var contentTypes = ['application/json', '*/ =end));(phpinfo('];
|
|
||||||
var accepts = ['application/json', '*/ end'];
|
|
||||||
var returnType = null;
|
|
||||||
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/fake', 'PUT',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, callback
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function to receive the result of the testEndpointParameters operation.
|
* Callback function to receive the result of the testEndpointParameters operation.
|
||||||
* @callback module:api/FakeApi~testEndpointParametersCallback
|
* @callback module:api/FakeApi~testEndpointParametersCallback
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
|
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
|
||||||
* @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* data is of type: {@link Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
this.findPetsByStatus = function(status, callback) {
|
this.findPetsByStatus = function(status, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -208,7 +208,7 @@
|
|||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
* @param {Array.<String>} tags Tags to filter by
|
* @param {Array.<String>} tags Tags to filter by
|
||||||
* @param {module:api/PetApi~findPetsByTagsCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/PetApi~findPetsByTagsCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* data is of type: {@link Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
this.findPetsByTags = function(tags, callback) {
|
this.findPetsByTags = function(tags, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -254,7 +254,7 @@
|
|||||||
* Returns a single pet
|
* Returns a single pet
|
||||||
* @param {Integer} petId ID of pet to return
|
* @param {Integer} petId ID of pet to return
|
||||||
* @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {module:model/Pet}
|
* data is of type: {@link module:model/Pet}
|
||||||
*/
|
*/
|
||||||
this.getPetById = function(petId, callback) {
|
this.getPetById = function(petId, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -398,7 +398,7 @@
|
|||||||
* @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
|
||||||
* @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {module:model/ApiResponse}
|
* data is of type: {@link module:model/ApiResponse}
|
||||||
*/
|
*/
|
||||||
this.uploadFile = function(petId, opts, callback) {
|
this.uploadFile = function(petId, opts, callback) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
* @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {Object.<String, {'String': 'Integer'}>}
|
* data is of type: {@link Object.<String, {'String': 'Integer'}>}
|
||||||
*/
|
*/
|
||||||
this.getInventory = function(callback) {
|
this.getInventory = function(callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -153,7 +153,7 @@
|
|||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
* @param {Integer} orderId ID of pet that needs to be fetched
|
* @param {Integer} orderId ID of pet that needs to be fetched
|
||||||
* @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {module:model/Order}
|
* data is of type: {@link module:model/Order}
|
||||||
*/
|
*/
|
||||||
this.getOrderById = function(orderId, callback) {
|
this.getOrderById = function(orderId, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -199,7 +199,7 @@
|
|||||||
*
|
*
|
||||||
* @param {module:model/Order} body order placed for purchasing the pet
|
* @param {module:model/Order} body order placed for purchasing the pet
|
||||||
* @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {module:model/Order}
|
* data is of type: {@link module:model/Order}
|
||||||
*/
|
*/
|
||||||
this.placeOrder = function(body, callback) {
|
this.placeOrder = function(body, callback) {
|
||||||
var postBody = body;
|
var postBody = body;
|
||||||
|
@ -246,7 +246,7 @@
|
|||||||
*
|
*
|
||||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||||
* @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {module:model/User}
|
* data is of type: {@link module:model/User}
|
||||||
*/
|
*/
|
||||||
this.getUserByName = function(username, callback) {
|
this.getUserByName = function(username, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
@ -293,7 +293,7 @@
|
|||||||
* @param {String} username The user name for login
|
* @param {String} username The user name for login
|
||||||
* @param {String} password The password for login in clear text
|
* @param {String} password The password for login in clear text
|
||||||
* @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {'String'}
|
* data is of type: {@link 'String'}
|
||||||
*/
|
*/
|
||||||
this.loginUser = function(username, password, callback) {
|
this.loginUser = function(username, password, callback) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user