diff --git a/samples/client/petstore/typescript-angular/api/Category.ts b/samples/client/petstore/typescript-angular/Category.ts
similarity index 91%
rename from samples/client/petstore/typescript-angular/api/Category.ts
rename to samples/client/petstore/typescript-angular/Category.ts
index e4a3caa208e..2ec6a2b20f9 100644
--- a/samples/client/petstore/typescript-angular/api/Category.ts
+++ b/samples/client/petstore/typescript-angular/Category.ts
@@ -1,6 +1,6 @@
///
-module api {
+module {
'use strict';
export class Category {
diff --git a/samples/client/petstore/typescript-angular/api/Order.ts b/samples/client/petstore/typescript-angular/Order.ts
similarity index 92%
rename from samples/client/petstore/typescript-angular/api/Order.ts
rename to samples/client/petstore/typescript-angular/Order.ts
index 3f37c608758..f916138d7a0 100644
--- a/samples/client/petstore/typescript-angular/api/Order.ts
+++ b/samples/client/petstore/typescript-angular/Order.ts
@@ -1,6 +1,6 @@
///
-module api {
+module {
'use strict';
export class Order {
@@ -11,7 +11,7 @@ module api {
quantity: number;
- shipDate: DateTime;
+ shipDate: Date;
/**
* Order Status
diff --git a/samples/client/petstore/typescript-angular/api/Pet.ts b/samples/client/petstore/typescript-angular/Pet.ts
similarity index 97%
rename from samples/client/petstore/typescript-angular/api/Pet.ts
rename to samples/client/petstore/typescript-angular/Pet.ts
index c34be9c3dbc..ac8d6b72fdf 100644
--- a/samples/client/petstore/typescript-angular/api/Pet.ts
+++ b/samples/client/petstore/typescript-angular/Pet.ts
@@ -1,6 +1,6 @@
///
-module api {
+module {
'use strict';
export class Pet {
diff --git a/samples/client/petstore/typescript-angular/api/PetApi.ts b/samples/client/petstore/typescript-angular/PetApi.ts
similarity index 74%
rename from samples/client/petstore/typescript-angular/api/PetApi.ts
rename to samples/client/petstore/typescript-angular/PetApi.ts
index d294cfbebbc..3067994a76c 100644
--- a/samples/client/petstore/typescript-angular/api/PetApi.ts
+++ b/samples/client/petstore/typescript-angular/PetApi.ts
@@ -2,12 +2,11 @@
/* tslint:disable:no-unused-variable member-ordering */
-module api {
+module {
'use strict';
-
export class PetApi {
- private basePath = 'http://petstore.swagger.io/v2';
+ private basePath = '/v2';
static $inject: string[] = ['$http'];
@@ -16,15 +15,13 @@ module api {
this.basePath = basePath;
}
}
-
- public updatePet (body: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
+
+ public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
var path = this.basePath + '/pet';
-
+
var queryParameters: any = {};
- var headers: any = {};
-
-
-
+ var headerParams: any = {};
+
var httpRequestParams: any = {
method: 'PUT',
url: path,
@@ -32,11 +29,11 @@ module api {
data: body,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -45,15 +42,13 @@ module api {
return this.$http(httpRequestParams);
}
-
- public addPet (body: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
+
+ public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
var path = this.basePath + '/pet';
-
+
var queryParameters: any = {};
- var headers: any = {};
-
-
-
+ var headerParams: any = {};
+
var httpRequestParams: any = {
method: 'POST',
url: path,
@@ -61,11 +56,11 @@ module api {
data: body,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -74,28 +69,28 @@ module api {
return this.$http(httpRequestParams);
}
-
- public findPetsByStatus (status: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> {
+
+ public findPetsByStatus (status?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> {
var path = this.basePath + '/pet/findByStatus';
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
if (status !== undefined) {
queryParameters['status'] = status;
}
-
+
var httpRequestParams: any = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -104,28 +99,28 @@ module api {
return this.$http(httpRequestParams);
}
-
- public findPetsByTags (tags: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> {
+
+ public findPetsByTags (tags?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> {
var path = this.basePath + '/pet/findByTags';
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
if (tags !== undefined) {
queryParameters['tags'] = tags;
}
-
+
var httpRequestParams: any = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -134,33 +129,31 @@ module api {
return this.$http(httpRequestParams);
}
-
- public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise {
+
+ public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise {
var path = this.basePath + '/pet/{petId}';
-
+
path = path.replace('{' + 'petId' + '}', String(petId));
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling getPetById');
}
-
-
-
+
var httpRequestParams: any = {
method: 'GET',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -169,33 +162,31 @@ module api {
return this.$http(httpRequestParams);
}
-
- public updatePetWithForm (petId: string, name: string, status: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
+
+ public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
var path = this.basePath + '/pet/{petId}';
-
+
path = path.replace('{' + 'petId' + '}', String(petId));
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling updatePetWithForm');
}
-
-
-
+
var httpRequestParams: any = {
method: 'POST',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -204,33 +195,33 @@ module api {
return this.$http(httpRequestParams);
}
-
- public deletePet (apiKey: string, petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
+
+ public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
var path = this.basePath + '/pet/{petId}';
-
+
path = path.replace('{' + 'petId' + '}', String(petId));
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling deletePet');
}
-
-
+
headerParams['apiKey'] = apiKey;
+
var httpRequestParams: any = {
method: 'DELETE',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -239,33 +230,31 @@ module api {
return this.$http(httpRequestParams);
}
-
- public uploadFile (petId: number, additionalMetadata: string, file: file, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
+
+ public uploadFile (petId: number, additionalMetadata?: string, file?: file, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
var path = this.basePath + '/pet/{petId}/uploadImage';
-
+
path = path.replace('{' + 'petId' + '}', String(petId));
-
+
var queryParameters: any = {};
- var headers: any = {};
-
+ var headerParams: any = {};
+
// verify required parameter 'petId' is set
if (!petId) {
throw new Error('Missing required parameter petId when calling uploadFile');
}
-
-
-
+
var httpRequestParams: any = {
method: 'POST',
url: path,
json: true,
params: queryParameters,
- headers: headers
+ headers: headerParams
};
if (extraHttpRequestParams) {
- for (var k in extraHttpRequestParams){
+ for (var k in extraHttpRequestParams) {
if (extraHttpRequestParams.hasOwnProperty(k)) {
httpRequestParams[k] = extraHttpRequestParams[k];
}
@@ -274,9 +263,5 @@ module api {
return this.$http(httpRequestParams);
}
-
}
-
- angular.module('api_PetApi', ['$http'])
- .service('PetApi', PetApi);
}
diff --git a/samples/client/petstore/typescript-angular/api/StoreApi.ts b/samples/client/petstore/typescript-angular/StoreApi.ts
similarity index 72%
rename from samples/client/petstore/typescript-angular/api/StoreApi.ts
rename to samples/client/petstore/typescript-angular/StoreApi.ts
index e8c85b00c45..67f60be3133 100644
--- a/samples/client/petstore/typescript-angular/api/StoreApi.ts
+++ b/samples/client/petstore/typescript-angular/StoreApi.ts
@@ -2,12 +2,11 @@
/* tslint:disable:no-unused-variable member-ordering */
-module api {
+module {
'use strict';
-
export class StoreApi {
- private basePath = 'http://petstore.swagger.io/v2';
+ private basePath = '/v2';
static $inject: string[] = ['$http'];
@@ -16,26 +15,24 @@ module api {
this.basePath = basePath;
}
}
-
- public getInventory ( extraHttpRequestParams?: any ) : ng.IHttpPromise