Description of problem: When editing the "miq_groups" the request fails with: { "error": { "kind": "internal_server_error", "message": "MiqGroup(#105333660) expected, got Hash(#11727220)", "klass": "ActiveRecord::AssociationTypeMismatch" } } Version-Release number of selected component (if applicable): 5.8.3.4 The same request works on 5.9.0.22. How reproducible: 100% Steps to Reproduce: 1. create a user 2. POST /api/users/:id { "action": "edit", "resource": { "miq_groups": [ {"href": "https://addr/api/groups/13"}, {"href": "https://addr/api/groups/6"} ] } } Response: { "error": { "kind": "internal_server_error", "message": "MiqGroup(#105333660) expected, got Hash(#11727220)", "klass": "ActiveRecord::AssociationTypeMismatch" } }
The reason for this issue is that on 5.8, `miq_groups` was not supported, it was added later on for the G release. In this version, only a single group is allowed, which sets the `miq_groups` to that partciular group. In 5.8, the following editing of groups was allowed: POST /api/users/:id { "action": "edit", "resource": { "group": { "description": "group_description" } } } Also supported are id and href for a group. However, I will fix to return an appropriate error message, unless this feature is requested in 5.8. Please let me know what approach to take. Thank you!
Thanks for clarification Jillian, I don't know of any request to support this feature in 5.8 (I just tried if it works there), appropriate error message seems good enough to me. Also severity can be decreased. Thank you!
https://github.com/ManageIQ/manageiq/pull/17056