Skip to content

IETF Namespace Prefix Rendered Twice? #212

Description

@markuscraig

Hi Guys,

When (1) loading JSON-IETF data into a class instance and (2) then deserializing that instance to JSON-IETF, I'm seeing the OpenConfig namespace prefix being rendered twice. Like this...

# deserialize from json-ietf
$ ph = YANGPathHelper()
$ aps = pybindJSON.loads_ietf(OC_EXAMPLE_ACCESS_POINTS, openconfig_access_points, "openconfig_access_points", path_helper=ph)

# serialize to json-ietf
$ pybindJSON.dumps(aps, indent=None, mode='ietf')

Notice that the external namespace prefixes are duplicated (ie: openconfig-wifi-types:openconfig-wifi-types:FREQ_5GHZ)...

{"openconfig-access-points:access-points": {"access-point": [{"hostname": "link022-pi-ap", "ssids": {"ssid": [{"config": {"dhcp-required": false, "supported-data-rates": ["RATE_36MB", "RATE_48MB", "RATE_54MB"], "station-isolation": true, "hidden": false, "broadcast-filter": true, "name": "Auth-Link022", "ipv6-ndp-filter-timer": 300, "multicast-filter": true, "server-group": "freeradius", "dva": true, "ptk-timeout": 28800, "ipv6-ndp-filter": true, "basic-data-rates": ["RATE_36MB", "RATE_48MB", "RATE_54MB"], "opmode": "WPA2_ENTERPRISE", "qbss-load": true, "vlan-id": 300, "dot11k": true, "advertise-apname": true, "gtk-timeout": 3600}, "name": "Auth-Link022"}, {"config": {"dhcp-required": true, "supported-data-rates": ["RATE_11MB", "RATE_24MB"], "advertise-apname": true, "broadcast-filter": true, "name": "Guest-Link022", "multicast-filter": false, "dva": false, "ptk-timeout": 1000, "basic-data-rates": ["RATE_11MB", "RATE_24MB"], "vlan-id": 200, "dot11k": false, "hidden": false, "csa": false, "gtk-timeout": 1000}, "name": "Guest-Link022"}]}, "radios": {"radio": [{"config": {"scanning": false, "operating-frequency": "openconfig-wifi-types:openconfig-wifi-types:FREQ_5GHZ", "channel-width": 40, "dca": false, "transmit-power": 3, "dtp": false, "id": 0, "channel": 44}, "id": 0}, {"config": {"scanning": false, "operating-frequency": "openconfig-wifi-types:openconfig-wifi-types:FREQ_2GHZ", "dca": false, "transmit-power": 3, "dtp": false, "id": 1, "channel": 6}, "id": 1}]}, "system": {"aaa": {"server-groups": {"server-group": [{"config": {"type": "openconfig-aaa:openconfig-aaa:RADIUS", "name": "freeradius"}, "name": "freeradius", "servers": {"server": [{"config": {"name": "radius-server", "timeout": 5, "address": "192.168.11.1"}, "radius": {"config": {"secret-key": "radiuspwd"}}, "address": "192.168.11.1"}]}}]}}}}]}}

I'm guessing I'm doing something wrong. Is this expected? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions