Closed marcnause closed 5 years ago
fixed with https://github.com/fossasia/susi_server/commit/f5f08bac7b4d81f429a334b4cf1e1a6f6cbbb2ef
The skill for this would look like
origin of *
!console:$!$
{
"url":"https://api.hostip.info/get_json.php?ip=$1$",
"path":"$.city"
}
eol
Many services don't respond with arrays of elements (like a list of search results), they just return simple key/value pairs instead.
Example: https://api.hostip.info/get_json.php?ip=80.122.124.100 returns the following result:
{ "country_name": "AUSTRIA", "country_code": "AT", "city": "Vienna", "ip": "80.122.124.100" }
When the user creates a skill with a service like that, it is not possible to access the data yet. because the path of the skill cannot be set to reference the whole response.
It should be possible to define a path which references the whole result instead of an element in the result.