Skip to content

querystring module does not parse nested objects #34

Closed
snello opened this Issue Apr 26, 2012 · 2 comments

2 participants

@snello
snello commented Apr 26, 2012

Hi,

The querystring module in use by aws2js does not parse nested objects within json strings. Suggestion is to move towards the use of the 'qs' module instead, which can handle this case.

This became a problem for me when attempting to use aws2js with Amazon Simple Workflow (SWF), as a number of the API calls require a nested object for the queue name.

See here http://docs.amazonwebservices.com/amazonswf/latest/apireference/API_PollForActivityTask.html

@SaltwaterC
Owner

As far as I can see, the SWF API uses a JSON request body for the POST call. It can be patched the same way DynamoDB was patched on top of the query.request() call via an implemented exception. It feels more natural to pass an object that's going to be turned into JSON by JSON.stringify(). qs would be an useless addition since it does object to string / string to object conversion instead of JSON to string / string to JSON conversion.

Hopefully, signHeaders is reusable for this API. The documentation looks nearly the same. If my hunch is right, then the Date header, if specified, must be part of the StringToSign. They "simply forgot" to mention that into the DynamoDB documentation. Hopefully the algo doesn't have any other gotcha besides this one.

@snello
snello commented Jun 3, 2014

Sorry for not closing this sooner - just doing some spring cleaning! Yes, this was spot on and I was able to patch on top of query.request().

@snello snello closed this Jun 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.