Bug #35816
closedInternal Server Error when creating a CV with org_id specified as array
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2129950
Description of problem:
When creating a CV through API, I get ISE (log attached) when I specify organization ID as a list of IDs:
$ curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'
{"displayMessage":"undefined method `start_with?' for [1]:Array","errors":["undefined method `start_with?' for [1]:Array"]}
The part before ":Array" is the value specified for organization_id
Version-Release number of selected component (if applicable):
Reproduced with katello 4.5 AND 4.3
How reproducible:
Deterministic
Steps to Reproduce:
curl -uadmin:<password> -k -H "Content-Type:application/json" -H "Accept:application/json" -X POST https://<FQDN>/katello/api/v2/content_views -d '{"name": "test1", "organization_id": [1], "api_version": "v2", "content_view": {"name": "test1", "organization_id": [1]}}'
Actual results:
Traceback, error, no CV created
Expected results:
Either CV created with the specified organization or at least correctly handled error, no ISE