CrayonGroup / CloudiQ.PowerShell

A PowerShell module for managing Cloud-iQ, to help automate licensing and reporting.
https://crayongroup.github.io/CloudiQ.PowerShell/
GNU General Public License v3.0
4 stars 0 forks source link

Set-CloudiQSubscription: Error 400 bad request #24

Closed bjowol closed 3 years ago

bjowol commented 3 years ago

using powershell 7.0 i get an error trying to increase the amount of quantities of a subscription. Ive got my own module for this api and originally got the error there. to make sure i did not do anything wrong with my code i tested this, same error. i got a ticket open with your api support but wanted to try my luck here as well.

image

going to test ps 5.1 now for fun.

bjowol commented 3 years ago

Looks like i got it figured out. the JSON payload was converted from a JSON object where the Quantity was typed as a Double, not as an INT. this caused the JSON to contain the wrong Quantity value format. It was “6.0”, ant not “6”…. Powershell helps you out a bit too much sometimes.

a prime example where powershell not beeing stronly typed can mess things up.

roberthstrand commented 3 years ago

Thank you so much for reporting, and figuring out, this bug. My tests haven't showed this behavior but while the input parameter is strongly typed to INT, the variable that is used to set the quantity before is not. I will update this to make sure that we're dealing with integer.

Again, good catch 👍