basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

"merge" setting for mappings is broken [JIRA: RIAK-2549] #217

Open RJ opened 8 years ago

RJ commented 8 years ago

Two schema files. The second schema attempts to change the default value for a mapping, by specifying "merge":

$ cat 1.schema
{mapping, "test", "app.test", [
    {datatype, string},
    {default, "1"}
]}.

$ cat 2.schema
{mapping, "test", "app.test", [
    merge,
    {default, "2"}
]}.

Default hasn't changed, shouldn't it be "2"?

cuttlefish_schema:files(["1.schema", "2.schema"]).
{[],
 [#mapping{variable = ["test"],
           mapping = "app.test",default = "1",commented = undefined,
           datatype = [string],
           level = basic,doc = [],include_default = undefined,
           validators = [],is_merge = false,see = [],hidden = false}],
 []}