Bug #17087
closed
Updating default_value of a hash/array smart class parameter with a non string value should return an error message
Added by Ori Rabin about 8 years ago.
Updated over 6 years ago.
Description
Sending default_value as a hash/array fails through the api but doesn't give any error message.
Sending:
"default_value": "['a','b']"
will work but
"default_value": ['a','b']
will fail with no error message
default_value is defined as taking a string input in the API, the user shouldn't really be passing non-string values (arrays, hashes, ints, bools). It should probably be a string representation matching the UI. Or is some conversion happening prior to it reaching the model?
(Logs showing the issue may make this clearer.)
I agree that when it's defined as string, it should take only strings. Better error message would be appreciated though, but I'd prefer to handle it as a generic issue for the whole api.
- Subject changed from Updating default_value of a hash/array smart class parameter fails in the api to Updating default_value of a hash/array smart class parameter with a non string value should return an error message
- Description updated (diff)
I updated the description.
I agree with Tomas, Setting does allow to send an array as a value so this needs an error message or to change.
- Status changed from New to Ready For Testing
- Assignee set to Ori Rabin
- Pull request https://github.com/theforeman/foreman/pull/4137 added
- Target version set to 1.10.3
- Bugzilla link set to 1411069
I'm running foreman 1.13.3-1. I'm having issues with overriding hashes (smart class parameter).. Yaml looks good but after I change the environment of the host I'll get a error 'value is invalid hash'. That happens to all the hashes which I want to override. It only happens after I try to change the environment of a host. Is this bug related to this? Many thanks!
Is your update through the api or UI? this bug is an api bug so if you're updating through the UI it's not related.
If it is unrelated please open a new issue with a description of steps and if possible attach screenshots or examples of the values.
thanks. It's indeed GUI related.
I'll open an new ticket.
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 240
- Target version changed from 1.10.3 to 1.14.1
- Related to Bug #22753: Some API parameters are wrongly documented as enum types added
Also available in: Atom
PDF