forked from loafle/openapi-generator-original
Fix, tests for Issue#2240 "Support invokerPackage configuration option"
This commit is contained in:
parent
cd0633a04f
commit
14ceb4bf84
@ -63,6 +63,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
protected String projectVersion;
|
||||
protected String projectLicenseName;
|
||||
|
||||
protected String invokerPackage;
|
||||
protected String sourceFolder = "src";
|
||||
protected String localVariablePrefix = "";
|
||||
protected boolean usePromises;
|
||||
@ -137,6 +138,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC).defaultValue("src"));
|
||||
cliOptions.add(new CliOption(CodegenConstants.LOCAL_VARIABLE_PREFIX, CodegenConstants.LOCAL_VARIABLE_PREFIX_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, CodegenConstants.INVOKER_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC));
|
||||
cliOptions.add(new CliOption(PROJECT_NAME,
|
||||
@ -203,6 +205,9 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
|
||||
setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER));
|
||||
}
|
||||
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
|
||||
setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
|
||||
}
|
||||
if (additionalProperties.containsKey(USE_PROMISES)) {
|
||||
setUsePromises(Boolean.parseBoolean((String)additionalProperties.get(USE_PROMISES)));
|
||||
}
|
||||
@ -265,6 +270,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
additionalProperties.put(PROJECT_DESCRIPTION, escapeText(projectDescription));
|
||||
additionalProperties.put(PROJECT_VERSION, projectVersion);
|
||||
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
|
||||
additionalProperties.put(CodegenConstants.LOCAL_VARIABLE_PREFIX, localVariablePrefix);
|
||||
additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
||||
additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder);
|
||||
@ -278,8 +284,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", sourceFolder, "index.js"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", sourceFolder, "ApiClient.js"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", createPath(sourceFolder, invokerPackage), "index.js"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", createPath(sourceFolder, invokerPackage), "ApiClient.js"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
}
|
||||
@ -289,14 +295,35 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
return "_" + name;
|
||||
}
|
||||
|
||||
private String createPath(String... segments) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (String segment : segments) {
|
||||
if (!StringUtils.isEmpty(segment) && !segment.equals(".")) {
|
||||
if (buf.length() != 0)
|
||||
buf.append(File.separatorChar);
|
||||
buf.append(segment);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < buf.length(); i++) {
|
||||
char c = buf.charAt(i);
|
||||
if ((c == '/' || c == '\\') && c != File.separatorChar)
|
||||
buf.setCharAt(i, File.separatorChar);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
return outputFolder + '/' + sourceFolder + '/' + apiPackage().replace('.', '/');
|
||||
return createPath(outputFolder, sourceFolder, invokerPackage, apiPackage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
return outputFolder + '/' + sourceFolder + '/' + modelPackage().replace('.', '/');
|
||||
return createPath(outputFolder, sourceFolder, invokerPackage, modelPackage());
|
||||
}
|
||||
|
||||
public void setInvokerPackage(String invokerPackage) {
|
||||
this.invokerPackage = invokerPackage;
|
||||
}
|
||||
|
||||
public void setSourceFolder(String sourceFolder) {
|
||||
@ -345,12 +372,12 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||
return createPath(outputFolder, apiDocPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelDocFileFolder() {
|
||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
return createPath(outputFolder, modelDocPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -694,7 +721,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
|
||||
private String getModelledType(String dataType) {
|
||||
return "module:" + (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType;
|
||||
return "module:" + (StringUtils.isEmpty(invokerPackage) ? "" : (invokerPackage + "/"))
|
||||
+ (StringUtils.isEmpty(modelPackage) ? "" : (modelPackage + "/")) + dataType;
|
||||
}
|
||||
|
||||
private String getJSDocTypeWithBraces(CodegenModel cm, CodegenProperty cp) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
'use strict';
|
||||
|
||||
{{#emitJSDoc}} /**
|
||||
* @module ApiClient
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient
|
||||
* @version {{projectVersion}}
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
|
||||
* application to use this class directly - the *Api and model classes provide the public API for the service. The
|
||||
* contents of this file should be regarded as internal but are documented for completeness.
|
||||
* @alias module:ApiClient
|
||||
* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient
|
||||
* @class
|
||||
*/
|
||||
{{/emitJSDoc}} var exports = function() {
|
||||
@ -218,7 +218,7 @@
|
||||
/**
|
||||
* Builds a string representation of an array-type actual parameter, according to the given collection format.
|
||||
* @param {Array} param An array parameter.
|
||||
* @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
|
||||
* @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
|
||||
* @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
|
||||
* <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
|
||||
*/
|
||||
@ -309,7 +309,7 @@
|
||||
|
||||
{{#emitJSDoc}}{{^usePromises}} /**
|
||||
* Callback function to receive the result of the operation.
|
||||
* @callback module:ApiClient~callApiCallback
|
||||
* @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback
|
||||
* @param {String} error Error message, if any.
|
||||
* @param data The data returned by the service call.
|
||||
* @param {String} response The complete HTTP response.
|
||||
@ -329,7 +329,7 @@
|
||||
* @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
|
||||
* constructor for a complex type.{{^usePromises}}
|
||||
* @param {module:ApiClient~callApiCallback} callback The callback function.
|
||||
* @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.
|
||||
{{/usePromises}} * @returns {{#usePromises}}{Promise} A Promise object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}.
|
||||
*/
|
||||
{{/emitJSDoc}} exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
|
||||
@ -476,7 +476,7 @@
|
||||
|
||||
{{#emitJSDoc}} /**
|
||||
* The default API client implementation.
|
||||
* @type {module:ApiClient}
|
||||
* @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient}
|
||||
*/
|
||||
{{/emitJSDoc}} exports.instance = new exports();
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{/appDescription}}
|
||||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API verion: {{appVersion}}
|
||||
- API version: {{appVersion}}
|
||||
- Package version: {{projectVersion}}
|
||||
- Build date: {{generatedDate}}
|
||||
- Build package: {{generatorClass}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{=< >=}}(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'<#imports>, '../<#modelPackage><modelPackage>/</modelPackage><import>'</imports>], factory);
|
||||
define(['<#invokerPackage><invokerPackage>/</invokerPackage>ApiClient'<#imports>, '<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><import>'</imports>], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient')<#imports>, require('../<#modelPackage><modelPackage>/</modelPackage><import>')</imports>);
|
||||
@ -17,17 +17,17 @@
|
||||
|
||||
<#emitJSDoc> /**
|
||||
* <baseName> service.
|
||||
* @module <#apiPackage><apiPackage>/</apiPackage><classname>
|
||||
* @module <#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>
|
||||
* @version <projectVersion>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <classname>. <#description>
|
||||
* <description></description>
|
||||
* @alias module:<#apiPackage><apiPackage>/</apiPackage><classname>
|
||||
* @alias module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:<#invokerPackage><invokerPackage>/</invokerPackage>ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:<#invokerPackage><invokerPackage>/</invokerPackage>ApiClient#instance} if unspecified.
|
||||
*/
|
||||
</emitJSDoc> var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
@ -35,7 +35,7 @@
|
||||
<#operations><#operation><#emitJSDoc><^usePromises>
|
||||
/**
|
||||
* Callback function to receive the result of the <nickname> operation.
|
||||
* @callback module:<#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback
|
||||
* @callback module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback
|
||||
* @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 {String} response The complete HTTP response.
|
||||
@ -47,7 +47,7 @@
|
||||
* @param <&vendorExtensions.x-jsdoc-type> <paramName> <description></required></allParams><#hasOptionalParams>
|
||||
* @param {Object} opts Optional parameters<#allParams><^required>
|
||||
* @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:<#invokerPackage><invokerPackage>/</invokerPackage><#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>
|
||||
*/
|
||||
</emitJSDoc> this.<nickname> = function(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams>
|
||||
|
@ -80,7 +80,7 @@ Name | Type | Description | Notes
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient'{{#models}}, './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory);
|
||||
define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}});
|
||||
@ -15,7 +15,7 @@
|
||||
* <p>
|
||||
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
||||
* <pre>
|
||||
* var {{moduleName}} = require('./index'); // See note below*.
|
||||
* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
|
||||
* var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
|
||||
* var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
|
||||
* yyyModel.someProperty = 'someValue';
|
||||
@ -23,8 +23,8 @@
|
||||
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
|
||||
* ...
|
||||
* </pre>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
|
||||
* callback function.</em>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...})
|
||||
* and put the application logic within the callback function.</em>
|
||||
* </p>
|
||||
* <p>
|
||||
* A non-AMD browser application (discouraged) might do something like this:
|
||||
@ -37,23 +37,23 @@
|
||||
* ...
|
||||
* </pre>
|
||||
* </p>
|
||||
* @module index
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index
|
||||
* @version {{projectVersion}}
|
||||
*/{{/emitJSDoc}}
|
||||
{{=< >=}} var exports = {<#emitJSDoc>
|
||||
/**
|
||||
* The ApiClient constructor.
|
||||
* @property {module:ApiClient}
|
||||
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage>ApiClient}
|
||||
*/</emitJSDoc>
|
||||
ApiClient: ApiClient<#models>,<#emitJSDoc>
|
||||
/**
|
||||
* The <importPath> model constructor.
|
||||
* @property {module:<#modelPackage><modelPackage>/</modelPackage><importPath>}
|
||||
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><importPath>}
|
||||
*/</emitJSDoc>
|
||||
<importPath>: <importPath></models><#apiInfo><#apis>,<#emitJSDoc>
|
||||
/**
|
||||
* The <importPath> service constructor.
|
||||
* @property {module:<#apiPackage><apiPackage>/</apiPackage><importPath>}
|
||||
* @property {module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><importPath>}
|
||||
*/</emitJSDoc>
|
||||
<importPath>: <importPath></apis></apiInfo>
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'{{#imports}}, './{{import}}'{{/imports}}], factory);
|
||||
define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{import}}'{{/imports}}], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'){{#imports}}, require('./{{import}}'){{/imports}});
|
||||
@ -17,17 +17,17 @@
|
||||
|
||||
{{#models}}{{#model}}{{#emitJSDoc}} /**
|
||||
* The {{classname}} model module.
|
||||
* @module {{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @version {{projectVersion}}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <code>{{classname}}</code>.{{#description}}
|
||||
* {{description}}{{/description}}
|
||||
* @alias module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @class{{#useInheritance}}{{#parent}}
|
||||
* @extends module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{parent}}{{/parent}}{{#interfaces}}
|
||||
* @implements module:{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
||||
* @extends module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{parent}}{{/parent}}{{#interfaces}}
|
||||
* @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}}
|
||||
* @param {{.}}{{/vendorExtensions.x-all-required}}
|
||||
*/{{/emitJSDoc}}
|
||||
var exports = function({{#vendorExtensions.x-all-required}}{{.}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
||||
@ -40,8 +40,8 @@
|
||||
* Constructs a <code>{{classname}}</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {{=< >=}}{module:<#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> obj Optional instance to populate.
|
||||
* @return {{=< >=}}{module:<#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> The populated <code>{{classname}}</code> instance.
|
||||
* @param {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> obj Optional instance to populate.
|
||||
* @return {{=< >=}}{module:<#invokerPackage><invokerPackage>/</invokerPackage><#modelPackage><modelPackage>/</modelPackage><classname>}<={{ }}=> The populated <code>{{classname}}</code> instance.
|
||||
*/
|
||||
{{/emitJSDoc}} exports.constructFromObject = function(data, obj) {
|
||||
if (data) { {{!// TODO: support polymorphism: discriminator property on data determines class to instantiate.}}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "{{{projectVersion}}}",
|
||||
"description": "{{{projectDescription}}}",{{#projectLicenseName}}
|
||||
"license": "{{{projectLicenseName}}}",{{/projectLicenseName}}
|
||||
"main": "{{sourceFolder}}/index.js",
|
||||
"main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",
|
||||
"scripts": {
|
||||
"test": "./node_modules/mocha/bin/mocha --recursive"
|
||||
},
|
||||
|
@ -30,6 +30,8 @@ public class JavaScriptClientOptionsTest extends AbstractOptionsTest {
|
||||
protected void setExpectations() {
|
||||
// Commented generic options not yet supported by JavaScript codegen.
|
||||
new Expectations(clientCodegen) {{
|
||||
clientCodegen.setInvokerPackage(JavaScriptOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setModelPackage(JavaScriptOptionsProvider.MODEL_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
clientCodegen.setApiPackage(JavaScriptOptionsProvider.API_PACKAGE_VALUE);
|
||||
|
@ -10,9 +10,9 @@ import java.util.Map;
|
||||
|
||||
public class JavaScriptOptionsProvider implements OptionsProvider {
|
||||
public static final String ARTIFACT_ID_VALUE = "swagger-javascript-client-test";
|
||||
public static final String INVOKER_PACKAGE_VALUE = "invoker";
|
||||
public static final String MODEL_PACKAGE_VALUE = "model";
|
||||
public static final String API_PACKAGE_VALUE = "api";
|
||||
// public static final String INVOKER_PACKAGE_VALUE = "js";
|
||||
public static final String SORT_PARAMS_VALUE = "false";
|
||||
public static final String GROUP_ID_VALUE = "io.swagger.test";
|
||||
public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT";
|
||||
@ -38,11 +38,11 @@ public class JavaScriptOptionsProvider implements OptionsProvider {
|
||||
public JavaScriptOptionsProvider() {
|
||||
// Commented generic options not yet supported by JavaScript codegen.
|
||||
options = new ImmutableMap.Builder<String, String>()
|
||||
.put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE)
|
||||
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE)
|
||||
.put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE)
|
||||
// .put(CodegenConstants.INVOKER_PACKAGE, INVOKER_PACKAGE_VALUE)
|
||||
// .put(CodegenConstants.GROUP_ID, GROUP_ID_VALUE)
|
||||
// .put(CodegenConstants.ARTIFACT_ID, ARTIFACT_ID_VALUE)
|
||||
// .put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE)
|
||||
|
@ -4,9 +4,9 @@ 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:
|
||||
|
||||
- API verion: 1.0.0
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-03-24T19:50:42.301+08:00
|
||||
- Build date: 2016-03-25T16:32:33.021Z
|
||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
|
@ -61,7 +61,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -110,7 +110,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -162,7 +162,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -211,7 +211,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -260,7 +260,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -314,7 +314,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -368,7 +368,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -422,7 +422,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -471,7 +471,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -525,7 +525,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -579,7 +579,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -50,7 +50,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -107,7 +107,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -151,7 +151,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -195,7 +195,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -251,7 +251,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -308,7 +308,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -53,7 +53,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -97,7 +97,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -141,7 +141,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -190,7 +190,7 @@ null (empty response body)
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -233,7 +233,7 @@ Name | Type | Description | Notes
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -279,7 +279,7 @@ Name | Type | Description | Notes
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -316,7 +316,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -363,7 +363,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/Pet', '../model/InlineResponse200'], factory);
|
||||
define(['ApiClient', 'model/Pet', 'model/InlineResponse200'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/Pet'), require('../model/InlineResponse200'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new PetApi.
|
||||
* @alias module:api/PetApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/Order'], factory);
|
||||
define(['ApiClient', 'model/Order'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/Order'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new StoreApi.
|
||||
* @alias module:api/StoreApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/User'], factory);
|
||||
define(['ApiClient', 'model/User'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/User'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new UserApi.
|
||||
* @alias module:api/UserApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/Model200Response', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
define(['ApiClient', 'model/Category', 'model/InlineResponse200', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
@ -15,7 +15,7 @@
|
||||
* <p>
|
||||
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
||||
* <pre>
|
||||
* var SwaggerPetstore = require('./index'); // See note below*.
|
||||
* var SwaggerPetstore = require('index'); // See note below*.
|
||||
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
|
||||
* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
|
||||
* yyyModel.someProperty = 'someValue';
|
||||
@ -23,8 +23,8 @@
|
||||
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
|
||||
* ...
|
||||
* </pre>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
|
||||
* callback function.</em>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['index'], function(){...})
|
||||
* and put the application logic within the callback function.</em>
|
||||
* </p>
|
||||
* <p>
|
||||
* A non-AMD browser application (discouraged) might do something like this:
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', './Tag'], factory);
|
||||
define(['ApiClient', 'model/Tag'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('./Tag'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', './Category', './Tag'], factory);
|
||||
define(['ApiClient', 'model/Category', 'model/Tag'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -4,9 +4,9 @@ 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:
|
||||
|
||||
- API verion: 1.0.0
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-03-24T19:50:27.240+08:00
|
||||
- Build date: 2016-03-25T16:30:21.376Z
|
||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
|
@ -64,7 +64,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -116,7 +116,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -171,7 +171,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -223,7 +223,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -275,7 +275,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -332,7 +332,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -389,7 +389,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -446,7 +446,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -498,7 +498,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -555,7 +555,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -612,7 +612,7 @@ null (empty response body)
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -53,7 +53,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -113,7 +113,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -160,7 +160,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -207,7 +207,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -266,7 +266,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -326,7 +326,7 @@ Name | Type | Description | Notes
|
||||
|
||||
[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -56,7 +56,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -103,7 +103,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -150,7 +150,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -202,7 +202,7 @@ null (empty response body)
|
||||
|
||||
[test_http_basic](../README.md#test_http_basic)
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -248,7 +248,7 @@ Name | Type | Description | Notes
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -297,7 +297,7 @@ Name | Type | Description | Notes
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -337,7 +337,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
@ -387,7 +387,7 @@ null (empty response body)
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP reuqest headers
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json, application/xml
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/Pet', '../model/InlineResponse200'], factory);
|
||||
define(['ApiClient', 'model/Pet', 'model/InlineResponse200'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/Pet'), require('../model/InlineResponse200'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new PetApi.
|
||||
* @alias module:api/PetApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/Order'], factory);
|
||||
define(['ApiClient', 'model/Order'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/Order'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new StoreApi.
|
||||
* @alias module:api/StoreApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', '../model/User'], factory);
|
||||
define(['ApiClient', 'model/User'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('../model/User'));
|
||||
@ -25,8 +25,8 @@
|
||||
* Constructs a new UserApi.
|
||||
* @alias module:api/UserApi
|
||||
* @class
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||
* if unspecified.
|
||||
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
var exports = function(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['./ApiClient', './model/Category', './model/InlineResponse200', './model/Model200Response', './model/ModelReturn', './model/Name', './model/Order', './model/Pet', './model/SpecialModelName', './model/Tag', './model/User', './api/PetApi', './api/StoreApi', './api/UserApi'], factory);
|
||||
define(['ApiClient', 'model/Category', 'model/InlineResponse200', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/InlineResponse200'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
@ -15,7 +15,7 @@
|
||||
* <p>
|
||||
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
||||
* <pre>
|
||||
* var SwaggerPetstore = require('./index'); // See note below*.
|
||||
* var SwaggerPetstore = require('index'); // See note below*.
|
||||
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
|
||||
* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
|
||||
* yyyModel.someProperty = 'someValue';
|
||||
@ -23,8 +23,8 @@
|
||||
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
|
||||
* ...
|
||||
* </pre>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
|
||||
* callback function.</em>
|
||||
* <em>*NOTE: For a top-level AMD script, use require(['index'], function(){...})
|
||||
* and put the application logic within the callback function.</em>
|
||||
* </p>
|
||||
* <p>
|
||||
* A non-AMD browser application (discouraged) might do something like this:
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', './Tag'], factory);
|
||||
define(['ApiClient', 'model/Tag'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('./Tag'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient', './Category', './Tag'], factory);
|
||||
define(['ApiClient', 'model/Category', 'model/Tag'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['../ApiClient'], factory);
|
||||
define(['ApiClient'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user