The QForce REST API returns Star Wars characters. It uses the https://swapi.co/ to retrieve the actual Star Wars characters.
Create a REST endpoint to search Star Wars characters by name or retrieve them by id.
The endpoint should look like:
/persons?q=r2
/persons/{id}
The search endpoint should return a list of Person
resources.
The Person
resource should look like:
{
"id": 1,
"name": "Luke Skywalker",
"birth_year": "19BBY",
"gender": "MALE",
"height": 172,
"weight": 77,
"movies": [
{
"title": "The Empire Strikes Back",
"episode": 5,
"director": "Irvin Kershner",
"release_date": "1980-05-17"
},
..
]
}
The get endpoint should return a single Person
resource and if the id does not exists it should return a 404
.
The api should write analytics to a (embedded) database to keep track how many times the api is called.
nl.qnh.qforce.domain
and nl.qnh.qforce.service
interfaces. Implementations must be developed and these interfaces may not be changed.