Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices.GetDeviceClients fails unmarshalling VLAN field #36

Open
3 tasks done
stephengroat opened this issue Jul 9, 2024 · 0 comments
Open
3 tasks done

Devices.GetDeviceClients fails unmarshalling VLAN field #36

stephengroat opened this issue Jul 9, 2024 · 0 comments

Comments

@stephengroat
Copy link

stephengroat commented Jul 9, 2024

Prerequisites

  • Have you tested the operation in the API directly?
  • Do you have the latest SDK version?
  • Review compability matrix

Describe the bug
the Devices.GetDeviceClients call fails where there is a number in the vlan field. it seems like both numbers and strings can be in this field, while the struct is only set for a string

Expected behavior
the call not to fail

Screenshots

2024/07/09 02:41:48 json: cannot unmarshal number into Go struct field ResponseItemDevicesGetDeviceClients.vlan of type string
==============================================================================
~~~ REQUEST ~~~
GET  /api/v1/devices/****-****-****/clients?timespan=1800  HTTP/1.1
HOST   : api.meraki.com
HEADERS:
	Accept: application/json
	Authorization: Bearer ********
	Content-Type: application/json
	User-Agent: go-meraki/1.44.1 **** ****
BODY   :
***** NO CONTENT *****
------------------------------------------------------------------------------
~~~ RESPONSE ~~~
STATUS       : 200 OK
PROTO        : HTTP/2.0
RECEIVED AT  : 2024-07-09T04:10:42.316012Z
TIME DURATION: 524.955792ms
HEADERS      :
	Cache-Control: no-cache, no-store, max-age=0, must-revalidate
	Content-Type: application/json; charset=utf-8
	Date: Tue, 09 Jul 2024 04:10:42 GMT
	Expires: Fri, 01 Jan 1990 00:00:00 GMT
	Pragma: no-cache
	Strict-Transport-Security: max-age=31536000; includeSubDomains
	Vary: Accept-Encoding
	X-Content-Type-Options: nosniff
	X-Frame-Options: sameorigin
	X-Request-Id: ****
	X-Robots-Tag: none
	X-Runtime: 0.286172
	X-Xss-Protection: 1; mode=block, 1; mode=block
BODY         :
[
   {
      "id": "****",
....
      "vlan": 4,
   },
   {
      "id": "****",
...
      "vlan": 4,
   }
]

Environment (please complete the following information):

  • Cisco DNA Center Version and patch:
  • Go Version: 1.22
  • SDK version: 3.04
  • OS Version: Linux

Additional context
Add any other context about the problem here.

@stephengroat stephengroat changed the title Devices.GetDeviceClients fails Devices.GetDeviceClients fails unmarshalling VLAN field Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant