freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

POSTing incomplete template #30

Closed ghsnd closed 9 years ago

ghsnd commented 9 years ago

When posting the example template from the documentation (where the label is missing), a 500 Internal Server Error is returned.

curl -v -d @template.ttl -X POST -H "Content-Type: application/json" "http://localhost:8080/e-link/templates"

where template.ttl is

{
    "query":" PREFIX geo-pos: <http://www.w3.org/2003/01/geo/wgs84_pos#> CONSTRUCT { <@@@entity_uri@@@> geo-pos:lat ?lat . <@@@entity_uri@@@> geo-pos:long ?long . } WHERE { <@@@entity_uri@@@> geo-pos:lat ?lat . <@@@entity_uri@@@> geo-pos:long ?long . }",
    "endpoint":"http://factforge.net/sparql"
}

gives:

{
  "exception": "eu.freme.broker.exception.InternalServerErrorException",
  "path": "/e-link/templates",
  "message": "JSONObject[\"label\"] not found.",
  "error": "Internal Server Error",
  "status": 500,
  "timestamp": 1440160260699
}

Here, a 400 Bad Request might be a better response.

m1ci commented 9 years ago

fixed with https://github.com/freme-project/e-Link/issues/30