-
Notifications
You must be signed in to change notification settings - Fork 19
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
getOrganizationDevicesStatuses response of wrong type #50
Comments
Hi @stephengroat please mention the specific part of the OAS if you believe there is an issue with the spec so we can investigate. What you've provided so far does not point directly to any section of our OAS. |
as seen in the error message
|
👋 wondering if anymore information is needed to triage |
I ran into this issue as well. It seems the API returns an object array instead of a string array. Example: {
"powerSupplies": [
{
"slot": 1,
"serial": "XXXX-XXXX-XXXX",
"model": "PWR-MS320-1025WAC",
"status": "powering",
"poe": {
"unit": "watts",
"maximum": 740
}
},
{
"slot": 2,
"serial": "",
"model": "",
"status": "disconnected",
"poe": {
"unit": "watts",
"maximum": 0
}
}
]
} Until the spec can be corrected, the following can be applied to address meraki/dashboard-api-go#18: diff --git a/client/model_get_organization_devices_statuses_200_response_inner_components.go b/client/model_get_organization_devices_statuses_200_response_inner_components.go
index cae93d96..c38caf6b 100644
--- a/client/model_get_organization_devices_statuses_200_response_inner_components.go
+++ b/client/model_get_organization_devices_statuses_200_response_inner_components.go
@@ -17,10 +17,23 @@ import (
// checks if the GetOrganizationDevicesStatuses200ResponseInnerComponents type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GetOrganizationDevicesStatuses200ResponseInnerComponents{}
+type Poe struct {
+ Unit string `json:"unit"`
+ Maximum int `json:"maximum"`
+}
+
+type PowerSupply struct {
+ Slot int `json:"slot"`
+ Serial string `json:"serial"`
+ Model string `json:"model"`
+ Status string `json:"status"`
+ Poe Poe `json:"poe"`
+}
+
// GetOrganizationDevicesStatuses200ResponseInnerComponents Components
type GetOrganizationDevicesStatuses200ResponseInnerComponents struct {
// Power Supplies
- PowerSupplies []string `json:"powerSupplies,omitempty"`
+ PowerSupplies []PowerSupply `json:"powerSupplies,omitempty"`
}
// NewGetOrganizationDevicesStatuses200ResponseInnerComponents instantiates a new GetOrganizationDevicesStatuses200ResponseInnerComponents object
@@ -41,9 +54,9 @@ func NewGetOrganizationDevicesStatuses200ResponseInnerComponentsWithDefaults() *
}
// GetPowerSupplies returns the PowerSupplies field value if set, zero value otherwise.
-func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) GetPowerSupplies() []string {
+func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) GetPowerSupplies() []PowerSupply {
if o == nil || IsNil(o.PowerSupplies) {
- var ret []string
+ var ret []PowerSupply
return ret
}
return o.PowerSupplies
@@ -51,7 +64,7 @@ func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) GetPowerSuppl
// GetPowerSuppliesOk returns a tuple with the PowerSupplies field value if set, nil otherwise
// and a boolean to check if the value has been set.
-func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) GetPowerSuppliesOk() ([]string, bool) {
+func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) GetPowerSuppliesOk() ([]PowerSupply, bool) {
if o == nil || IsNil(o.PowerSupplies) {
return nil, false
}
@@ -68,7 +81,7 @@ func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) HasPowerSuppl
}
// SetPowerSupplies gets a reference to the given []string and assigns it to the PowerSupplies field.
-func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) SetPowerSupplies(v []string) {
+func (o *GetOrganizationDevicesStatuses200ResponseInnerComponents) SetPowerSupplies(v []PowerSupply) {
o.PowerSupplies = v
} |
Hello @stephengroat, @stephengroat-dd and @jyoung15: Do you have this issue if you use instead the following endpoints for the same information? FWIW the getOrganizationDevicesStatuses endpoint has better alternatives: If you are only concerned with right-now status of devices: getOrganizationDevicesAvailabilities I'm not aware of any schema issues on the aforementioned endpoints. |
Sorry, this is the only endpoint that works for my use case. Is there going to be any fix upcoming for this bug? |
Hi @stephengroat, what's the use case? |
@TKIPisalegacycipher We collect every IP that meraki records on every device for historical evidence |
Thanks @stephengroat-dd! This operation is the best way to get that information: getOrganizationDevicesUplinksAddressesByDevice |
Error on GetOrganizationDevicesStatuses unmarshal in OrganizationApi
currently marked as array of string in spec
see meraki/dashboard-api-go#18
The text was updated successfully, but these errors were encountered: