Project

General

Profile

Actions

Bug #6248

closed

Some JSON responses are still nested in a root node

Added by David Davis over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 3 (0 open3 closed)

Related to Foreman - Bug #5178: Users API requires parameters to be wrappedClosedJoseph Magen04/14/2014Actions
Related to Foreman - Bug #4181: V2: Api docs in foreman should not specify a root node for POST/PUTRejectedJoseph Magen01/24/2014Actions
Related to Foreman - Bug #6715: revert API v2 GET response to wrapped parameters using object nodeRejectedJoseph Magen07/22/2014Actions
Actions

Also available in: Atom PDF