mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 178 forks source link

core.base.service has "any" type for HttpResponse #583

Open null4bl3 opened 6 years ago

null4bl3 commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

The SDK build process is successful, however any attempt to ng serve or build triggers an error referencing the SDK file:

client/src/app/shared/sdk/services/core/base.service.ts (150,14)

With the error message:

The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.

Type argument candidate 'HttpEvent<{}>' is not a valid type argument because it is not a supertype of candidate 'HttpResponse'. Type 'HttpResponse' is not assignable to type 'HttpResponse<{}>'. Type 'any' is not assignable to type '{}'.

And sure enough. If i change: HttpResponse<any>' to: HttpResponse<{}>

The error is resolved. It does however not explain the error, as the HttpResponse have not been assigned any data type, IMO 'any' could be used instead of hardtyping it to '{}'.

Maybe someone have a better explanation?