Feature #3693
closed
API v2 - accept GET json format of object in PUT/POST requests to add/remove has_many associations
Added by Joseph Magen about 11 years ago.
Updated over 6 years ago.
Description
Currently we have to use _ids= methods to add/remove relationships.
{
"id": 42,
"name": "CentOS",
"architecture_ids": [1,2]
}
This is what we want
{
"id": 42,
"name": "CentOS",
"architectures": [
{
"id": 1,
"name": "i386"
},
{
"id": 2,
"name": "x86_64"
}
]
}
Related issues
1 (1 open — 0 closed)
- Project changed from Katello to Foreman
- Category set to API
- Status changed from Assigned to Ready For Testing
- Target version set to 1.10.0
- Translation missing: en.field_release set to 2
- Target version changed from 1.10.0 to 1.9.3
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #4571: "Domain (..) expected, got ActiveSupport::HashWithIndifferentAccess(..)" when setting associations with wrapped object added
Also available in: Atom
PDF