Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/typescript-angular2-petstore-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml
java $JAVA_OPTS -jar $executable $ags

echo "Typescript Petstore API client (with interfaces generated)"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true"
java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/typescript-angular2-petstore-interfaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/with-interfaces -D withInterfaces=true"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/typescript-angular2-petstore-with-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ fi

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

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/typescript-angular2-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ fi

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

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* 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 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.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand Down Expand Up @@ -47,7 +47,7 @@ export class PetApi implements PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
public addPet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}> {
public addPet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.addPetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand Down Expand Up @@ -80,7 +80,7 @@ export class PetApi implements PetApiInterface {
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
*/
public findPetsByStatus(status?: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>> {
public findPetsByStatus(status: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>> {
return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand All @@ -96,7 +96,7 @@ export class PetApi implements PetApiInterface {
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
*/
public findPetsByTags(tags?: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>> {
public findPetsByTags(tags: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>> {
return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand All @@ -109,8 +109,8 @@ export class PetApi implements PetApiInterface {

/**
* Find pet by ID
* 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
* Returns a single pet
* @param petId ID of pet to return
*/
public getPetById(petId: number, extraHttpRequestParams?: any): Observable<models.Pet> {
return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams)
Expand All @@ -128,7 +128,7 @@ export class PetApi implements PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
public updatePet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}> {
public updatePet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}> {
return this.updatePetWithHttpInfo(body, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand All @@ -146,7 +146,7 @@ export class PetApi implements PetApiInterface {
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
public updatePetWithForm(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> {
public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> {
return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand All @@ -164,7 +164,7 @@ export class PetApi implements PetApiInterface {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<{}> {
public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<models.ApiResponse> {
return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
Expand All @@ -181,11 +181,15 @@ export class PetApi implements PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable<Response> {
public addPetWithHttpInfo(body: models.Pet, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet';

let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling addPet.');
}
// to determine the Content-Type header
let consumes: string[] = [
'application/json',
Expand All @@ -194,8 +198,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -250,8 +254,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -282,15 +286,17 @@ export class PetApi implements PetApiInterface {
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
*/
public findPetsByStatusWithHttpInfo(status?: Array<string>, extraHttpRequestParams?: any): Observable<Response> {
public findPetsByStatusWithHttpInfo(status: Array<string>, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet/findByStatus';

let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// verify required parameter 'status' is not null or undefined
if (status === null || status === undefined) {
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
}
if (status) {
status.forEach((element) => {
queryParameters.append('status', <any>element);
})
queryParameters.set('status', status.join(COLLECTION_FORMATS['csv']));
}

// to determine the Content-Type header
Expand All @@ -299,8 +305,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -331,15 +337,17 @@ export class PetApi implements PetApiInterface {
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
*/
public findPetsByTagsWithHttpInfo(tags?: Array<string>, extraHttpRequestParams?: any): Observable<Response> {
public findPetsByTagsWithHttpInfo(tags: Array<string>, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet/findByTags';

let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// verify required parameter 'tags' is not null or undefined
if (tags === null || tags === undefined) {
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
}
if (tags) {
tags.forEach((element) => {
queryParameters.append('tags', <any>element);
})
queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv']));
}

// to determine the Content-Type header
Expand All @@ -348,8 +356,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -377,8 +385,8 @@ export class PetApi implements PetApiInterface {

/**
* Find pet by ID
* 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
* Returns a single pet
* @param petId ID of pet to return
*/
public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet/${petId}'
Expand All @@ -396,24 +404,15 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (api_key) required
if (this.configuration.apiKey) {
headers.set('api_key', this.configuration.apiKey);
}

// authentication (petstore_auth) required
// oauth required
if (this.configuration.accessToken) {
let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken);
}

let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand All @@ -433,11 +432,15 @@ export class PetApi implements PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable<Response> {
public updatePetWithHttpInfo(body: models.Pet, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet';

let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updatePet.');
}
// to determine the Content-Type header
let consumes: string[] = [
'application/json',
Expand All @@ -446,8 +449,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -483,7 +486,7 @@ export class PetApi implements PetApiInterface {
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable<Response> {
public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<Response> {
const path = this.basePath + '/pet/${petId}'
.replace('${' + 'petId' + '}', String(petId));

Expand All @@ -502,8 +505,8 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/xml',
'application/json'
];

// authentication (petstore_auth) required
Expand Down Expand Up @@ -566,8 +569,7 @@ export class PetApi implements PetApiInterface {

// to determine the Accept header
let produces: string[] = [
'application/json',
'application/xml'
'application/json'
];

// authentication (petstore_auth) required
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* 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 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.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
Expand All @@ -28,7 +28,7 @@ export interface PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
addPet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}>;
addPet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}>;

/**
* Deletes a pet
Expand All @@ -43,19 +43,19 @@ export interface PetApiInterface {
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
*/
findPetsByStatus(status?: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>>;
findPetsByStatus(status: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>>;

/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
*/
findPetsByTags(tags?: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>>;
findPetsByTags(tags: Array<string>, extraHttpRequestParams?: any): Observable<Array<models.Pet>>;

/**
* Find pet by ID
* 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
* Returns a single pet
* @param petId ID of pet to return
*/
getPetById(petId: number, extraHttpRequestParams?: any): Observable<models.Pet>;

Expand All @@ -64,7 +64,7 @@ export interface PetApiInterface {
*
* @param body Pet object that needs to be added to the store
*/
updatePet(body?: models.Pet, extraHttpRequestParams?: any): Observable<{}>;
updatePet(body: models.Pet, extraHttpRequestParams?: any): Observable<{}>;

/**
* Updates a pet in the store with form data
Expand All @@ -73,7 +73,7 @@ export interface PetApiInterface {
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
updatePetWithForm(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>;
updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}>;

/**
* uploads an image
Expand All @@ -82,6 +82,6 @@ export interface PetApiInterface {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<{}>;
uploadFile(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable<models.ApiResponse>;

}
Loading