Project

General

Profile

Actions

Bug #6758

open

API (v2) Attempting to access Parameters on *object*_id when no Params exist

Added by Derek Wright almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Using API v2 to be able to iterate all my objects that can have parameters set to store them in source control, however I ran into an issue where the server spits out a 500 error if the object doesnt have any parameters defined, example:

Org ESXi has no params set at the organization level

GET api/v2/organizations/:id returns:
snip

"parameters": [],

GET api/v2/organizations/:id/parameters returns:

{
"error": {
"message": "undefined method `paginate' for {}:Hash" 
}
}

I guess i could work around this with logic, however it appears that something is returning just a hash instead of an empty hash nested in an array that can have the paginate method called.

No data to display

Actions

Also available in: Atom PDF