Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-36157

Fix export typing issue in API calls in custom generator

XMLWordPrintable

    • Plat-Ex Services Sprint 28

      In the new generator, API calls are exporting the following

      export declare const apiHostGetHostListParamCreator: (...config: [ApiHostGetHostListParams] | [string, string, string, string, string, ApiHostGetHostListProviderTypeEnum, string, string, string[], string, number, number, ApiHostGetHostListOrderByEnum, ApiHostGetHostListOrderHowEnum, ApiHostGetHostListStalenessEnum[], string[], ApiHostGetHostListRegisteredWithEnum[], {
          [key: string]: SystemProfileNestedObjectValue;
      }, {
          [key: string]: SystemProfileNestedObjectValue;
      }, AxiosRequestConfig<any>]) => Promise<RequestArgs>; // <====== this is the issue

      While this export type is correct in this location, when the call is added to the list in APIFactory to be used, it is still using this `Promise<RequestArgs>` type instead of the actual data from the request. We should fix this to actually return the correct type when using APIFactory.

      In the case of `apiHostGetHostListParamCreator` for example, it should return this.

       

              apinkert-insights Austin Pinkerton
              apinkert-insights Austin Pinkerton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: