Posted on 03-22-2016 07:04 PM
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?
Posted on 11-11-2016 10:59 AM
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.
Posted on 11-15-2016 07:52 AM
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!