Open blackwinter opened 1 year ago
The aspect of the intermediate structure seems to be true for all fixes of the set_
-family so not just for set_field
but also for set_array
and set_hash
. I think that the adjustment for all these fixes makes sense since we want to adjust to the behaviour of Catmandu BUT on the side of lobid and oersi we rely on a fixes that create empty hashes and empty arrays WITH the intermediate structure. So If we move on with this, we should also introduce two new fix functions add_array
and add_hash
as counterpart to set_hash
and set_array
.
PS: The new functions add_hash
and add_array
could reuse the current implementation of set_array
and set_hash
while the version without creating intermediate structure would replace the the current one.
add_array
and add_hash
are introduced now and the set functions are only aliases now.
We should advise anybody to use the add functions instead of the set ones until the new behaviour is introduced.
Also wenn the behaviour change is implemented we should rename all set tests to add ones as well as add new set functions.
add_field()
andset_field()
are going to be equivalent with #308, but according to Catmandu's documentationset_field()
"will not create the intermediate structures if they are missing".Functional review: @TobiasNx Code review: @blackwinter / @fsteeg