Bug 1109964 - Some JSON responses are still nested in a root node
Summary: Some JSON responses are still nested in a root node
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: jmagen@redhat.com
QA Contact: sthirugn@redhat.com
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2014-06-16 18:42 UTC by David Davis
Modified: 2019-09-26 18:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:28:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6248 0 None None None 2016-04-22 15:33:45 UTC

Description David Davis 2014-06-16 18:42:25 UTC
I was reviewing this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1087372 but it doesn't look like everything was fixed.

$ curl "http://localhost:3000/katello/api/v2/organizations.json" -d '{"name": "Test20071"}' -u admin:changeme -H "Accept: application/json" -H "Content-Type: application/json"
{"organization":{"ancestry":null,"apply_info_task_id":null,"created_at":"2014-06-16T18:27:59Z","default_info":{"system":[],"distributor":[]},"deletion_task_id":null,"description":null,"id":4,"ignore_types":[],"label":"Test20071","name":"Test20071","owner_auto_attach_all_systems_task_id":null,"title":"Test20071","updated_at":"2014-06-16T18:28:03Z","service_levels":[],"service_level":null}}


It looks like the output is still being wrapped. Here's another object:

$ curl "http://localhost:3000/katello/api/v2/products.json" -d '{"name": "TEST", "organization_id": "1"}' -u admin:changeme -H "Accept: application/json" -H "Content-Type: application/json"
{"organization":{"name":"ACME_Corporation","label":"ACME_Corporation"},"created_at":"2014-06-16T18:39:15Z","updated_at":"2014-06-16T18:39:15Z","readonly":false,"id":97,"cp_id":null,"name":"TEST","label":"TEST","description":null,"provider_id":1,"sync_plan_id":null,"sync_status":{"created_at":null,"finish_time":null,"id":null,"organization_id":null,"parameters":{},"progress":{"items_left":0,"total_count":0,"size_left":0,"total_size":0},"result":null,"start_time":null,"state":"not_synced","task_owner_id":null,"task_owner_type":null,"task_type":null,"updated_at":null,"user_id":0,"uuid":null},"gpg_key_id":null,"redhat":false,"product_content":[],"available_content":[],"repository_count":0,"permissions":{"deletable":true},"library_repositories":[],"provider":{"name":"Anonymous"},"":null}

Notice how the attributes are not wrapped.

Comment 1 David Davis 2014-06-16 18:42:49 UTC
We're just extending the foreman controllers in Katello so I believe this is a foreman bug.

Comment 3 Bryan Kearney 2014-06-17 16:15:03 UTC
changing upstram due to duplicate.

Comment 4 jmagen@redhat.com 2014-06-18 08:46:41 UTC
fixed at https://github.com/theforeman/foreman/pull/1518

assigned to redmine bug #4181. I think #5880 is a duplicate.

Comment 5 Bryan Kearney 2014-06-24 10:04:30 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6248 has been closed

Comment 8 sthirugn@redhat.com 2014-08-25 19:40:07 UTC
Verified.  In snap 6 I see:

# curl -X POST -H "Accept:application/json" -H "Content-Type: application/json" -u admin:changeme --insecure -d '{"name":"testorgapiAug25"}' https://cloud-qe-14.idm.lab.bos.redhat.com/katello/api/v2/organizations

{"ancestry":null,"apply_info_task_id":null,"created_at":"2014-08-25T18:11:45Z","default_info":{"system":[],"distributor":[]},"description":null,"id":11,"ignore_types":[],"katello_default":true,"label":"testorgapiAug25","name":"testorgapiAug25","title":"testorgapiAug25","updated_at":"2014-08-25T18:11:46Z","service_levels":[],"service_level":null}

Version Tested:
GA Snap 6 - Satellite-6.0.4-RHEL-6-20140820.1

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.23-1.el6_5.noarch
* candlepin-common-1.0.1-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.23-1.el6_5.noarch
* candlepin-tomcat6-0.9.23-1.el6_5.noarch
* elasticsearch-0.90.10-6.el6sat.noarch
* foreman-1.6.0.41-1.el6sat.noarch
* foreman-compute-1.6.0.41-1.el6sat.noarch
* foreman-gce-1.6.0.41-1.el6sat.noarch
* foreman-libvirt-1.6.0.41-1.el6sat.noarch
* foreman-ovirt-1.6.0.41-1.el6sat.noarch
* foreman-postgresql-1.6.0.41-1.el6sat.noarch
* foreman-proxy-1.6.0.29-1.el6sat.noarch
* foreman-selinux-1.6.0.7-1.el6sat.noarch
* foreman-vmware-1.6.0.41-1.el6sat.noarch
* katello-1.5.0-29.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.60-1.el6sat.noarch
* openldap-2.4.23-34.el6_5.1.x86_64
* openldap-devel-2.4.23-34.el6_5.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.30.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.30.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.30.beta.el6sat.noarch
* pulp-server-2.4.0-0.30.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch

Comment 9 Bryan Kearney 2014-09-11 12:28:20 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.


Note You need to log in before you can comment on or make changes to this bug.