Project

General

Profile

Bug #7841

Datetime fields in the API are returning a full JSON object

Added by Eric Helms over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
API
Target version:
-
Difficulty:
medium
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

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.

last_sync.png View last_sync.png 150 KB Eric Helms, 10/07/2014 11:56 AM
Last sync

Related issues

Is duplicate of Katello - Bug #7923: Sync plan start date is displayed as objectDuplicate2014-10-13

History

#1 Updated by Eric Helms over 7 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
  • Legacy Backlogs Release (now unused) 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": "",
"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
},

#2 Updated by Walden Raines over 7 years ago

  • Is duplicate of Bug #7923: Sync plan start date is displayed as object added

#3 Updated by Dominic Cleal over 7 years ago

IIRC this was an oj update or something similar.

#4 Updated by Justin Sherrill over 7 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

#5 Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1873 added
  • Pull request deleted ()

#6 Updated by Dominic Cleal over 7 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.

Also available in: Atom PDF