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

Fix enum support in js-clients generator

XMLWordPrintable

    • Plat-Ex Services Sprint 24, Plat-Ex Services Sprint 25, Plat-Ex Services Sprint 26, Plat-Ex Services Sprint 27, Plat-Ex Services Sprint 28

      The issue seems to come from the creation of enum names when there's a modifier before a repeated word (e.g. yupana and !yupana both create two yupana enums) which causes build issues as they're the same name. In the new api.ts:

      export const ApiHostDeleteHostsByFilterRegisteredWithEnum = { Insights: 'insights', Yupana: 'yupana', Satellite: 'satellite', Discovery: 'discovery', Puptoo: 'puptoo', RhsmConduit: 'rhsm-conduit', CloudConnector: 'cloud-connector', Yupana: '!yupana', Satellite: '!satellite', Discovery: '!discovery', Puptoo: '!puptoo', RhsmConduit: '!rhsm-conduit', CloudConnector: '!cloud-connector' } as const; 

      It seems to be the same problem with -system_uuid and system_uuid in the insights spec.

      A few months ago during the rbac-client conversion, we ran into an issue with one of the functions in the generator which might also be the problem in this PR which ended with us just removing the function as it didn't affect the old-gen clients and corrected the issues with the rbac conversion. It's related to enums but was giving us duplicated names in some of the rbac-client enums (e.g. it would use ListPermissionListPermissionOptionsFieldEnum instead of ListPermissionOptionsFieldEnum ). Adding this back couldn't hurt but it seems to still have the above issues after reverting this change.

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

                Created:
                Updated:
                Resolved: