meaningful JSON data for statistical API's

Description

Description of problem:
Statistical API such as "/stats/project/{projectSlug}/version/{versionSlug}/contributor/{username}/{dateRange}" would give result as

{
"myusername":{
"zh-Hans":{
"approved":0,
"needReview":65,
"translated":67,
"rejected":0
}
}
}

However other REST services such as launchpad.. gives meaningful JSON data so that code won't have to map fields again.
So it would be really nice if we can get JSON data in following format

{
"id: "unique_identifier"{
"username": "john doe",
"langlist":[
"langname":"zh-hans":{
"approved":0,
"needReview":65,
"translated":67,
"rejected":0
}
]
}
}

Please note above format is just reference to show what is exactly means to have meaningful data

Environment

None

Activity

Show:

Former user 20 April 2018 at 00:24

We are closing all the old issues to have more clarity in our backlog for Zanata project. Feel free to re-open or leave a comment if you require our attention on your Jira.

Bugzilla Migration 29 July 2015 at 03:36

Sean Flanigan commented:

Changing this would definitely be a good idea. Apart from being hard to read, and probably difficult to work with, the current format is going to be difficult to extend.

As this API hasn't been released yet, I think we should immediately add a JavaDoc in StatisticsResource and related classes, explaining that it is an experimental API. For instance:

WARNING: this endpoint is experimental, and may change without notice.

If the API is released in Zanata 3.6.0 with this warning, I think it would be okay to change the format in, say, Zanata 3.6.1.

Bugzilla Migration 29 July 2015 at 03:36

Carlos Munoz commented:

While this might be a good improvement from a human readability perspective, there is no actual change in the data being provided by the service. Lowering the priority and seeking other opinions.

If we decide to go ahead with this, we need to do it for next release, or even as a minor upgrade to prevent as many users as possible from integrating with this version of the API.

Duplicate

Details

Assignee

Reporter

Labels

Components

Priority

More fields

Created 29 July 2015 at 03:36
Updated 20 April 2018 at 00:26
Resolved 4 January 2016 at 04:20