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
I saw that the command outputs duplicated config entries (i.e. the "plugin" switch) as duplicated keys in the JSON output. This is only more or less valid, while the formal specification allows this, all the implementations complain about it and most will filter out duplicated entries by picking the first or last one. We can see this by pushing the output of listconfigs through the neat command-line tool jq:
External applications that are using the RPC interface (such as web interfaces, remote wallets, ...) will have a hard time to access the duplicated entries when their JSON library do not support this.
Suggestion
We could replace duplicated keys by just one key having an array of the the values that were duplicated, example:
Backwards compatibility may be affected, though a lot of applications were missing out the duplicates anyway already.
We could add an RPC switch, for example something like --json-normalize, that will post-process the JSON output and collects duplicates by putting them into an array. This way we don't break backwards compatibility while offering a solution to users that otherwise can't see the duplicated values...
The text was updated successfully, but these errors were encountered:
Issue and Steps to Reproduce
I saw that the command outputs duplicated config entries (i.e. the
"plugin"
switch) as duplicated keys in the JSON output. This is only more or less valid, while the formal specification allows this, all the implementations complain about it and most will filter out duplicated entries by picking the first or last one. We can see this by pushing the output oflistconfigs
through the neat command-line tooljq
:lightning-cli listconfigs | jq
Impact
External applications that are using the RPC interface (such as web interfaces, remote wallets, ...) will have a hard time to access the duplicated entries when their JSON library do not support this.
Suggestion
We could replace duplicated keys by just one key having an array of the the values that were duplicated, example:
Considerations
--json-normalize
, that will post-process the JSON output and collects duplicates by putting them into an array. This way we don't break backwards compatibility while offering a solution to users that otherwise can't see the duplicated values...The text was updated successfully, but these errors were encountered: