Project

General

Profile

Actions

Bug #7841

closed

Datetime fields in the API are returning a full JSON object

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

Status:
Resolved
Priority:
High
Assignee:
-
Category:
API
Target version:
-
Difficulty:
medium
Triaged:
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.


Files

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

Related issues 1 (0 open1 closed)

Is duplicate of Katello - Bug #7923: Sync plan start date is displayed as objectDuplicateWalden Raines10/13/2014Actions
Actions #1

Updated by Eric Helms over 9 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": "",
"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
},

Actions #2

Updated by Walden Raines over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

IIRC this was an oj update or something similar.

Actions #4

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

Actions #5

Updated by The Foreman Bot over 9 years ago

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

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

Actions

Also available in: Atom PDF