config icon indicating copy to clipboard operation
config copied to clipboard

No overwrite for object list

Open Rafnuss opened this issue 1 year ago • 1 comments

Just trying to understand what I'm doing wrong with this config file

default:
  val: 1
  tag_set_map:
    - stap_id: [3, -1]

22NO:
  val: 2
  tag_set_map:
    - stap_id: 3

This makes sense to me:

config::get(config = "22NO")$val
#> 2

But not this:

config::get(config = "22NO")$tag_set_map
#> [[1]]
#> [[1]]$stap_id
#> [1]  3 -1

How come 22NO is not overwriting the default for object list items? Or did I do something wrong? Thanks,

Rafnuss avatar Sep 10 '24 14:09 Rafnuss

Looks the same as https://github.com/rstudio/config/issues/42, so no solution than naming the list right?

Rafnuss avatar Sep 10 '24 15:09 Rafnuss

Yes. Lists will get merged recursively, so naming your list seems like a good workaround.

andrie avatar Jan 08 '25 15:01 andrie