spree / spree_wombat

Connect your Spree Commerce storefront to Wombat
BSD 3-Clause "New" or "Revised" License
31 stars 53 forks source link

Improves Spree::Wombat::Response serializer to handle objects #35

Closed buccolo closed 10 years ago

buccolo commented 10 years ago

Hey,

This fixes ResponderSerializer to add objects to the root of the json:

{
    "request_id": "12355",
    "summary": "Order abc124 was added",
    "products": [
        {
            "id": "abc",
            "name": "Epic awesome tiger pyjamas"
        }
    ],
    "ninjas": [
        {
            "id": 1,
            "stars": "steel"
        },
        {
            "id": 2,
            "stars": "iron"
        }
    ]
}

Instead of having it under an objects key.

Also, I think webhook_controller was supposed to wrap the responder with the ResponserSerializer so we can customize the serialization.

I've also included a spec to make sure future changes won't break it.

Cheers :beers:

Bruno