ralucas / node-zillow

Node wrapper for Zillow API
https://ralucas.github.io/node-zillow
MIT License
70 stars 27 forks source link

Question on formatting of responses #6

Closed scottbarstow closed 8 years ago

scottbarstow commented 9 years ago

I've been using your library for a few days now, thanks for doing the work.

One question I have is why you made every element in the response an array when you convert from XML to JSON? If this was on purpose, just want to understand the reasoning.

Would you be open to a change that makes the parsing more aligned with the xml? I'm using (specifically) the DeepSearchResults API.

Thanks!

ralucas commented 9 years ago

Hi Scott, So, the reason that the XML to JSON is put in arrays is partly due to the library that this uses and it doesn't explicitly state to not put the responses into arrays. We could pass in an option to allow that, see here: https://github.com/Leonidas-from-XIV/node-xml2js#options. The option is explicitArray: false. I'll see if I can't add that as an option to pass or if you want to make a pr, let me know. Hope all's well.

Best,

Richard

ralucas commented 8 years ago

Hi @scottbarstow, This should now be resolved in 1.0.0...check it out.