cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Rest JSON Response

pneudecorb
Champ in-the-making
Champ in-the-making
Hi,

I am using the restful aspect of activiti and noticed that it appears to be returning invalid json.  I would expect the resultant json to look similar to,
{
  "data": [
    {
      "id": "10",
      "name": "activiti-examples.bar",
      "deploymentTime": "2010-10-13T14:54:26.750+02:00"
    }
  ],
  "total": 1,
  "start": 0,
  "sort": "id",
  "order": "asc",
  "size": 1
}

but it comes back with none of the quotes and in place of the ':' name/value separator, it has an '=', so the response I get back looks like,

{
  data = [
    {
      id =10,
     …
    }
  ],
  total = 1,
  …
  size = 1
}

which is not parseable Json.

I'm not sure why Activiti would return JSon in this latter format and hoped someone on the forum might have seen this before?

I am using Activiti 5.9.

Thanks,
Pneu
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
As the activiti-rest client uses Restlet (and Jackson to generate JSON), so there is no "special" treatment for the API-call you're referring to. With what client did you do the JSON-call? What were the passed HTTP-request and response headers?

pneudecorb
Champ in-the-making
Champ in-the-making
I solved the problem.  I have deployed the activiti restful web app on a variant of service mix (FuseSource) and in doing so, one of my camel routes needed a convertBodyTo(String.class) as the payload was an InputStream (which was being toString'd) instead of a String like I thought.  Once I added the convertBodyTo(String.class) to the route, the Camel Exchange response contained the JSON in the correct format.

Pneu

frederikherema1
Star Contributor
Star Contributor
Great to hear it's solved Smiley Wink