Skip to content

Commit ccfe7f5

Browse files
committed
minor fix to ts angularjs bin script
1 parent 14f0375 commit ccfe7f5

File tree

13 files changed

+117
-35
lines changed

13 files changed

+117
-35
lines changed

bin/typescript-angularjs-petstore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ fi
2626

2727
# if you've executed sbt assembly previously it will use that instead.
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
29-
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angularjs -o samples/client/petstore/typescript-angular"
29+
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angularjs -o samples/client/petstore/typescript-angularjs"
3030

3131
java $JAVA_OPTS -jar $executable $ags

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,10 +829,9 @@
829829
<module>samples/client/petstore/typescript-fetch/tests/default</module>
830830
<module>samples/client/petstore/typescript-node/npm</module>
831831
<!-- comment out due to github rate limit error
832-
<module>samples/client/petstore/typescript-angular</module>-->
832+
<module>samples/client/petstore/typescript-angularjs</module>-->
833833
<!-- comment out due to error `npm run build`
834834
<module>samples/client/petstore/typescript-jquery/npm</module>-->
835-
<module>samples/client/petstore/typescript-angularjs</module>
836835
<module>samples/client/petstore/typescript-angular-v2/npm</module>
837836
<module>samples/client/petstore/typescript-angular-v4/npm</module>
838837
<module>samples/client/petstore/swift3/default/SwaggerClientTests</module>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.3
1+
2.3.0-SNAPSHOT

