You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create array with one entry: dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger' -v '{"-name":"JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService","-maxlevel":"Error","-final":" true"}'
And try to append: dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"auto-colored-console-async","-final":"true"}'
results in error: Error: cannot use append selector on non slice/array types
Expected behavior
Dasel can append to an array with just one member
Additional context
Workaround: Create an array with two members first. dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger' -v '{"-name":"JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService","-maxlevel":"Error","-final":"true"}{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"file-async","-final":"true"}'
This is due to the XML parser used and there isn't any known workaround for it right now. I'll keep this open as a reminder to do some digging to see if I can find a solution.
Describe the bug
dasel v2.0.2. This is present in 1.x as well.
Create array with one entry:
dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger' -v '{"-name":"JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService","-maxlevel":"Error","-final":" true"}'
And try to append:
dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"auto-colored-console-async","-final":"true"}'
results in error:
Error: cannot use append selector on non slice/array types
Expected behavior
Dasel can append to an array with just one member
Additional context
Workaround: Create an array with two members first.
dasel put -f NLog.config -r xml -w xml -t json 'nlog.rules.logger' -v '{"-name":"JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService","-maxlevel":"Error","-final":"true"}{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"file-async","-final":"true"}'
The same append will then work.
NLog.config.txt
The text was updated successfully, but these errors were encountered: