Skip to content

Commit

Permalink
typescript-fetch: Fix compatibility with noImplicitAny TS rule (#4711)
Browse files Browse the repository at this point in the history
* Fix compatibility with noImplicitAny TS rule (required with CRNA app)

*  new file added with bin/typescript-fetch-petstore.sh

* missing files with bin/typescript-fetch-petstore-all.sh

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* changed files after bin/typescript-fetch-petstore-all.sh

* re-generate samples, fix windows typescript fetch script
  • Loading branch information
dngconsulting authored and macjohnny committed Dec 6, 2019
1 parent 775cf65 commit da44e45
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces

java %JAVA_OPTS% -jar %executable% %ags%
Original file line number Diff line number Diff line change
Expand Up @@ -275,31 +275,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<void> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<Blob> {
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value(): Promise<string> {
return await this.raw.text();
};
}

0 comments on commit da44e45

Please sign in to comment.