Dear all
I recently updated to Snapshot build 503. Where I got difficulties with REST api regarding sitemaps.
While calling the list of Sitemaps works as expected (REST doc):
curl -X GET --header "Accept: application/json" "http://localhost:8085/rest/sitemaps"
Request URL
http://localhost:8085/rest/sitemaps
Response Body
[
{
"name": "home",
"label": "Townhouse",
"link": "http://localhost:8085/rest/sitemaps/home",
"homepage": {
"link": "http://localhost:8085/rest/sitemaps/home/Aarau",
"leaf": false,
"widgets": []
}
},
{
"name": "_default",
"label": "Home",
"link": "http://localhost:8085/rest/sitemaps/_default",
"homepage": {
"link": "http://localhost:8085/rest/sitemaps/_default/_default",
"leaf": false,
"widgets": []
}
}
]
Response Code
200
Response Headers
{
"date": "Mon, 03 Oct 2016 06:43:40 GMT",
"content-type": "application/json",
"content-length": "373",
"server": "Jetty(9.2.14.v20151106)"
}
Calling the the sitemap at: http://localhost:8085/rest/sitemaps/home fails
curl -X GET --header "Accept: application/json" "http://localhost:8085/rest/sitemaps/home"
Request URL
http://localhost:8085/rest/sitemaps/home
Response Body
{
"error": {
"http-code": 500,
"exception": {
"class": "java.lang.NullPointerException"
}
}
}
Response Code
500
Response Headers
{
"date": "Mon, 03 Oct 2016 06:49:56 GMT",
"content-type": "application/json",
"content-length": "115",
"server": "Jetty(9.2.14.v20151106)"
}
The “_default” works.
In the same time it is possible to access the home.sitemap from basicui and classicui, but not from an external non openHAB2 UI.
Warning: file_get_contents(http://localhost:8085/rest/sitemaps/home): failed to open stream: HTTP request failed!
Kind regards
Stefan