-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse crashes when extra attributes on type="array" #102
Comments
Can it be fixed by using a different multi xml parser? |
Hi, |
Thanks for that monkey patch in that line, Aish! That works for me. |
Hey check this out: There were some bugs recently resolved in multi_xml, particularly with regard to arrays. This bug fix solves this issue in httparty. I suggest you point bundler to the GitHub repo to get the very latest version of multi_xml, in your Gemfile like this:
Then where you are going to use httparty (for example, in your Sinatra server) you would do this:
Note that with this setup, multi_xml will not show up in your "gem list" output, but it will work. |
Sweet. Safe to say this is not an httparty issue, but rather a multi_xml issue, so I'm closing the issue. |
Hi,
I'm doing a get on a service that has some XML like the following:
Any extra attributes after type="array" (i.e. anything="anything") cause httparty's code that converts it to a hash to crash. The offending lines are these:
Now I think the service I'm getting shouldn't have these extra attributes on a type="array" element, but it would be nice if httparty handled this case more gracefully.
For the moment, I've monkey patched one line above so that the parser only pulls out the attribute that contains the array elements (means the extra attributes aren't parsed), but at least it works without throwing a cryptic error.
The text was updated successfully, but these errors were encountered: