Possible to get output to print out deep nested objects?
Is there anyway for the CLI to output the entire response including deeply nested objects?
Now the output becomes, for example: requestContext: [Object]
@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?
@jayair Not often but it would be really helpful if it was possible to supply an option to do it :)
@Guitarkalle I see. Can I see a sample of the full output you are seeing right now?
@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] ] } }
@Guitarkalle That makes sense. This should be easy to fix. In these two instances:
- https://github.com/AnomalyInnovations/aws-api-gateway-cli-test/blob/master/index.js#L179
- https://github.com/AnomalyInnovations/aws-api-gateway-cli-test/blob/master/index.js#L187
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?
@jayair Sure, give me a few days and I can find some time to look at it:)
I fixed and created a PR for it
@bveenvliet That's awesome! Thanks!