phoet / asin

:books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations
http://asin.herokuapp.com/
167 stars 59 forks source link

Maybe it's a good idea to change XML serialization library? #52

Open skatkov opened 6 years ago

skatkov commented 6 years ago

I've ran into an issue that data returned from amazon had different property names ('TinyImage' vs 'tiny_image') -- that caused me to write a lot of hacks and wordarounds to deal with. While i expected asin library and code seemed reasonable, i was really puzzled why would amazon do such a thing with me (or us) :D

But I think that this weirdness is explained by one of dependencies used in this project, it has a code like this:

https://github.com/jnunemaker/crack/blob/master/lib/crack/util.rb

I don't think that altering objects is a good idea for any Xml serialization library. So maybe it's a good opportunity to change dependency to something like multiXml ( https://github.com/sferik/multi_xml ) ?

skatkov commented 6 years ago

I'm attaching two different end-result file examples that illustrate my problem. Archive.zip

phoet commented 6 years ago

@skatkov if you are willing to provide a PR to change the existing implementation I will be happy to merge it in