JSS API Bug? JSON Storage->Device->Partition

d_wilkins
New Contributor II

I am currently playing around with creating a Cocoa app to do some admin tasks. Part of the design is to download a computer record from the API and turn them into Swift Objects. I have found that there have been a few instances where the XML is different to the JSON. One in particular is the partition information is not an array in JSON output whereas it is in the XML output.

For example if you look at http://yourJSS:8443/api and go to /computers/id/{id} and "try out" an id with multiple partitions on the disk. Then look at the XML info for Hardware->Storage->Device->Partition its an array. Now look at the same in the JSON code and it will only display the info for the last partition.

If this is a bug, how do I report it?

2 REPLIES 2

alraymon
New Contributor

I'm seeing this same thing. If I look at a device via the api in a web browser, I see all the partitions. If I make the call to the API via a script (PowerShell, in my case), I'm only seeing a single partition.

alraymon
New Contributor

Just in case anyone else finds this, that is in fact a bug in the json. Jamf support said it is PI-002662. The solution is to have the api return xml. You can make this happen by forcing a header. Here's what it looks like in powershell.

Invoke-RestMethod -uri "https://casperSite/JSSResource/computers/id/$id" -Credential $creds -Headers @{"Accept"="application/xml"}

Good luck!