Bug #7776
closedIt is possible to register multiple parameters with the same name using the REST API
Description
When doing several equal posts to https://<host>/api/v2/hostgroups/<hostgroupname>/parameters with a json of { "parameter" : { "name" : "foo", "value" : "something" } }, I am able to create several parameters named "foo".
When manipulating the same parameters with put on https://<host>/api/v2/hostgroups/<hostgroupname>/parameters/<internal id of param> with the json of { "parameter" : { "value" : "something" } }, an error stating
{
"error": {"id":3528,"errors":{"name":["has already been taken"]},"full_messages":["Name has already been taken"]}
}
is returned. I feel that this error should also be returned on the second POST above in the interests of providing a clear and orthogonal API.
Updated by Dominic Cleal about 10 years ago
- Is duplicate of Bug #6695: Adding two OS parameters with same name doesn't raise any error when values are different added
Updated by Dominic Cleal about 10 years ago
- Status changed from New to Feedback
Thanks for the report, I think we've fixed this via #6695 for Foreman 1.7. If you get the opportunity, please try out our nightly builds to verify.