freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

enriching with template name as string #28

Closed ghsnd closed 9 years ago

ghsnd commented 9 years ago

Enriching a document with a template that has a string ID gives a 500 Internal Server error response:

curl -v -X POST -d @example.ttl "http://api-dev.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=thistemplatedoesnotexist" -H "Content-Type: text/turtle"

where example.ttl is the example from the API docs, gives:

{
  "timestamp": 1440147558217,
  "message": "Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: \"thistemplatedoesnotexist\"",
  "error": "Internal Server Error",
  "status": 500,
  "exception": "org.springframework.beans.TypeMismatchException",
  "path": "/e-link/documents/"
}

Maybe this could be a 400 Bad Request or something.

m1ci commented 9 years ago

fixed, error response:

{
    "timestamp": 1440151393425,
    "message": "The templateid parameter is not integer.",
    "error": "Bad Request",
    "status": 400,
    "exception": "eu.freme.broker.exception.BadRequestException",
    "path": "/e-link/documents/"
}