fix typescript tmeplate folder

This commit is contained in:
wing328 2016-05-02 22:16:07 +08:00
parent d6158c4c55
commit d64af1b836
13 changed files with 44 additions and 231 deletions

View File

@ -60,6 +60,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
// mapped to String as a workaround
typeMapping.put("binary", "string");
typeMapping.put("ByteArray", "string");
typeMapping.put("UUID", "string");
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));

View File

@ -136,6 +136,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
// binary not supported in JavaScript client right now, using String as a workaround
typeMapping.put("ByteArray", "String"); // I don't see ByteArray defined in the Swagger docs.
typeMapping.put("binary", "String");
typeMapping.put("UUID", "String");
importMapping.clear();

View File

@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-05-01T12:06:44.623+08:00
- Build date: 2016-05-02T22:07:48.077+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation

View File

@ -41,35 +41,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/**
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
*
* @param body Pet object in the form of byte array
*/
public addPetUsingByteArray (body?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const localVarPath = this.basePath + '/pet?testing_byte_array=true';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = {
method: 'POST',
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
@ -102,8 +73,6 @@ namespace API.Client {
method: 'DELETE',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -116,8 +85,8 @@ namespace API.Client {
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for query
* Multiple status values can be provided with comma seperated strings
* @param status Status values that need to be considered for filter
*/
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
const localVarPath = this.basePath + '/pet/findByStatus';
@ -132,8 +101,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -162,8 +129,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -193,70 +158,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/**
* Fake endpoint to test inline arbitrary object return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
*/
public getPetByIdInObject (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<InlineResponse200> {
const localVarPath = this.basePath + '/pet/{petId}?response=inline_arbitrary_object'
.replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling getPetByIdInObject');
}
let httpRequestParams: any = {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/**
* Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched
*/
public petPetIdtestingByteArraytrueGet (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
const localVarPath = this.basePath + '/pet/{petId}?testing_byte_array=true'
.replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling petPetIdtestingByteArraytrueGet');
}
let httpRequestParams: any = {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -282,8 +183,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
@ -323,9 +222,7 @@ namespace API.Client {
method: 'POST',
url: localVarPath,
json: false,
data: this.$httpParamSerializer(formParams),
params: queryParameters,
headers: headerParams
};
@ -365,9 +262,7 @@ namespace API.Client {
method: 'POST',
url: localVarPath,
json: false,
data: this.$httpParamSerializer(formParams),
params: queryParameters,
headers: headerParams
};

View File

@ -45,38 +45,6 @@ namespace API.Client {
method: 'DELETE',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
*/
public findOrdersByStatus (status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Order>> {
const localVarPath = this.basePath + '/store/findByStatus';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
if (status !== undefined) {
queryParameters['status'] = status;
}
let httpRequestParams: any = {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -100,33 +68,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/**
* Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
* Returns an arbitrary object which is actually a map of status codes to quantities
*/
public getInventoryInObject (extraHttpRequestParams?: any ) : ng.IHttpPromise<any> {
const localVarPath = this.basePath + '/store/inventory?response=arbitrary_object';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -139,7 +80,7 @@ namespace API.Client {
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
*/
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
@ -156,8 +97,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -183,8 +122,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};

View File

@ -41,8 +41,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
@ -68,8 +66,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
@ -95,8 +91,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};
@ -126,8 +120,6 @@ namespace API.Client {
method: 'DELETE',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -157,8 +149,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -192,8 +182,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -217,8 +205,6 @@ namespace API.Client {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
@ -250,8 +236,6 @@ namespace API.Client {
url: localVarPath,
json: true,
data: body,
params: queryParameters,
headers: headerParams
};

View File

@ -1,11 +1,6 @@
/// <reference path="Category.ts" />
/// <reference path="InlineResponse200.ts" />
/// <reference path="Model200Response.ts" />
/// <reference path="ModelReturn.ts" />
/// <reference path="Name.ts" />
/// <reference path="Order.ts" />
/// <reference path="Pet.ts" />
/// <reference path="SpecialModelName.ts" />
/// <reference path="Tag.ts" />
/// <reference path="User.ts" />

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi

View File

@ -129,8 +129,8 @@ export class PetApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -409,10 +409,10 @@ export class PetApi {
json: true,
}
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
if (Object.keys(formParams).length) {
@ -632,8 +632,8 @@ export class StoreApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -881,8 +881,8 @@ export class UserApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi

View File

@ -129,8 +129,8 @@ export class PetApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -409,10 +409,10 @@ export class PetApi {
json: true,
}
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
if (Object.keys(formParams).length) {
@ -632,8 +632,8 @@ export class StoreApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
@ -881,8 +881,8 @@ export class UserApi {
protected authentications = {
'default': <Authentication>new VoidAuth(),
'petstore_auth': new OAuth(),
'api_key': new ApiKeyAuth('header', 'api_key'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="YOUR_GIT_USR_ID"
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="YOUR_GIT_REPO_ID"
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi

View File

@ -1,6 +1,6 @@
{
"name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1-SNAPSHOT.201604282147",
"version": "0.0.1-SNAPSHOT.201605022215",
"description": "NodeJS client for @swagger/angular2-typescript-petstore",
"main": "api.js",
"scripts": {