sailpoint-oss / powershell-sdk

PowerShell Module for accessing SailPoint IdentityNow APIs
https://developer.sailpoint.com/
MIT License
21 stars 15 forks source link

Cannot bind argument to parameter 'ContentTypes' because it is null #47

Closed yannick-beot-sp closed 1 year ago

yannick-beot-sp commented 1 year ago

When using New-AccessRequest, the following error is thrown:

Line |
 113 |          $LocalVarResult = Invoke-ApiClient -Method 'GET' `
     |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'ContentTypes' because it is null.

The endpoint v3/access-requests is actually not sending any content type, hence the error when using DeserializeResponse within Invoke-ApiClient.

Also, DeserializeResponse is defined multiple times within the module.

tyler-mairose-sp commented 1 year ago

Hey @yannick-beot-sp,

Thank you for brining this to our attention, I see you made a PR to update this. With how our SDKs are generated we need to update the mustache files to add the allowNull() flag to the ContentTypes parameter in DeserializeResponse so that it is updated in all files. I do see your point that DeserializeResponse is defined multiple times due to how we split the SDK up into v3/beta/v2/cc, there can probably be some refactoring so that we only define it once. For now, the ContentType issue is fixed in https://github.com/sailpoint-oss/powershell-sdk/commit/a0778f81b6ba819a9078806aa79bb740d71f04a5