While listing out the films is a starting point, using HAL - http://stateless.co/hal_specification.html - would make this much more powerful. Check out the heading "Representing Multiple Links With The Same Relation" because structuring the JSON like this would allow more flexibility in displaying data without causing the client to make more requests.
_items: {
"films": [{
"name": "A New Hope",
"href": "/films/1/"
},{
"name": "The Empire Strikes Back",
"href": "/films/2/"
}]
}
I'd also apply this to the species, vehicles, planets subresources but I wanted to give a single example.
Context:
Relevant section of the schema: https://github.com/phalt/swapi/blob/master/resources/schemas/people.json#L43
While listing out the films is a starting point, using HAL - http://stateless.co/hal_specification.html - would make this much more powerful. Check out the heading "Representing Multiple Links With The Same Relation" because structuring the JSON like this would allow more flexibility in displaying data without causing the client to make more requests.
I'd also apply this to the species, vehicles, planets subresources but I wanted to give a single example.