samples/client/petstore/typescript-angularjs/api/PetApi.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -31,11 +31,15 @@ export class PetApi {
3131
* @summary Add a new pet to the store
3232
* @param body Pet object that needs to be added to the store
3333
*/
34-
public addPet (body?: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
34+
public addPet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
3535
const localVarPath = this.basePath + '/pet';
3636

3737
let queryParameters: any = {};
3838
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
39+
// verify required parameter 'body' is not null or undefined
40+
if (body === null || body === undefined) {
41+
throw new Error('Required parameter body was null or undefined when calling addPet.');
42+
}
3943
let httpRequestParams: ng.IRequestConfig = {
4044
method: 'POST',
4145
url: localVarPath,
@@ -86,11 +90,15 @@ export class PetApi {
8690
* @summary Finds Pets by status
8791
* @param status Status values that need to be considered for filter
8892
*/
89-
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<models.Pet>> {
93+
public findPetsByStatus (status: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<models.Pet>> {
9094
const localVarPath = this.basePath + '/pet/findByStatus';
9195

9296
let queryParameters: any = {};
9397
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
98+
// verify required parameter 'status' is not null or undefined
99+
if (status === null || status === undefined) {
100+
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
101+
}
94102
if (status !== undefined) {
95103
queryParameters['status'] = status;
96104
}
@@ -113,11 +121,15 @@ export class PetApi {
113121
* @summary Finds Pets by tags
114122
* @param tags Tags to filter by
115123
*/
116-
public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<models.Pet>> {
124+
public findPetsByTags (tags: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<models.Pet>> {
117125
const localVarPath = this.basePath + '/pet/findByTags';
118126

119127
let queryParameters: any = {};
120128
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
129+
// verify required parameter 'tags' is not null or undefined
130+
if (tags === null || tags === undefined) {
131+
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
132+
}
121133
if (tags !== undefined) {
122134
queryParameters['tags'] = tags;
123135
}
@@ -136,9 +148,9 @@ export class PetApi {
136148
return this.$http(httpRequestParams);
137149
}
138150
/**
139-
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
151+
* Returns a single pet
140152
* @summary Find pet by ID
141-
* @param petId ID of pet that needs to be fetched
153+
* @param petId ID of pet to return
142154
*/
143155
public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Pet> {
144156
const localVarPath = this.basePath + '/pet/{petId}'
@@ -168,11 +180,15 @@ export class PetApi {
168180
* @summary Update an existing pet
169181
* @param body Pet object that needs to be added to the store
170182
*/
171-
public updatePet (body?: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
183+
public updatePet (body: models.Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
172184
const localVarPath = this.basePath + '/pet';
173185

174186
let queryParameters: any = {};
175187
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
188+
// verify required parameter 'body' is not null or undefined
189+
if (body === null || body === undefined) {
190+
throw new Error('Required parameter body was null or undefined when calling updatePet.');
191+
}
176192
let httpRequestParams: ng.IRequestConfig = {
177193
method: 'PUT',
178194
url: localVarPath,
@@ -194,7 +210,7 @@ export class PetApi {
194210
* @param name Updated name of the pet
195211
* @param status Updated status of the pet
196212
*/
197-
public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
213+
public updatePetWithForm (petId: number, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
198214
const localVarPath = this.basePath + '/pet/{petId}'
199215
.replace('{' + 'petId' + '}', String(petId));
200216

@@ -233,7 +249,7 @@ export class PetApi {
233249
* @param additionalMetadata Additional data to pass to server
234250
* @param file file to upload
235251
*/
236-
public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
252+
public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.ApiResponse> {
237253
const localVarPath = this.basePath + '/pet/{petId}/uploadImage'
238254
.replace('{' + 'petId' + '}', String(petId));
239255

samples/client/petstore/typescript-angularjs/api/StoreApi.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -81,7 +81,7 @@ export class StoreApi {
8181
* @summary Find purchase order by ID
8282
* @param orderId ID of pet that needs to be fetched
8383
*/
84-
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
84+
public getOrderById (orderId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
8585
const localVarPath = this.basePath + '/store/order/{orderId}'
8686
.replace('{' + 'orderId' + '}', String(orderId));
8787

@@ -109,11 +109,15 @@ export class StoreApi {
109109
* @summary Place an order for a pet
110110
* @param body order placed for purchasing the pet
111111
*/
112-
public placeOrder (body?: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
112+
public placeOrder (body: models.Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<models.Order> {
113113
const localVarPath = this.basePath + '/store/order';
114114

115115
let queryParameters: any = {};
116116
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
117+
// verify required parameter 'body' is not null or undefined
118+
if (body === null || body === undefined) {
119+
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
120+
}
117121
let httpRequestParams: ng.IRequestConfig = {
118122
method: 'POST',
119123
url: localVarPath,

samples/client/petstore/typescript-angularjs/api/UserApi.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -31,11 +31,15 @@ export class UserApi {
3131
* @summary Create user
3232
* @param body Created user object
3333
*/
34-
public createUser (body?: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
34+
public createUser (body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
3535
const localVarPath = this.basePath + '/user';
3636

3737
let queryParameters: any = {};
3838
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
39+
// verify required parameter 'body' is not null or undefined
40+
if (body === null || body === undefined) {
41+
throw new Error('Required parameter body was null or undefined when calling createUser.');
42+
}
3943
let httpRequestParams: ng.IRequestConfig = {
4044
method: 'POST',
4145
url: localVarPath,
@@ -55,11 +59,15 @@ export class UserApi {
5559
* @summary Creates list of users with given input array
5660
* @param body List of user object
5761
*/
58-
public createUsersWithArrayInput (body?: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
62+
public createUsersWithArrayInput (body: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
5963
const localVarPath = this.basePath + '/user/createWithArray';
6064

6165
let queryParameters: any = {};
6266
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
67+
// verify required parameter 'body' is not null or undefined
68+
if (body === null || body === undefined) {
69+
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
70+
}
6371
let httpRequestParams: ng.IRequestConfig = {
6472
method: 'POST',
6573
url: localVarPath,
@@ -79,11 +87,15 @@ export class UserApi {
7987
* @summary Creates list of users with given input array
8088
* @param body List of user object
8189
*/
82-
public createUsersWithListInput (body?: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
90+
public createUsersWithListInput (body: Array<models.User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
8391
const localVarPath = this.basePath + '/user/createWithList';
8492

8593
let queryParameters: any = {};
8694
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
95+
// verify required parameter 'body' is not null or undefined
96+
if (body === null || body === undefined) {
97+
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
98+
}
8799
let httpRequestParams: ng.IRequestConfig = {
88100
method: 'POST',
89101
url: localVarPath,
@@ -160,11 +172,19 @@ export class UserApi {
160172
* @param username The user name for login
161173
* @param password The password for login in clear text
162174
*/
163-
public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
175+
public loginUser (username: string, password: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
164176
const localVarPath = this.basePath + '/user/login';
165177

166178
let queryParameters: any = {};
167179
let headerParams: any = (<any>Object).assign({}, this.defaultHeaders);
180+
// verify required parameter 'username' is not null or undefined
181+
if (username === null || username === undefined) {
182+
throw new Error('Required parameter username was null or undefined when calling loginUser.');
183+
}
184+
// verify required parameter 'password' is not null or undefined
185+
if (password === null || password === undefined) {
186+
throw new Error('Required parameter password was null or undefined when calling loginUser.');
187+
}
168188
if (username !== undefined) {
169189
queryParameters['username'] = username;
170190
}
@@ -214,7 +234,7 @@ export class UserApi {
214234
* @param username name that need to be deleted
215235
* @param body Updated user object
216236
*/
217-
public updateUser (username: string, body?: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
237+
public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
218238
const localVarPath = this.basePath + '/user/{username}'
219239
.replace('{' + 'username' + '}', String(username));
220240

@@ -224,6 +244,10 @@ export class UserApi {
224244
if (username === null || username === undefined) {
225245
throw new Error('Required parameter username was null or undefined when calling updateUser.');
226246
}
247+
// verify required parameter 'body' is not null or undefined
248+
if (body === null || body === undefined) {
249+
throw new Error('Required parameter body was null or undefined when calling updateUser.');
250+
}
227251
let httpRequestParams: ng.IRequestConfig = {
228252
method: 'PUT',
229253
url: localVarPath,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Swagger Petstore
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: apiteam@swagger.io
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
import * as models from './models';
14+
15+
/**
16+
* Describes the result of uploading an image resource
17+
*/
18+
export interface ApiResponse {
19+
"code"?: number;
20+
"type"?: string;
21+
"message"?: string;
22+
}
23+

samples/client/petstore/typescript-angularjs/model/Category.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -12,6 +12,9 @@
1212

1313
import * as models from './models';
1414

15+
/**
16+
* A category for a pet
17+
*/
1518
export interface Category {
1619
"id"?: number;
1720
"name"?: string;

samples/client/petstore/typescript-angularjs/model/Order.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -12,6 +12,9 @@
1212

1313
import * as models from './models';
1414

15+
/**
16+
* An order for a pets from the pet store
17+
*/
1518
export interface Order {
1619
"id"?: number;
1720
"petId"?: number;

samples/client/petstore/typescript-angularjs/model/Pet.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Swagger Petstore
3-
* 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
3+
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
44
*
55
* OpenAPI spec version: 1.0.0
6-
* Contact: apiteam@wordnik.com
6+
* Contact: apiteam@swagger.io
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -12,6 +12,9 @@
1212

1313
import * as models from './models';
1414

15+
/**
16+
* A pet for sale in the pet store
17+
*/
1518
export interface Pet {
1619
"id"?: number;
1720
"category"?: models.Category;

0 commit comments

Comments
 (0)