mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 10:36:11 +00:00
typescript-fetch: Fix compatibility with noImplicitAny TS rule (#4711)
* 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
This commit is contained in:
committed by
Esteban Gehring
parent
775cf655f9
commit
da44e458e0
@@ -275,7 +275,7 @@ 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());
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,7 @@ export class JSONApiResponse<T> {
|
||||
export class VoidApiResponse {
|
||||
constructor(public raw: Response) {}
|
||||
|
||||
async value() {
|
||||
async value(): Promise<void> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ export class VoidApiResponse {
|
||||
export class BlobApiResponse {
|
||||
constructor(public raw: Response) {}
|
||||
|
||||
async value() {
|
||||
async value(): Promise<Blob> {
|
||||
return await this.raw.blob();
|
||||
};
|
||||
}
|
||||
@@ -299,7 +299,7 @@ export class BlobApiResponse {
|
||||
export class TextApiResponse {
|
||||
constructor(public raw: Response) {}
|
||||
|
||||
async value() {
|
||||
async value(): Promise<string> {
|
||||
return await this.raw.text();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user