You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Autorest.powershell will treat {} as null object. And do not send {} to backend.
Beside, we are suspecting service side may report {} is invalid value if we pass {} for some other parameters (from other RPs). We are unable to predict what will be caused if we distinguish {} with null and send {} to backend. We are investigating whether we need a flag from swagger to let us know this parameter whether distinguish ‘{}’ and null.
The text was updated successfully, but these errors were encountered:
BethanyZhou
changed the title
Add support to distinguish null and {} object
[feature request] Add support to distinguish null and {} object
Mar 18, 2022
We will generate a parameter as below in the cmdlet.
xxx-cmdlet [-Tag <Hashtable>]
Right now, no matter if the user calls xxx-cmdlet or xxx-cmdlet -Tag @{}, we will not send tags to services.
And the requirement here is we should send {} for the latter.
Let's use tags here example.
We may support it through custom code as below.
namespace Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20180401
{
/// <summary>The resource model definition for a ARM tracked top level resource</summary>
public partial class TrackedResource
{
partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.Json.JsonObject container) {
if (this._tag != null && this._tag.Count == 0) {
container.Add("tags", new Microsoft.Azure.PowerShell.Cmdlets.Databricks.Runtime.Json.JsonObject());
}
}
}
}
Reported by Azure/azure-powershell#17410
Autorest.powershell will treat {} as null object. And do not send {} to backend.
Beside, we are suspecting service side may report {} is invalid value if we pass {} for some other parameters (from other RPs). We are unable to predict what will be caused if we distinguish {} with null and send {} to backend. We are investigating whether we need a flag from swagger to let us know this parameter whether distinguish ‘{}’ and null.
The text was updated successfully, but these errors were encountered: