Closed ingnam closed 4 years ago
@ingnam, I can't reproduce this error. My hunch is that this does not have to do with Peddler; the parser has no recent changes. Perhaps you could try bumping up Ox?
@hakanensari, I'm doing more investigation on this but one thing that I've figured out is this issue can be reproduced with the invalid xml format:
MultiXml.parse("<?xml version=\"1.0\"?>\n></xml>")
Not sure who should handle it; peddler or multi_xml.
I copy-pasted the XML body in your first post into a test. It seems to parse fine, so I’m assuming it's valid? I've also tried against an older Ox gem from 2017 to no avail.
I’m still not quite getting what's happening on your end.
def test_malformed_xml
body = "<?xml version=\"1.0\"?>\n" \
'<SubmitFeedResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/"><SubmitFeedResult><FeedSubmissionInfo><FeedSubmissionId>78892018141</FeedSubmissionId><FeedType>_POST_INVENTORY_AVAILABILITY_DATA_</FeedType><SubmittedDate>2019-09-02T23:13:55+00:00</SubmittedDate><FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus></FeedSubmissionInfo></SubmitFeedResult><ResponseMetadata><RequestId>f4a33a13-0066-4353-8e0c-87400e4c90b9</RequestId></ResponseMetadata></SubmitFeedResponse>'
MultiXml.parse(body) # should raise error?
end
Edited comment☝️ to add test code
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am using peddler version 1.6.2. When parsing the response, I got following error:
undefined method 'key?' for nil:NilClass
And here is the backtrace:
Here is the response:
Is it due to older version of the gem?