yeti / signals

MIT License
3 stars 4 forks source link

Abstract out reliance on DRF response structure #33

Open baylee opened 8 years ago

baylee commented 8 years ago

Currently we are assuming that list responses follow a Django REST Framework list response structure, e.g.:

{
    "count": 26, 
    "next": null, 
    "previous": null, 
    "results": [
        {},
        {}
    ]
}

We are automatically pulling out results as the objects of interest. This will break for any API that just returns results as a simple list, or with a different key.

Some options to resolve this could be:

baylee commented 8 years ago

Ah, I see we kept the keyPath logic in the templates. @rmutter I'm happy to add this back to the parser and update the templates if you think it's the way to go.

rmutter commented 8 years ago

@baylee I don't know if there would preferably be a global default as well as a way to configure it per endpoint. Globally may be the more valuable feature to implement first.