Project

General

Profile

Bug #8862

The V2 API doesn't handle arrays of id/name of has_many relationships

Added by David Davis over 4 years ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

According to the API V2 spec, you should be able to pass in an array of id/name hashes when models have a many-to-many or one-to-many relationship:

$ curl -k -u admin:changeme -H "Accept: version=2,application/json" \
    -H "Content-Type: application/json" -X POST \
    -d '{ "domains": [{ "name": "earendil", "id": 1}, { "name": "turgon", "id": 3 }] }' \
    https://foreman.example.com/api/subnets/iluvatar

Katello doesn't support this. I think we can get this working relatively easy--just need to fix the setup_has_many_params filter.


Related issues

Related to Katello - Bug #8846: Katello API throws an incorrect error when receiving non-json requestsClosed2015-01-06

History

#1 Updated by David Davis over 4 years ago

  • Related to Bug #8846: Katello API throws an incorrect error when receiving non-json requests added

#2 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) set to 23
  • Triaged changed from No to Yes

#3 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) changed from 23 to 31

#4 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) deleted (31)

#5 Updated by Eric Helms over 3 years ago

  • Legacy Backlogs Release (now unused) set to 114

Also available in: Atom PDF