New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icinga DB: serialize icinga:config:checkcommand:argument#value and #set_if as expected #8725
Conversation
Al2Klimov
commented
Apr 19, 2021
•
edited
edited
Config
Before
After
|
f0cf3c1
to
737e535
Compare
737e535
to
81204c5
Compare
81204c5
to
fdd4726
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR still changes the behavior of JsonEncode
, even though this change should no longer have an effect on the two attributes mentioned in the PR title. Do we still want this change?
lib/base/json.cpp
Outdated
stateMachine.Null(); | ||
|
||
break; | ||
// obj is most likely a function => "Object of type 'Function'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not about likeliness but about what you put in. I'd just say "other object types are encoded as their string representation, for example "Object of type 'Function'"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Eric it is.
…et_if as expected I.e. keep the serializations as simple as possible: null => null true => true 42.0 => 42 "foobar" => foobar {{42}} => Object of type 'Function' (["foobar"] and {"foo"="bar"} can't occur there.)
fdd4726
to
f5abec2
Compare
Can you please explain exactly what changes with this PR? A real JSON representation for this would be helpful. |
In Icinga 2 command args' value and set_if may be various values (examples listed left). However in Icinga DB they’re strings and must represent the origin values somehow (examples listed right). |