AnomalyInnovations / aws-api-gateway-cli-test

A simple CLI to test API Gateway endpoints with IAM authorization
MIT License
120 stars 29 forks source link

Possible to get output to print out deep nested objects? #8

Open Guitarkalle opened 6 years ago

Guitarkalle commented 6 years ago

Is there anyway for the CLI to output the entire response including deeply nested objects?

Now the output becomes, for example: requestContext: [Object]

jayair commented 6 years ago

@Guitarkalle There isn't right now. It's just meant to test if the request was successful or not. Are you using it to debug your output?

Guitarkalle commented 6 years ago

@jayair Not often but it would be really helpful if it was possible to supply an option to do it :)

jayair commented 6 years ago

@Guitarkalle I see. Can I see a sample of the full output you are seeing right now?

Guitarkalle commented 6 years ago

@jayair So here I can't see the headers for instance :)

Authenticating with User Pool
Getting temporary credentials
Making API request
{ status: 200,
  statusText: 'OK',
  data:
   { message: 'Getting data!',
     input:
      { resource: '/getdata',
        path: '/getdata',
        httpMethod: 'GET',
        headers: [Object],
        queryStringParameters: null,
        pathParameters: null,
        stageVariables: null,
        requestContext: [Object],
        body: null,
        isBase64Encoded: false },
     data: [ [Object] ] } }
jayair commented 6 years ago

@Guitarkalle That makes sense. This should be easy to fix. In these two instances:

We need to pass in a second argument of null to the console.dir() call (https://nodejs.org/api/console.html#console_console_dir_obj_options).

Do you want to try it and submit a PR?

Guitarkalle commented 6 years ago

@jayair Sure, give me a few days and I can find some time to look at it:)

bveenvliet commented 5 years ago

I fixed and created a PR for it

jayair commented 5 years ago

@bveenvliet That's awesome! Thanks!

mattgillard commented 2 months ago

i found this issue too haha. Any chance of releasing a new version with the PR applied please? Otherwise is there any other tool people are using for debugging the API output? I love the ease of cognito testing with this utility!