Both endpoints are returning me voicevlan 1031 which is not present in the actual config :
But when looking at the ''access'' tab , I can see the ''other'' config :
I'm pretty sure there is a reason for that , something like you can have ''both'' configs ''ready'' in the dashboard so the API returns them.
If the switchport is in trunk mode , just display the trunk values , not the access values. I don't want to go over 3K switchports to remove the values in the access tab for the API to return the correct data.
Thanks for the feedback. One can see this going either way. Switching data layouts is generally suboptimal when it comes to APIs--better to have a more consistent, predictable set of values returned, rather than having to document conditionally hidden parameters and all the conditions as to why they are hidden (trust me, that's a nightmare).
As for voice VLAN -- this value doesn't really make sense for trunk ports. So yes, the value's configured, but you don't really have to worry about it because it has no effect on the configuration. I think it's fair to expect some understanding that voice VLAN applies to access ports and not trunk ports--that's a lot simpler than figuring out conditionally showing/hiding fields.