EasyConfig.jl icon indicating copy to clipboard operation
EasyConfig.jl copied to clipboard

Empty Objects

Open asbisen opened this issue 3 months ago • 1 comments

Per my understanding accessing non existing items is supposed to create an empty object. The JSON objects that I want to create would rely on this capability. But I am noticing that I am unable to create empty objects. The only way to create an empty item seems to be when I add an empty Dict.

julia> using EasyConfig

julia> c = Config()
Config()

julia> c.a
Config()

julia> c.a.b
Config()

julia> c
Config()

julia> c[:title]
Config()

julia> c[:data] = Dict()
Dict{Any, Any}()

julia> c
Config with 1 entry:
  :data => Dict{Any, Any}()

asbisen avatar Nov 20 '25 03:11 asbisen

There's an assumption that empty Configs shouldn't exist (there's a note about this in the README).

This behavior could be made opt-out so that you could store empty Configs. I'd need to think about the best way to enable it though.

joshday avatar Nov 24 '25 14:11 joshday