We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I assume I found a bug in how this version of conform handles default values of binaries in complex datatypes:
The error occurred with the following example schema
[ mappings: [ "test.routes.*": [ to: "app.routes", datatype: [:complex], default: [] ], "test.routes.*.foo": [ doc: "foooo", to: "app.routes", datatype: :binary, default: "bar" ], "test.routes.*.ham": [ doc: "ham", to: "app.routes", datatype: :binary, default: "egg" ], "test.test": [ doc: "test", to: "app.test", datatype: :binary, default: "peng" ] ], translations: [ "app.routes.*": fn _h, {key, value_map}, acc -> acc ++ [{key, [foo: value_map[:foo], ham: value_map[:ham]]}] end ] ]
using the following app.con
test.routes.route1.foo = "baaaar" test.routes.route1.ham = "eeeeeeeg" test.routes.route2.foo = "12345" test.routes.route2.ham = "abcde" test.routes.route3.foo = "barrrrr" test.routes.route3.ham = "" test.test = ""
I get the following result using mix conform.effective
mix conform.effective
[app: [routes: [route1: [foo: "baaaar", ham: "eeeeeeeg"], route2: [foo: "12345", ham: "abcde"], route3: [foo: "barrrrr", ham: "egg"]], test: ""]]
so the default value in app.test is overwritten by the empty string, whereas app.routes.route3.ham used the default value instead.
app.test
app.routes.route3.ham
To me this seems to be quite inconsistent and was a surprise leading to an error. Could you please make the behaviour consistent?
The text was updated successfully, but these errors were encountered:
@grundrauschen will look and fix
Sorry, something went wrong.
@grundrauschen I've pushed possible fix, can you test it - #7
ah no, it is bad solution I think
@grundrauschen Can you test it?
No branches or pull requests
default values in complex datatypes are not overwritten with empty binary
I assume I found a bug in how this version of conform handles default values of binaries in complex datatypes:
The error occurred with the following example schema
using the following app.con
I get the following result using
mix conform.effective
so the default value in
app.test
is overwritten by the empty string, whereasapp.routes.route3.ham
used the default value instead.To me this seems to be quite inconsistent and was a surprise leading to an error.
Could you please make the behaviour consistent?
The text was updated successfully, but these errors were encountered: