Extra pagination keys included in XML responses from API?
Hi guys,
I'm not sure if this is a recent change, or if something has
changed on my end, but I'm having issues parsing XML responses
using the Lighthouse gem. I've tracked the issue down to the fact
that the tickets now take the following form:
<?xml version="1.0" encoding="UTF-8"?>`
<tickets type="array">
<total_pages>1</total_pages>
<current_page>1</current_page>
<ticket>
...
</ticket>
</tickets>
It seems that ActiveSupport parsing (Hash.to_xml
)
chokes on the extra keys (it's expecting
<ticket/>
to be the only element type inside
<tickets/>
. Sometimes it will parse
correctly, but it fails intermittently because I'm running 1.8.7
still, and the hashes that get slurped out of the raw XML have keys
in random order.
So I guess I'd like to know a few things from you guys:
1. Is including the pagination information in the XML a new
thing?
2. Is it essential that it be left in?
3. Is anyone else running into this issue, or am I just Doing It
Wrong™?
If it's not going to change, I'll probably just end up updating the Lighthouse gem to use your JSON API, because XML sucks anyway :)
Thanks for your help!
Leigh
Discussions are closed to public comments.
If you need help with Lighthouse please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Tiger Team on 29 Jan, 2013 03:57 AM
Try this: (sigh)
2 Posted by Leigh Caplan on 29 Jan, 2013 06:03 PM
Thanks for getting back so quickly Courtenay. That's quite an ugly hack, but it'll work for the time being. In the medium term, I'll update the Lighthouse gem to use JSON.
brandi closed this discussion on 30 Jan, 2013 07:49 PM.