-
Notifications
You must be signed in to change notification settings - Fork 2
Add new fix method to set variable with element value #282 #365
Conversation
581930b
to
5561729
Compare
ef19462
to
a05d0e9
Compare
a05d0e9
to
726d0fa
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.
I've updated the implementation to account for missing values and added tests for edge cases (a52dc9b).
Open questions:
- How to handle missing values? Is an empty string the right choice?
- How to handle non-string values? Is the Java object representation the right choice? (Previously, you said that it "should only work with string-elements".)
Finally, the new function needs to be documented.
22e0482
to
f74143a
Compare
Also, test edge cases.
f74143a
to
a52dc9b
Compare
I would not add a variable if the element does not exist.
I thought MF only processes string values in the Stream-Processing. Because of that we introduced marker for numbers in the json-encoder. The idea with string was the connection to the other ticket in mf-core but I have put the idea in core on hold.
|
Metafix knows data types strings, arrays and objects; variables can only contain strings. |
Ah, I forgot. Then I would suggest an exception that the function expected a string but got hash or array. |
This might become difficult to use:
|
I favor the the option to define a default value. The conditional for the a variable sounds good. I am also in favor to delete the variable at the end of each record. |
Implemented in cee638a.
Implemented in 46d1ef5.
Should probably be handled in separate issues. |
Sure, why not. |
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.
Very useful feature!
Resolves #282