update js doc

This commit is contained in:
wing328 2016-03-18 18:30:45 +08:00
parent 9e45a99e60
commit 04e56a165e
10 changed files with 146 additions and 93 deletions

View File

@ -1,69 +1,104 @@
# {{projectName}} # {{projectName}}
{{moduleName}} - JavaScript client for {{projectName}} {{moduleName}} - JavaScript client for {{projectName}}
{{#appDescription}}
{{{appDescription}}}
{{/appDescription}}
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
Version: {{projectVersion}} - API verion: {{appVersion}}
- Package version: {{projectVersion}}
Automatically generated by the JavaScript Swagger Codegen project:
- Build date: {{generatedDate}} - Build date: {{generatedDate}}
- Build package: {{generatorClass}} - Build package: {{generatorClass}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}
## Installation ## Installation
### Use in [Node.js](https://nodejs.org/) ### For [Node.js](https://nodejs.org/)
The generated client is valid [npm](https://www.npmjs.com/) package, you can publish it as described #### npm
in [Publishing npm packages](https://docs.npmjs.com/getting-started/publishing-npm-packages).
After that, you can install it into your project via: To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
Then install it via:
```shell ```shell
npm install {{{projectName}}} --save npm install {{{projectName}}} --save
``` ```
You can also host the generated client as a git repository on github, e.g. #### git
https://github.com/YOUR_USERNAME/{{projectName}} #
If the library is hosted at a git repository, e.g.
Then you can install it via: https://github.com/{{#gitUserName}}{{.}}{{/gitUserName}}{{^gitUserName}}YOUR_USERNAME{{/gitUserName}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}}
then install it via:
```shell ```shell
npm install YOUR_USERNAME/{{{projectName}}} --save npm install {{#gitUserName}}{{.}}{{/gitUserName}}{{^gitUserName}}YOUR_USERNAME{{/gitUserName}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save
``` ```
### Use in browser with [browserify](http://browserify.org/) ### For browser
The client also works in browser environment via npm and browserify. After following The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`, the above steps with Node.js and installing browserify with `npm install -g browserify`,
you can do this in your project (assuming *main.js* is your entry file): perform the following (assuming *main.js* is your entry file):
```shell ```shell
browserify main.js > bundle.js browserify main.js > bundle.js
``` ```
The generated *bundle.js* can now be included in your HTML pages. Then include *bundle.js* in the HTML pages.
## Getting Started ## Getting Started
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript ```javascript
var {{{moduleName}}} = require('{{{projectName}}}'); var {{{moduleName}}} = require('{{{projectName}}}');
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}
var defaultClient = {{{moduleName}}}.ApiClient.default; var defaultClient = {{{moduleName}}}.ApiClient.default;
defaultClient.timeout = 10 * 1000; {{#authMethods}}{{#isBasic}}
defaultClient.defaultHeaders['Test-Header'] = 'test_value'; // Configure HTTP basic authorization: {{{name}}}
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
{{{name}}}.username = 'YOUR USERNAME'
{{{name}}}.password = 'YOUR PASSWORD'{{/isBasic}}{{#isApiKey}}
// Configure API key authorization: {{{name}}}
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
{{{name}}}.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//{{{name}}}.apiKeyPrefix['{{{keyParamName}}}'] = "Token"{{/isApiKey}}{{#isOAuth}}
// Configure OAuth2 access token for authorization: {{{name}}}
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
{{{name}}}.accessToken = "YOUR ACCESS TOKEN"{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}
// Assuming there's a `PetApi` containing a `getPetById` method var api = new {{{moduleName}}}.{{{classname}}}(){{#hasParams}}
// which returns a model object: {{#vendorExtensions.x-codegen-hasRequiredParams}}{{#allParams}}{{#required}}
var api = new {{{moduleName}}}.PetApi(); var {{{paramName}}} = {{{example}}}; // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}
api.getPetById(2, function(err, pet, resp) { {{/required}}{{/allParams}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}}
console.log('HTTP status code: ' + resp.status); var opts = { {{#allParams}}{{^required}}
console.log('Response Content-Type: ' + resp.get('Content-Type')); '{{{paramName}}}': {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}{{/required}}{{/allParams}}
if (err) { };{{/hasOptionalParams}}{{/hasParams}}
console.error(err); {{#usePromises}}
} else { api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}).then(function({{#returnType}}data{{/returnType}}) {
console.log(pet); {{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}}
} }, function(error) {
console.error(error);
}); });
{{/usePromises}}{{^usePromises}}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
{{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}}
}
};
api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}{{#hasParams}}, {{/hasParams}}callback);
{{/usePromises}}{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
``` ```
## Documentation for API Endpoints ## Documentation for API Endpoints

View File

@ -26,7 +26,7 @@
* <description></description> * <description></description>
* @alias module:<#apiPackage><apiPackage>/</apiPackage><classname> * @alias module:<#apiPackage><apiPackage>/</apiPackage><classname>
* @class * @class
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance} * @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
* if unspecified. * if unspecified.
*/ */
</emitJSDoc> var exports = function(apiClient) { </emitJSDoc> var exports = function(apiClient) {
@ -46,7 +46,7 @@
* <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></required></allParams></hasOptionalParams><^usePromises> * @param <&vendorExtensions.x-jsdoc-type> opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></allParams></hasOptionalParams><^usePromises>
* @param {module:<#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback} callback The callback function, accepting three arguments: error, data, response</usePromises><#returnType> * @param {module:<#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback} callback The callback function, accepting three arguments: error, data, response</usePromises><#returnType>
* data is of type: <&vendorExtensions.x-jsdoc-type></returnType> * data is of type: <&vendorExtensions.x-jsdoc-type></returnType>
*/ */

View File

@ -39,7 +39,7 @@ var {{{name}}} = defaultClient.authentications['{{{name}}}'];
{{/authMethods}} {{/authMethods}}
{{/hasAuthMethods}} {{/hasAuthMethods}}
var api = new {{{moduleName}}}.{{{classname}}}(){{#hasParams}} var apiInstance = new {{{moduleName}}}.{{{classname}}}(){{#hasParams}}
{{#vendorExtensions.x-codegen-hasRequiredParams}}{{#allParams}}{{#required}} {{#vendorExtensions.x-codegen-hasRequiredParams}}{{#allParams}}{{#required}}
var {{{paramName}}} = {{{example}}}; // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}} var {{{paramName}}} = {{{example}}}; // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}
{{/required}}{{/allParams}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}} {{/required}}{{/allParams}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}}
@ -47,7 +47,7 @@ var opts = { {{#allParams}}{{^required}}
'{{{paramName}}}': {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}{{/required}}{{/allParams}} '{{{paramName}}}': {{{example}}}{{#vendorExtensions.x-codegen-hasMoreOptional}},{{/vendorExtensions.x-codegen-hasMoreOptional}} // {{=< >=}}{<&dataType>}<={{ }}=> {{{description}}}{{/required}}{{/allParams}}
};{{/hasOptionalParams}}{{/hasParams}} };{{/hasOptionalParams}}{{/hasParams}}
{{#usePromises}} {{#usePromises}}
api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}).then(function({{#returnType}}data{{/returnType}}) { apiInstance.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}).then(function({{#returnType}}data{{/returnType}}) {
{{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}} {{#returnType}}console.log('API called successfully. Returned data: ' + data);{{/returnType}}{{^returnType}}console.log('API called successfully.');{{/returnType}}
}, function(error) { }, function(error) {
console.error(error); console.error(error);

View File

@ -1,69 +1,79 @@
# swagger-petstore # swagger-petstore
SwaggerPetstore - JavaScript client for swagger-petstore SwaggerPetstore - JavaScript client for swagger-petstore
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
Version: 1.0.0 - API verion: 1.0.0
- Package version: 1.0.0
Automatically generated by the JavaScript Swagger Codegen project: - Build date: 2016-03-18T18:26:17.121+08:00
- Build date: 2016-03-18T12:55:58.976Z
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation ## Installation
### Use in [Node.js](https://nodejs.org/) ### For [Node.js](https://nodejs.org/)
The generated client is valid [npm](https://www.npmjs.com/) package, you can publish it as described #### npm
in [Publishing npm packages](https://docs.npmjs.com/getting-started/publishing-npm-packages).
After that, you can install it into your project via: To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
Then install it via:
```shell ```shell
npm install swagger-petstore --save npm install swagger-petstore --save
``` ```
You can also host the generated client as a git repository on github, e.g. #### git
https://github.com/YOUR_USERNAME/swagger-petstore #
If the library is hosted at a git repository, e.g.
Then you can install it via: https://github.com/YOUR_USERNAME/YOUR_GIT_REPO_ID
then install it via:
```shell ```shell
npm install YOUR_USERNAME/swagger-petstore --save npm install YOUR_USERNAME/YOUR_GIT_REPO_ID --save
``` ```
### Use in browser with [browserify](http://browserify.org/) ### For browser
The client also works in browser environment via npm and browserify. After following The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`, the above steps with Node.js and installing browserify with `npm install -g browserify`,
you can do this in your project (assuming *main.js* is your entry file): perform the following (assuming *main.js* is your entry file):
```shell ```shell
browserify main.js > bundle.js browserify main.js > bundle.js
``` ```
The generated *bundle.js* can now be included in your HTML pages. Then include *bundle.js* in the HTML pages.
## Getting Started ## Getting Started
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var defaultClient = SwaggerPetstore.ApiClient.default; var defaultClient = SwaggerPetstore.ApiClient.default;
defaultClient.timeout = 10 * 1000;
defaultClient.defaultHeaders['Test-Header'] = 'test_value';
// Assuming there's a `PetApi` containing a `getPetById` method // Configure OAuth2 access token for authorization: petstore_auth
// which returns a model object: var petstore_auth = defaultClient.authentications['petstore_auth'];
var api = new SwaggerPetstore.PetApi(); petstore_auth.accessToken = "YOUR ACCESS TOKEN"
api.getPetById(2, function(err, pet, resp) {
console.log('HTTP status code: ' + resp.status); var api = new SwaggerPetstore.PetApi()
console.log('Response Content-Type: ' + resp.get('Content-Type'));
if (err) { var opts = {
console.error(err); 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else { } else {
console.log(pet); console.log('API called successfully.');
} }
}); };
api.addPet(opts, callback);
``` ```
## Documentation for API Endpoints ## Documentation for API Endpoints

View File

@ -34,7 +34,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var opts = { var opts = {
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
@ -86,7 +86,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var opts = { var opts = {
'body': "B" // {String} Pet object in the form of byte array 'body': "B" // {String} Pet object in the form of byte array
@ -138,7 +138,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = 789; // {Integer} Pet id to delete var petId = 789; // {Integer} Pet id to delete
@ -193,7 +193,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var opts = { var opts = {
'status': ["available"] // {[String]} Status values that need to be considered for query 'status': ["available"] // {[String]} Status values that need to be considered for query
@ -245,7 +245,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var opts = { var opts = {
'tags': ["tags_example"] // {[String]} Tags to filter by 'tags': ["tags_example"] // {[String]} Tags to filter by
@ -303,7 +303,7 @@ api_key.apiKey = "YOUR API KEY"
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = 789; // {Integer} ID of pet that needs to be fetched var petId = 789; // {Integer} ID of pet that needs to be fetched
@ -360,7 +360,7 @@ api_key.apiKey = "YOUR API KEY"
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = 789; // {Integer} ID of pet that needs to be fetched var petId = 789; // {Integer} ID of pet that needs to be fetched
@ -417,7 +417,7 @@ api_key.apiKey = "YOUR API KEY"
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = 789; // {Integer} ID of pet that needs to be fetched var petId = 789; // {Integer} ID of pet that needs to be fetched
@ -468,7 +468,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var opts = { var opts = {
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store 'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
@ -520,7 +520,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = "petId_example"; // {String} ID of pet that needs to be updated var petId = "petId_example"; // {String} ID of pet that needs to be updated
@ -577,7 +577,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
var petstore_auth = defaultClient.authentications['petstore_auth']; var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN" petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi() var apiInstance = new SwaggerPetstore.PetApi()
var petId = 789; // {Integer} ID of pet to update var petId = 789; // {Integer} ID of pet to update

View File

@ -24,7 +24,7 @@ For valid response try integer IDs with value &lt; 1000. Anything above 1000 or
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted
@ -83,7 +83,7 @@ test_api_client_secret.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token" //test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var opts = { var opts = {
'status': "placed" // {String} Status value that needs to be considered for query 'status': "placed" // {String} Status value that needs to be considered for query
@ -137,7 +137,7 @@ api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token" //api_key.apiKeyPrefix['api_key'] = "Token"
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var callback = function(error, data, response) { var callback = function(error, data, response) {
if (error) { if (error) {
@ -184,7 +184,7 @@ api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token" //api_key.apiKeyPrefix['api_key'] = "Token"
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var callback = function(error, data, response) { var callback = function(error, data, response) {
if (error) { if (error) {
@ -237,7 +237,7 @@ test_api_key_query.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token" //test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token"
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched
@ -296,7 +296,7 @@ test_api_client_secret.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token" //test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
var api = new SwaggerPetstore.StoreApi() var apiInstance = new SwaggerPetstore.StoreApi()
var opts = { var opts = {
'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet 'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet

View File

@ -26,7 +26,7 @@ This can only be done by the logged in user.
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var opts = { var opts = {
'body': new SwaggerPetstore.User() // {User} Created user object 'body': new SwaggerPetstore.User() // {User} Created user object
@ -73,7 +73,7 @@ Creates list of users with given input array
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var opts = { var opts = {
'body': [new SwaggerPetstore.User()] // {[User]} List of user object 'body': [new SwaggerPetstore.User()] // {[User]} List of user object
@ -120,7 +120,7 @@ Creates list of users with given input array
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var opts = { var opts = {
'body': [new SwaggerPetstore.User()] // {[User]} List of user object 'body': [new SwaggerPetstore.User()] // {[User]} List of user object
@ -173,7 +173,7 @@ var test_http_basic = defaultClient.authentications['test_http_basic'];
test_http_basic.username = 'YOUR USERNAME' test_http_basic.username = 'YOUR USERNAME'
test_http_basic.password = 'YOUR PASSWORD' test_http_basic.password = 'YOUR PASSWORD'
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var username = "username_example"; // {String} The name that needs to be deleted var username = "username_example"; // {String} The name that needs to be deleted
@ -219,7 +219,7 @@ Get user by user name
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing. var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing.
@ -265,7 +265,7 @@ Logs user into the system
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var opts = { var opts = {
'username': "username_example", // {String} The user name for login 'username': "username_example", // {String} The user name for login
@ -314,7 +314,7 @@ Logs out current logged in user session
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var callback = function(error, data, response) { var callback = function(error, data, response) {
if (error) { if (error) {
@ -354,7 +354,7 @@ This can only be done by the logged in user.
```javascript ```javascript
var SwaggerPetstore = require('swagger-petstore'); var SwaggerPetstore = require('swagger-petstore');
var api = new SwaggerPetstore.UserApi() var apiInstance = new SwaggerPetstore.UserApi()
var username = "username_example"; // {String} name that need to be deleted var username = "username_example"; // {String} name that need to be deleted

View File

@ -25,7 +25,11 @@
* Constructs a new PetApi. * Constructs a new PetApi.
* @alias module:api/PetApi * @alias module:api/PetApi
* @class * @class
<<<<<<< HEAD
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance} * @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance}
=======
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
>>>>>>> update js doc
* if unspecified. * if unspecified.
*/ */
var exports = function(apiClient) { var exports = function(apiClient) {
@ -175,7 +179,11 @@
* 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 {Object} opts Optional parameters * @param {Object} opts Optional parameters
<<<<<<< HEAD
* @param {Array.<String>} opts.status Status values that need to be considered for query * @param {Array.<String>} opts.status Status values that need to be considered for query
=======
* @param {Array.<String>} opts.status Status values that need to be considered for query (default to available)
>>>>>>> update js doc
* @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: {Array.<module:model/Pet>}
*/ */

View File

@ -25,7 +25,7 @@
* Constructs a new StoreApi. * Constructs a new StoreApi.
* @alias module:api/StoreApi * @alias module:api/StoreApi
* @class * @class
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance} * @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
* if unspecified. * if unspecified.
*/ */
var exports = function(apiClient) { var exports = function(apiClient) {
@ -89,7 +89,7 @@
* Finds orders by status * Finds orders by status
* A single status value can be provided as a string * A single status value can be provided as a string
* @param {Object} opts Optional parameters * @param {Object} opts Optional parameters
* @param {module:model/String} opts.status Status value that needs to be considered for query * @param {module:model/String} opts.status Status value that needs to be considered for query (default to placed)
* @param {module:api/StoreApi~findOrdersByStatusCallback} callback The callback function, accepting three arguments: error, data, response * @param {module:api/StoreApi~findOrdersByStatusCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {Array.<module:model/Order>} * data is of type: {Array.<module:model/Order>}
*/ */

View File

@ -25,7 +25,7 @@
* Constructs a new UserApi. * Constructs a new UserApi.
* @alias module:api/UserApi * @alias module:api/UserApi
* @class * @class
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance} * @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
* if unspecified. * if unspecified.
*/ */
var exports = function(apiClient) { var exports = function(apiClient) {