[LRUG] Serialising a struct

Matt Spendlove matt at cenatus.org
Mon Apr 14 08:12:35 PDT 2014

> On Mon, Apr 14, 2014 at 3:41 PM, Matt Spendlove <matt at cenatus.org> wrote:
>> I'm not sure why replaying responses via VCR doesn't help you but
>> assuming you don't want to do that, the simplest thing you can do is just
>> new up some Structs that mirror the data. Are the responses really that
>> verbose?
> VCR gives me an XML payload.  I want a struct that I can operate on.  I
> had a poke into the aws-sdk-core code to see if there was a place where I
> could inject the XML and get the Struct out, but it didn't look hopeful.

Still not sure I understand. Are you saying VCR doesn't work with this gem?
You should be able to just record the XML response from the API via VCR,
call the client method again in subsequent tests and get your "frozen"
response as structs, letting aws-sdk deal with the deserialisation for you?

> The responses aren't TOO verbose, and for canned data purposes I don't
> need that many... but it just felt like there ought to be a way to do it
> automatically.  I'm currently thinking something like (untested,
> caffeinated):


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140414/e8aba3b0/attachment-0003.html>

More information about the Chat mailing list