diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 5a89b89870804..60aef0c7945a9 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -1093,7 +1093,8 @@ "Zilla", "Guage", "Plex", - "Vstsrm" + "Vstsrm", + "Localizable" ] }, { diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index d432eef64e54d..29c90ec941385 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -173,7 +173,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package.json b/eng/emitter-package.json index b27de2be432da..5a252caa91297 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,6 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20230720.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20230721.1" } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md index 186fdc44f2b9a..161f5ca59a970 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md @@ -13,6 +13,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true no-property-type-replacement: RegenerateKeyContent diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md index 8e0a4eb34c850..a47ff2c2a0b1a 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md +++ b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md @@ -14,8 +14,9 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true -# mgmt-debug: +# mgmt-debug: # show-serialized-names: true format-by-name-rules: @@ -189,7 +190,7 @@ rename-mapping: AccountKeyType: BatchAccountKeyType BatchAccountRegenerateKeyParameters.keyName: KeyType Certificate.properties.thumbprint: ThumbprintString - CertificateCreateOrUpdateParameters.properties.thumbprint: ThumbprintString + CertificateCreateOrUpdateParameters.properties.thumbprint: ThumbprintString directive: # TODO -- remove this and use rename-mapping when it is supported diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md index 404b36882e398..a3225556b22ba 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/autorest.md @@ -13,6 +13,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true operation-id-mappings: CdnEndpoint: @@ -62,7 +63,7 @@ rename-rules: SHA256: Sha256 EndpointPropertiesUpdateParametersDeliveryPolicy: EndpointDeliveryPolicy -no-property-type-replacement: +no-property-type-replacement: - ContinentsResponseContinentsItem - EndpointPropertiesUpdateParametersDefaultOriginGroup - EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink @@ -90,7 +91,7 @@ rename-mapping: CacheLevel: CdnCacheLevel SslProtocol: DeliveryRuleSslProtocol SslProtocolMatchCondition: DeliveryRuleSslProtocolMatchCondition - + directive: - from: swagger-document where: $.definitions..parameters diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md index e1e8fcf05cfbc..6e5649ce014b7 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md @@ -16,8 +16,9 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true -#mgmt-debug: +#mgmt-debug: # show-serialized-names: true format-by-name-rules: diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/autorest.md b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/autorest.md index 107ed9f9ecdbe..c80ff00f5cde2 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/autorest.md +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true rename-mapping: AzureDataExplorerConnectionProperties.adxResourceId: -|arm-id diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md index 7680c7460ca4a..fe031f742b49f 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/src/autorest.md @@ -3,6 +3,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml +deserialize-null-collection-as-null-value: true batch: - tag: release_2_1 - tag: 2023-02-28-preview diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/autorest.md b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/autorest.md index 596caa114b512..b065eb79b2750 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/autorest.md +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/autorest.md @@ -13,6 +13,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true override-operation-name: Endpoints_PurgeContent: PurgeContent diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/autorest.md b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/autorest.md index 50aa26fd14bdb..b232db130b9d1 100644 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/autorest.md +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true request-path-to-resource-name: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName}: GuestConfigurationVmAssignment diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoCertificate.Serialization.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoCertificate.Serialization.cs index 50d75f96f9a1e..be508deeb4828 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoCertificate.Serialization.cs +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoCertificate.Serialization.cs @@ -176,7 +176,6 @@ internal static FirmwareCryptoCertificate DeserializeFirmwareCryptoCertificate(J { if (property.Value.ValueKind == JsonValueKind.Null) { - usage = null; continue; } List array = new List(); @@ -191,7 +190,6 @@ internal static FirmwareCryptoCertificate DeserializeFirmwareCryptoCertificate(J { if (property.Value.ValueKind == JsonValueKind.Null) { - filePaths = null; continue; } List array = new List(); diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoKey.Serialization.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoKey.Serialization.cs index a56def061500e..9074bb22166b5 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoKey.Serialization.cs +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Models/FirmwareCryptoKey.Serialization.cs @@ -73,7 +73,6 @@ internal static FirmwareCryptoKey DeserializeFirmwareCryptoKey(JsonElement eleme { if (property.Value.ValueKind == JsonValueKind.Null) { - usage = null; continue; } List array = new List(); @@ -88,7 +87,6 @@ internal static FirmwareCryptoKey DeserializeFirmwareCryptoKey(JsonElement eleme { if (property.Value.ValueKind == JsonValueKind.Null) { - filePaths = null; continue; } List array = new List(); diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/autorest.md b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/autorest.md index 80e8021d6de4c..b5ba5ff082221 100644 --- a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/autorest.md +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/autorest.md @@ -13,6 +13,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true format-by-name-rules: 'tenantId': 'uuid' diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index 142daec83327e..50d73bbfa3408 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true format-by-name-rules: 'tenantId': 'uuid' diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md index 18c7938bdd6bb..c248ece8cf8bf 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true format-by-name-rules: "tenantId": "uuid" diff --git a/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/src/Generated/Models/AssetConversionConfiguration.Serialization.cs b/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/src/Generated/Models/AssetConversionConfiguration.Serialization.cs index 0403b117b47e7..a549f9b952073 100644 --- a/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/src/Generated/Models/AssetConversionConfiguration.Serialization.cs +++ b/sdk/objectanchors/Azure.MixedReality.ObjectAnchors.Conversion/src/Generated/Models/AssetConversionConfiguration.Serialization.cs @@ -161,7 +161,6 @@ internal static AssetConversionConfiguration DeserializeAssetConversionConfigura { if (property.Value.ValueKind == JsonValueKind.Null) { - keyFrameIndexes = null; continue; } List array = new List(); diff --git a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs index 7d58cc92635a3..ac45f866f04b0 100644 --- a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs +++ b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs @@ -4,7 +4,7 @@ public static partial class AzureOpenAIModelFactory { public static Azure.AI.OpenAI.ChatChoice ChatChoice(Azure.AI.OpenAI.ChatMessage message = null, int index = 0, Azure.AI.OpenAI.CompletionsFinishReason finishReason = default(Azure.AI.OpenAI.CompletionsFinishReason), Azure.AI.OpenAI.ChatMessage deltaMessage = null, Azure.AI.OpenAI.ContentFilterResults contentFilterResults = null) { throw null; } public static Azure.AI.OpenAI.ChatCompletions ChatCompletions(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable choices = null, System.Collections.Generic.IEnumerable promptFilterResults = null, Azure.AI.OpenAI.CompletionsUsage usage = null) { throw null; } - public static Azure.AI.OpenAI.Choice Choice(string text = null, int index = 0, Azure.AI.OpenAI.ContentFilterResults contentFilterResults = null, Azure.AI.OpenAI.CompletionsLogProbabilityModel logProbabilityModel = null, Azure.AI.OpenAI.CompletionsFinishReason finishReason = default(Azure.AI.OpenAI.CompletionsFinishReason)) { throw null; } + public static Azure.AI.OpenAI.Choice Choice(string text = null, int index = 0, Azure.AI.OpenAI.ContentFilterResults contentFilterResults = null, Azure.AI.OpenAI.CompletionsLogProbabilityModel logProbabilityModel = null, Azure.AI.OpenAI.CompletionsFinishReason? finishReason = default(Azure.AI.OpenAI.CompletionsFinishReason?)) { throw null; } public static Azure.AI.OpenAI.Completions Completions(string id = null, System.DateTimeOffset created = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable promptFilterResults = null, System.Collections.Generic.IEnumerable choices = null, Azure.AI.OpenAI.CompletionsUsage usage = null) { throw null; } public static Azure.AI.OpenAI.CompletionsLogProbabilityModel CompletionsLogProbabilityModel(System.Collections.Generic.IEnumerable tokens = null, System.Collections.Generic.IEnumerable tokenLogProbabilities = null, System.Collections.Generic.IEnumerable> topLogProbabilities = null, System.Collections.Generic.IEnumerable textOffsets = null) { throw null; } public static Azure.AI.OpenAI.CompletionsUsage CompletionsUsage(int completionTokens = 0, int promptTokens = 0, int totalTokens = 0) { throw null; } @@ -25,7 +25,7 @@ public partial class ChatChoice { internal ChatChoice() { } public Azure.AI.OpenAI.ContentFilterResults ContentFilterResults { get { throw null; } } - public Azure.AI.OpenAI.CompletionsFinishReason FinishReason { get { throw null; } } + public Azure.AI.OpenAI.CompletionsFinishReason? FinishReason { get { throw null; } } public int Index { get { throw null; } } public Azure.AI.OpenAI.ChatMessage Message { get { throw null; } } } @@ -88,7 +88,7 @@ public partial class Choice { internal Choice() { } public Azure.AI.OpenAI.ContentFilterResults ContentFilterResults { get { throw null; } } - public Azure.AI.OpenAI.CompletionsFinishReason FinishReason { get { throw null; } } + public Azure.AI.OpenAI.CompletionsFinishReason? FinishReason { get { throw null; } } public int Index { get { throw null; } } public Azure.AI.OpenAI.CompletionsLogProbabilityModel LogProbabilityModel { get { throw null; } } public string Text { get { throw null; } } @@ -315,7 +315,7 @@ internal PromptFilterResult() { } public partial class StreamingChatChoice { internal StreamingChatChoice() { } - public Azure.AI.OpenAI.CompletionsFinishReason FinishReason { get { throw null; } } + public Azure.AI.OpenAI.CompletionsFinishReason? FinishReason { get { throw null; } } public int? Index { get { throw null; } } public System.Collections.Generic.IAsyncEnumerable GetMessageStreaming([System.Runtime.CompilerServices.EnumeratorCancellationAttribute] System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -331,7 +331,7 @@ protected virtual void Dispose(bool disposing) { } public partial class StreamingChoice { internal StreamingChoice() { } - public Azure.AI.OpenAI.CompletionsFinishReason FinishReason { get { throw null; } } + public Azure.AI.OpenAI.CompletionsFinishReason? FinishReason { get { throw null; } } public int? Index { get { throw null; } } public Azure.AI.OpenAI.CompletionsLogProbabilityModel LogProbabilityModel { get { throw null; } } public System.Collections.Generic.IAsyncEnumerable GetTextStreaming([System.Runtime.CompilerServices.EnumeratorCancellationAttribute] System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChatChoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChatChoice.cs index 14f8b08a9a795..4589240dc15c0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChatChoice.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChatChoice.cs @@ -33,7 +33,7 @@ public class StreamingChatChoice /// Normal termination typically provides "stop" and encountering token limits in a request typically /// provides "length." If no value is present, this StreamingChoice is still in progress. /// - public CompletionsFinishReason FinishReason => GetLocked(() => _baseChoices.Last().FinishReason); + public CompletionsFinishReason? FinishReason => GetLocked(() => _baseChoices.Last().FinishReason); internal ChatMessage StreamingDeltaMessage { get; set; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChoice.cs index f2147d84896f0..8ff10bffdf3ea 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChoice.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/StreamingChoice.cs @@ -33,7 +33,7 @@ public class StreamingChoice /// Normal termination typically provides "stop" and encountering token limits in a request typically /// provides "length." If no value is present, this StreamingChoice is still in progress. /// - public CompletionsFinishReason FinishReason => GetLocked(() => _baseChoices.Last().FinishReason); + public CompletionsFinishReason? FinishReason => GetLocked(() => _baseChoices.Last().FinishReason); internal bool StreamingDoneSignalReceived { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs index fb7a5a186424d..8f507b54d557a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIModelFactory.cs @@ -131,7 +131,7 @@ public static ContentFilterResult ContentFilterResult(ContentFilterSeverity seve /// The log probabilities model for tokens associated with this completions choice. /// Reason for finishing. /// A new instance for mocking. - public static Choice Choice(string text = null, int index = default, ContentFilterResults contentFilterResults = null, CompletionsLogProbabilityModel logProbabilityModel = null, CompletionsFinishReason finishReason = default) + public static Choice Choice(string text = null, int index = default, ContentFilterResults contentFilterResults = null, CompletionsLogProbabilityModel logProbabilityModel = null, CompletionsFinishReason? finishReason = null) { return new Choice(text, index, contentFilterResults, logProbabilityModel, finishReason); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs index 3bff6ea2e0a41..2067cdd79c892 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.Serialization.cs @@ -21,7 +21,7 @@ internal static ChatChoice DeserializeChatChoice(JsonElement element) } Optional message = default; int index = default; - CompletionsFinishReason finishReason = default; + CompletionsFinishReason? finishReason = default; Optional delta = default; Optional contentFilterResults = default; foreach (var property in element.EnumerateObject()) @@ -42,6 +42,11 @@ internal static ChatChoice DeserializeChatChoice(JsonElement element) } if (property.NameEquals("finish_reason"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + finishReason = null; + continue; + } finishReason = new CompletionsFinishReason(property.Value.GetString()); continue; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs index ea0c7072f3499..2c8aa8d5a3aec 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatChoice.cs @@ -17,7 +17,7 @@ public partial class ChatChoice /// Initializes a new instance of ChatChoice. /// The ordered index associated with this chat completions choice. /// The reason that this chat completions choice completed its generated. - internal ChatChoice(int index, CompletionsFinishReason finishReason) + internal ChatChoice(int index, CompletionsFinishReason? finishReason) { Index = index; FinishReason = finishReason; @@ -33,7 +33,7 @@ internal ChatChoice(int index, CompletionsFinishReason finishReason) /// has been detected, as well as the severity level (very_low, low, medium, high-scale that /// determines the intensity and risk level of harmful content) and if it has been filtered or not. /// - internal ChatChoice(ChatMessage message, int index, CompletionsFinishReason finishReason, ChatMessage internalStreamingDeltaMessage, ContentFilterResults contentFilterResults) + internal ChatChoice(ChatMessage message, int index, CompletionsFinishReason? finishReason, ChatMessage internalStreamingDeltaMessage, ContentFilterResults contentFilterResults) { Message = message; Index = index; @@ -47,7 +47,7 @@ internal ChatChoice(ChatMessage message, int index, CompletionsFinishReason fini /// The ordered index associated with this chat completions choice. public int Index { get; } /// The reason that this chat completions choice completed its generated. - public CompletionsFinishReason FinishReason { get; } + public CompletionsFinishReason? FinishReason { get; } /// /// Information about the content filtering category (hate, sexual, violence, self_harm), if it /// has been detected, as well as the severity level (very_low, low, medium, high-scale that diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs index bc6a804356e6e..1c2c49ab62dda 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.Serialization.cs @@ -23,7 +23,7 @@ internal static Choice DeserializeChoice(JsonElement element) int index = default; Optional contentFilterResults = default; CompletionsLogProbabilityModel logprobs = default; - CompletionsFinishReason finishReason = default; + CompletionsFinishReason? finishReason = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("text"u8)) @@ -47,11 +47,21 @@ internal static Choice DeserializeChoice(JsonElement element) } if (property.NameEquals("logprobs"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + logprobs = null; + continue; + } logprobs = CompletionsLogProbabilityModel.DeserializeCompletionsLogProbabilityModel(property.Value); continue; } if (property.NameEquals("finish_reason"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + finishReason = null; + continue; + } finishReason = new CompletionsFinishReason(property.Value.GetString()); continue; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs index 24423df14b84d..8dfb40a0ffab1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Choice.cs @@ -17,6 +17,22 @@ namespace Azure.AI.OpenAI /// public partial class Choice { + /// Initializes a new instance of Choice. + /// The generated text for a given completions prompt. + /// The ordered index associated with this completions choice. + /// The log probabilities model for tokens associated with this completions choice. + /// Reason for finishing. + /// is null. + internal Choice(string text, int index, CompletionsLogProbabilityModel logProbabilityModel, CompletionsFinishReason? finishReason) + { + Argument.AssertNotNull(text, nameof(text)); + + Text = text; + Index = index; + LogProbabilityModel = logProbabilityModel; + FinishReason = finishReason; + } + /// Initializes a new instance of Choice. /// The generated text for a given completions prompt. /// The ordered index associated with this completions choice. @@ -27,7 +43,7 @@ public partial class Choice /// /// The log probabilities model for tokens associated with this completions choice. /// Reason for finishing. - internal Choice(string text, int index, ContentFilterResults contentFilterResults, CompletionsLogProbabilityModel logProbabilityModel, CompletionsFinishReason finishReason) + internal Choice(string text, int index, ContentFilterResults contentFilterResults, CompletionsLogProbabilityModel logProbabilityModel, CompletionsFinishReason? finishReason) { Text = text; Index = index; @@ -49,6 +65,6 @@ internal Choice(string text, int index, ContentFilterResults contentFilterResult /// The log probabilities model for tokens associated with this completions choice. public CompletionsLogProbabilityModel LogProbabilityModel { get; } /// Reason for finishing. - public CompletionsFinishReason FinishReason { get; } + public CompletionsFinishReason? FinishReason { get; } } } diff --git a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs index 1fe9a2e495762..35c8b15641ad3 100644 --- a/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs +++ b/sdk/quantum/Azure.Quantum.Jobs/src/Generated/Models/JobDetails.Serialization.cs @@ -168,7 +168,6 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - metadata = null; continue; } Dictionary dictionary = new Dictionary(); @@ -261,7 +260,6 @@ internal static JobDetails DeserializeJobDetails(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - tags = null; continue; } List array = new List(); diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md b/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md index 76784d82b4f05..f1ad6dbeb4bf5 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/autorest.md @@ -13,6 +13,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true format-by-name-rules: 'tenantId': 'uuid' diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md index 27aecc90be874..eef411cd53dc5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md +++ b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md @@ -12,6 +12,7 @@ public-clients: false head-as-boolean: false modelerfour: lenient-model-deduplication: true +deserialize-null-collection-as-null-value: true # mgmt-debug: # show-serialized-names: true diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/autorest.md b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/autorest.md index af01be789d3fe..75fb8cbd9bd61 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/autorest.md +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true rename-mapping: AffectedMoveResource.id: -|arm-id diff --git a/sdk/search/Azure.Search.Documents/src/autorest.md b/sdk/search/Azure.Search.Documents/src/autorest.md index 9be5aefef42e4..32ab07ea21d03 100644 --- a/sdk/search/Azure.Search.Documents/src/autorest.md +++ b/sdk/search/Azure.Search.Documents/src/autorest.md @@ -14,6 +14,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/0cfd102a6ecb172f04ec915732bd8ca6f6b2a7af/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchindex.json - https://github.com/Azure/azure-rest-api-specs/blob/0cfd102a6ecb172f04ec915732bd8ca6f6b2a7af/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchservice.json generation1-convenience-client: true +deserialize-null-collection-as-null-value: true ``` ## Release hacks @@ -418,4 +419,4 @@ directive: $["x-ms-enum"] = { "modelAsString": false } -``` \ No newline at end of file +``` diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs index 6903ab8faace5..125a178cc1832 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs @@ -25,7 +25,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteNull("query"); } - if (QuerySubscriptions != null) + if (QuerySubscriptions != null && Optional.IsCollectionDefined(QuerySubscriptions)) { writer.WritePropertyName("querySubscriptions"u8); writer.WriteStartArray(); diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md index 32cecdda488fa..9a9f41b46b4a0 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md @@ -15,6 +15,7 @@ tag: package-dotnet-sdk skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true keep-orphaned-models: - ExternalSecuritySolutionKind diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md index d0897d96d1cb3..631b576463c5b 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/autorest.md @@ -14,6 +14,7 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true rename-mapping: TargetServiceBase: TargetServiceBaseInfo diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/SparkBatchJob.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/SparkBatchJob.Serialization.cs index fb66c9e221866..3e08b8a128366 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/SparkBatchJob.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/SparkBatchJob.Serialization.cs @@ -164,7 +164,6 @@ internal static SparkBatchJob DeserializeSparkBatchJob(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - appInfo = null; continue; } Dictionary dictionary = new Dictionary(); @@ -188,7 +187,6 @@ internal static SparkBatchJob DeserializeSparkBatchJob(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - log = null; continue; } List array = new List(); diff --git a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJob.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJob.Serialization.cs index 0e2ce71e77930..dbb7744cd80a2 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJob.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJob.Serialization.cs @@ -95,7 +95,6 @@ internal static SparkJob DeserializeSparkJob(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - pipeline = null; continue; } List array = new List(); diff --git a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJobListViewResponse.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJobListViewResponse.Serialization.cs index 8bbb5bf9809c6..525d192bafe7c 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJobListViewResponse.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Monitoring/src/Generated/Models/SparkJobListViewResponse.Serialization.cs @@ -36,7 +36,6 @@ internal static SparkJobListViewResponse DeserializeSparkJobListViewResponse(Jso { if (property.Value.ValueKind == JsonValueKind.Null) { - sparkJobs = null; continue; } List array = new List(); diff --git a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkBatchJob.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkBatchJob.Serialization.cs index fac3df006bd10..111e8b830c506 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkBatchJob.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkBatchJob.Serialization.cs @@ -161,7 +161,6 @@ internal static SparkBatchJob DeserializeSparkBatchJob(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - appInfo = null; continue; } Dictionary dictionary = new Dictionary(); @@ -185,7 +184,6 @@ internal static SparkBatchJob DeserializeSparkBatchJob(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - log = null; continue; } List array = new List(); diff --git a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkSession.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkSession.Serialization.cs index 2fa1f5d6a9835..6d04340345ffb 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkSession.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkSession.Serialization.cs @@ -161,7 +161,6 @@ internal static SparkSession DeserializeSparkSession(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - appInfo = null; continue; } Dictionary dictionary = new Dictionary(); @@ -185,7 +184,6 @@ internal static SparkSession DeserializeSparkSession(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - log = null; continue; } List array = new List(); diff --git a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkStatementOutput.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkStatementOutput.Serialization.cs index 42effe4e1b32a..6ce56306bee97 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkStatementOutput.Serialization.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Spark/src/Generated/Models/SparkStatementOutput.Serialization.cs @@ -70,7 +70,6 @@ internal static SparkStatementOutput DeserializeSparkStatementOutput(JsonElement { if (property.Value.ValueKind == JsonValueKind.Null) { - traceback = null; continue; } List array = new List(); diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index 3c644cf772a6c..4e722c0804b16 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -16,8 +16,9 @@ clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false +deserialize-null-collection-as-null-value: true -# mgmt-debug: +# mgmt-debug: # show-serialized-names: true list-exception: @@ -547,7 +548,7 @@ rename-mapping: WebJobCollection: WebJobCListResult WorkerPoolCollection: AppServiceWorkerPoolListResult HybridConnection.properties.relayArmUri: relayArmId|arm-id - AzureActiveDirectoryRegistration.clientSecretCertificateThumbprint: ClientSecretCertificateThumbprintString + AzureActiveDirectoryRegistration.clientSecretCertificateThumbprint: ClientSecretCertificateThumbprintString Certificate.properties.thumbprint: ThumbprintString CertificateDetails.thumbprint: ThumbprintString CertificatePatchResource.properties.thumbprint: ThumbprintString