Page MenuHomeVyOS Platform

`show configuration json` (op mode) and `show | json` (conf mode) represent multi-value nodes differently
Open, LowPublicBUG

Description

It seems that show configuration json in operational mode and show | json in configuration mode do not represent multi-value configuration nodes in the same way. For example, given the config:

interfaces {
    ethernet eth0 {
        address dhcp
        address dhcpv6
    }
    ethernet eth1 {
        address dhcp
    }
}

show configuration json (op mode) returns:

{
    "interfaces": {
        "ethernet": {
            "eth0": {
                "address": [
                    "dhcp",
                    "dhcpv6"
                ]
            },
            "eth1": {
                "address": [
                    "dhcp"
                ]
            }
        }
    }
}

while show | json (config mode) returns:

{
    "interfaces": {
        "ethernet": {
            "eth0": {
                "address": [
                    "dhcp",
                    "dhcpv6"
                ]
            },
            "eth1": {
                "address": "dhcp"
            }
        }
    }
}

The config mode is representing single values as just a string instead of a 1-element array. It seems to me that operational mode's output is more consistent (always an array).

Is this difference in behavior expected? Is it possible to fix without breaking compatibility?

References:

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202202080317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)