We automate a lot of our CD pipeline through your APIs. Recently, we were making changes to the automation we have that creates a release. This has worked in the past, but is now failing. We have been over the json over and over and cannot see what the issue is.
failed: [win-octopus-release-test.case-2] => {“content”: “{\r\n “ErrorMessage”: “Error converting value \”[{‘StepName’: ‘SpaceAcademy’, ‘Version’: ‘1.0.0.166’}]\” to type ‘System.Collections.Generic.List1[Octopus.Client.Model.SelectedPackage]'. Path 'SelectedPackages', line 4, position 75.\"\r\n}", "content_type": "application/json; charset=utf-8", "date": "Wed, 18 May 2016 20:52:09 GMT", "failed": true, "json": {"ErrorMessage": "Error converting value \"[{'StepName': 'SpaceAcademy', 'Version': '1.0.0.166'}]\" to type 'System.Collections.Generic.List1[Octopus.Client.Model.SelectedPackage]’. Path ‘SelectedPackages’, line 4, position 75."}, “redirected”: false, “server”: “Microsoft-HTTPAPI/2.0”, “status”: 500, “transfer_encoding”: “chunked”}
msg: Status code was not [201]
Thanks for reaching out. We’d need to see the JSON body you were previously sending on the API POST (when it was working) and the current one to see what’s going on.
Seems like you are trying to pass a hardcoded value for a nuget package in a step, but that’s blowing up somewhere.
Yup that should be it - If between double quotes JSON will interpret it as a string, instead of an array (between square brackets) which is what the API is expecting.