Using JSON Hyper-Schema via Flask-Potion, I have an API that returns a list of species found at /api/species
. It returns something like this:
[
{
"$uri": "/api/species/1",
"latin_name": "danio rerio",
"name": "zebrafish"
}
]
For my web frontend, I'd like /species/1
to be the user facing URL that obtains its data for display purposes from /api/species/1
. This user facing URL has nothing to do with the underlying API except it makes sense to map the IDs since how else will I format my user facing URLs? So when I have a list of species that should link to their respective species pages, how to I form /species/1
? Since the $uri I get from my API is the API uri, am I supposed to parse this string to extract "1
" or is there a more elegant solution that I'm missing here?