Introduce a value variable for scalar converters, make `match_value` optional
Since match_value
requires implicit string casting and can lead to a somewhat clumsy syntax (cf. example in #10 (closed)), we will introduce a variable that's implicitly set by the _AbstractDictElementConverter
(or _AbstractElementConverter
, see #15 (closed)) and stores the value of a scalar structure element. In order to prevent naming conflicts this might either be implemented such that the converter name can be used to access the value in the cfood, i.e.,
float_element:
type: DictFloatElement
match_name: float_element
records:
SomeRT:
some_prop: $float_element
similar to how a file path is being set right now. An alternative could be to use value
as the default name, i.e.,
float_element:
type: DictFloatElement
match_name: float_element
records:
SomeRT:
some_prop: $value
to prevent naming conflicts and make this more explicit, the name can be overwritten, e.g.
float_element:
type: DictFloatElement
match_name: float_element
value: this_value
records:
SomeRT:
some_prop: $this_value
This has to be documented very carefully since a variable that's created implicitly by the converter will surprise the users otherwise.