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

Generated notifications api v2 client request deviates from spec

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None
    • Moderate

      The notifications API v2 client has an operation to update behavior group actions. In tests, I provided a behavior group id and a list of request body parameters as mandated by the spec. The associated test looks like this:

      test('update behavior group actions', async () => {
        const params: NotificationResourceV2UpdateBehaviorGroupActionsParams = {
          behaviorGroupId: 'behaviorGroupId',
          requestBody: ['a', 'b', 'c'],
        };
        const resp = await client.notificationResourceV2UpdateBehaviorGroupActions(params);
        expect(resp.status).toBe(200);
      }); 

      When I set up mitmproxy to intercept the client request, the format was very different from what I expected to see. 

      1. The behaviorGroupId rendered in the URL as "%5Bobject%20Object%5D", which suggest that the formatting of this input parameter isn't performed properly.
      2. The request did not have a request body; this means that the "requestBody" input parameter was effectively ignored.

      For reference, here is a screencap of the request data taken from mitmproxy: 

              Unassigned Unassigned
              btweed@redhat.com Brandon Tweed
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: