A simple wrapper for the Star Wars API - Swapi Documentation
The Hex package can be installed as:
-
Add
swapito your list of dependencies inmix.exs:def deps do [{:swapi, "~> 1.0.0"}] end
-
Ensure
swapiis started before your application:def application do [applications: [:swapi]] end
For each below (except root) you can use any of the following:
peoplefilmsstarshipsvehiclesspeciesplanets
# Get the list of resources
iex> Swapi.root
{:ok, {...}}# Get all people
iex> Swapi.single("people", 1)
{:ok, {...}}# Get all people
iex> Swapi.all("people")
{:ok, {...}}# Get the schema for people
iex> Swapi.schema("people")
{:ok, {...}}