Bug #7841
closedDatetime fields in the API are returning a full JSON object
Description
See screenshot for the issue. This happens on the repository list page, the content view list page and the content view versions page.
This was seen on a CentOS 7 devel install.
Files
Updated by Eric Helms almost 10 years ago
- Project changed from Katello to Foreman
- Subject changed from Content view last publish and last sync of related repositories shows JSON to Datetime fields in the API are returning a full JSON object
- Category changed from Web UI to API
- Priority changed from Normal to High
- Translation missing: en.field_release deleted (
14) - Difficulty changed from easy to medium
This was previously thought to be an isolated issue, but appears to be widespread. For example, when hitting /api/v2/users you can see the 'last_login_on' field is showing too much information:
{
"total": 1,
"subtotal": 1,
"page": 1,
"per_page": 20,
"search": null,
"sort": {
"by": null,
"order": null
},
"results": [
{
"id": 3,
"login": "admin",
"firstname": "Admin",
"lastname": "User",
"mail": "root@example.com",
"admin": true,
"auth_source_id": 1,
"auth_source_name": "Internal",
"last_login_on": {
"time": "2014-10-13T14:39:06Z",
"time_zone": {
"name": "UTC",
"utc_offset": null,
"tzinfo": {
"identifier": "Etc/UTC",
"real_timezone": {
"info": {
"identifier": "Etc/UTC",
"offsets": {
"o0": {
"utc_offset": 0,
"std_offset": 0,
"abbreviation": "UTC",
"utc_total_offset": 0
}
},
"transitions": [],
"previous_offset": {
"utc_offset": 0,
"std_offset": 0,
"abbreviation": "UTC",
"utc_total_offset": 0
},
"transitions_index": null
}
}
},
"current_period": null
},
Updated by Walden Raines almost 10 years ago
- Is duplicate of Bug #7923: Sync plan start date is displayed as object added
Updated by Dominic Cleal almost 10 years ago
IIRC this was an oj update or something similar.
Updated by Justin Sherrill almost 10 years ago
locking oj down to 2.10.2 seems to fix it:
gem 'oj', '= 2.10.2'
as it was introduced in 2.10.3. I found this open issue as well: https://github.com/ohler55/oj/issues/192
Updated by The Foreman Bot almost 10 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1873 added
- Pull request deleted (
)
Updated by Dominic Cleal almost 10 years ago
- Status changed from Ready For Testing to Resolved
oj 2.10.4 is believed to fix the problem. Please run "bundle update oj" if you run into it.