Closed aboudreault closed 8 years ago
ah, and query/respons example:
http://127.0.0.1:8000/api/tests?date_from=1445458013
[
{
"href": "/api/tests/id/458ad396-782f-11e5-bf8f-0242ac11002a",
"test_id": "458ad396-782f-11e5-bf8f-0242ac11002a"
}
]
The code looks good. So, if there are multiple tests, you get a list of objects, like
[
{
"href": "/api/tests/id/458ad396-782f-11e5-bf8f-0242ac11002a",
"test_id": "458ad396-782f-11e5-bf8f-0242ac11002a"
},
{
"href": "/api/tests/id/...",
"test_id": "...",
}
]
If so, that looks good to me. I'm not sure what the value of the href
is when it's trivial to construct it given the test_id
, but if you can think of any use case, then I have no problem with it.
I agree there are not much value here. Usually, it's a good practice in APIs to provide the urls of the resources they return. It allows the client to really only consume the data and not parse/guess/fetch. Sometime, the href is more complex.
If in any case it becomes a problem, we can remove it sure.
Should we add 'scheduled_date' in those summary objects? if its useful for you.
@mambocab This is for #106.
The filtering is quite precise. I'll let you decide if it is OK or not.