Activiti

JSON Response contains unescaped control caharcters

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 5.0.beta2
  • Component/s: Explorer
  • Labels:
    None
  • Number of attachments :
    0

Issue Links

Activity

Hide
Yury Horbach added a comment - - edited

Oops, wrong key pressed, now can't finish my entry. So here is the missing description of this issue.

When obtaining task details via the REST API using the request:
GET /tasks?[assignee={userId}|candidate={userId}|candidate-group={groupId}][&start=0][&size=10]

the JSON response contains unescaped control characters. The easiest way to reproduce this is to use the process "financialReport" from the demo setup.

This is where the problem becomes clear (see the [description] field, after the first sentence there is a new line character, you can't see it here):

"data": [

{ "id": 292, "name": "Verify monthly financial report", "description": "Verify monthly financial report composed by the accountancy departement. This financial report is going to be sent to all the company shareholders.", "priority": 2, "assignee": null, "executionId": 285 }

]
,
"total": 1,
"start": 0,
"size": 10,
"sort": "id",
"order": "asc"
}

There is a "new line" character in the description of the above task, which causes an error when decoding such malformed JSON data.

Show
Yury Horbach added a comment - - edited Oops, wrong key pressed, now can't finish my entry. So here is the missing description of this issue. When obtaining task details via the REST API using the request: GET /tasks?[assignee={userId}|candidate={userId}|candidate-group={groupId}][&start=0][&size=10] the JSON response contains unescaped control characters. The easiest way to reproduce this is to use the process "financialReport" from the demo setup. This is where the problem becomes clear (see the [description] field, after the first sentence there is a new line character, you can't see it here): "data": [ { "id": 292, "name": "Verify monthly financial report", "description": "Verify monthly financial report composed by the accountancy departement. This financial report is going to be sent to all the company shareholders.", "priority": 2, "assignee": null, "executionId": 285 } ] , "total": 1, "start": 0, "size": 10, "sort": "id", "order": "asc" } There is a "new line" character in the description of the above task, which causes an error when decoding such malformed JSON data.
Hide
Yury Horbach added a comment - - edited

Also see the JSON spec clearly stating that JSON-encoded strings should not contain any control characters:

http://www.json.org/

Show
Yury Horbach added a comment - - edited Also see the JSON spec clearly stating that JSON-encoded strings should not contain any control characters: http://www.json.org/
Hide
Erik Winlöf added a comment -

Fixed since revision 816

Show
Erik Winlöf added a comment - Fixed since revision 816

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
2h
Original Estimate - 2 hours
Remaining:
2h
Remaining Estimate - 2 hours
Logged:
Not Specified
Time Spent - Not Specified