Bug #6248
closedSome JSON responses are still nested in a root node
Description
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.