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 // mapped to String as a workaround
typeMapping.put("binary", "string"); typeMapping.put("binary", "string");
typeMapping.put("ByteArray", "string"); typeMapping.put("ByteArray", "string");
typeMapping.put("UUID", "string");
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase")); 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 // 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("ByteArray", "String"); // I don't see ByteArray defined in the Swagger docs.
typeMapping.put("binary", "String"); typeMapping.put("binary", "String");
typeMapping.put("UUID", "String");
importMapping.clear(); 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 - API version: 1.0.0
- Package 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 - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation ## Installation

View File

@ -41,36 +41,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
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 headers: headerParams
}; };
@ -102,9 +73,7 @@ namespace API.Client {
method: 'DELETE', method: 'DELETE',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -116,8 +85,8 @@ namespace API.Client {
} }
/** /**
* 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 seperated strings
* @param status Status values that need to be considered for query * @param status Status values that need to be considered for filter
*/ */
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> { public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
const localVarPath = this.basePath + '/pet/findByStatus'; const localVarPath = this.basePath + '/pet/findByStatus';
@ -132,9 +101,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -162,9 +129,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -193,71 +158,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
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 headers: headerParams
}; };
@ -282,9 +183,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -323,9 +222,7 @@ namespace API.Client {
method: 'POST', method: 'POST',
url: localVarPath, url: localVarPath,
json: false, json: false,
data: this.$httpParamSerializer(formParams),
data: this.$httpParamSerializer(formParams),
params: queryParameters, params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -365,9 +262,7 @@ namespace API.Client {
method: 'POST', method: 'POST',
url: localVarPath, url: localVarPath,
json: false, json: false,
data: this.$httpParamSerializer(formParams),
data: this.$httpParamSerializer(formParams),
params: queryParameters, params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -45,39 +45,7 @@ namespace API.Client {
method: 'DELETE', method: 'DELETE',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
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 headers: headerParams
}; };
@ -100,34 +68,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
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 headers: headerParams
}; };
@ -139,7 +80,7 @@ namespace API.Client {
} }
/** /**
* Find purchase order by ID * 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 * @param orderId ID of pet that needs to be fetched
*/ */
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> { public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
@ -156,9 +97,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -183,9 +122,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -41,9 +41,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -68,9 +66,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -95,9 +91,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -126,9 +120,7 @@ namespace API.Client {
method: 'DELETE', method: 'DELETE',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -141,7 +133,7 @@ namespace API.Client {
/** /**
* Get user by user name * Get user by user name
* *
* @param username The name that needs to be fetched. Use user1 for testing. * @param username The name that needs to be fetched. Use user1 for testing.
*/ */
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> { public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
const localVarPath = this.basePath + '/user/{username}' const localVarPath = this.basePath + '/user/{username}'
@ -157,9 +149,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -192,9 +182,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -217,9 +205,7 @@ namespace API.Client {
method: 'GET', method: 'GET',
url: localVarPath, url: localVarPath,
json: true, json: true,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };
@ -250,9 +236,7 @@ namespace API.Client {
url: localVarPath, url: localVarPath,
json: true, json: true,
data: body, data: body,
params: queryParameters,
params: queryParameters,
headers: headerParams headers: headerParams
}; };

View File

@ -1,11 +1,6 @@
/// <reference path="Category.ts" /> /// <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="Order.ts" />
/// <reference path="Pet.ts" /> /// <reference path="Pet.ts" />
/// <reference path="SpecialModelName.ts" />
/// <reference path="Tag.ts" /> /// <reference path="Tag.ts" />
/// <reference path="User.ts" /> /// <reference path="User.ts" />

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

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

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

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

View File

@ -8,12 +8,12 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then 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" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi

View File

@ -1,6 +1,6 @@
{ {
"name": "@swagger/angular2-typescript-petstore", "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", "description": "NodeJS client for @swagger/angular2-typescript-petstore",
"main": "api.js", "main": "api.js",
"scripts": { "scripts": {