From 6fa6ca406c66ef20ae910566d0fdc87e4edc7d06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 18:02:41 +0000 Subject: [PATCH 01/47] Initial plan From 79a59cba16ff3680e19eda75a4900627c6985d8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 18:24:03 +0000 Subject: [PATCH 02/47] fix(http-client-csharp): deserialize primitive responses without reflection Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 39 +++++++++-- .../ClientProviders/ClientProviderTests.cs | 28 ++------ ...ity_BothMethodsParamOrderChanged(Async).cs | 7 ++ ...lity_BothMethodsParamOrderChanged(Sync).cs | 7 ++ ...nvenienceMethodParamOrderChanged(Async).cs | 7 ++ ...onvenienceMethodParamOrderChanged(Sync).cs | 7 ++ ...ltipleNewOptionalNonBodyParametersAdded.cs | 9 ++- ...dyParameterDoesNotAddBackCompatOverload.cs | 9 ++- ...bility_NewOptionalNonBodyParameterAdded.cs | 9 ++- ...ionalNonBodyParameterAddedWithModelBody.cs | 10 ++- ...rameterAddedWithPathAndHeaderParameters.cs | 10 ++- ...ty_NewOptionalParameterWithReservedName.cs | 9 ++- ...edParameterDoesNotAddBackCompatOverload.cs | 9 ++- .../ScmMethodProviderCollectionTests.cs | 68 +++++++++++++++++-- ...numReturnTypeMethods(False,False,False).cs | 4 ++ ...EnumReturnTypeMethods(False,False,True).cs | 4 ++ ...EnumReturnTypeMethods(False,True,False).cs | 4 ++ ...EnumReturnTypeMethods(True,False,False).cs | 4 ++ .../EnumReturnTypeMethods(True,True,False).cs | 4 ++ .../EnumReturnTypeMethods(True,True,True).cs | 4 ++ .../PlainTextReturnTypeMethods.cs | 2 + .../ScalarReturnTypeMethods(Boolean).cs | 4 +- ...calarReturnTypeMethods(BooleanNullable).cs | 4 ++ ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +- .../ScalarReturnTypeMethods(Decimal).cs | 4 ++ .../ScalarReturnTypeMethods(Double).cs | 4 +- .../ScalarReturnTypeMethods(Int32).cs | 4 +- .../ScalarReturnTypeMethods(Int32Async).cs | 4 ++ .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 ++ ...arReturnTypeMethods(Int32NullableAsync).cs | 4 ++ .../ScalarReturnTypeMethods(Int64).cs | 4 +- .../ScalarReturnTypeMethods(Single).cs | 4 +- .../ScalarReturnTypeMethods(String).cs | 4 +- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 ++ .../src/Generated/SampleTypeSpecClient.cs | 9 ++- 36 files changed, 259 insertions(+), 60 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index fb0bb6e6025..34790e14f2c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -634,6 +634,21 @@ private IEnumerable GetStackVariablesForReturnValueConversi out declarations); } + if (IsConvertibleFromBinaryData(responseBodyType) + && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) + && !responseBodyType.Equals(typeof(BinaryData)) + && !IsPlainTextResponse(responseBodyType)) + { + var statements = new MethodBodyStatement[] + { + Declare("data", result.GetRawResponse().Content(), out var data), + UsingDeclare("document", data.Parse(), out var document) + }; + declarations["data"] = data; + declarations["document"] = document; + return statements; + } + return []; } @@ -855,21 +870,31 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon { return declarations["value"].CastTo(new CSharpType(responseBodyType.OutputType.FrameworkType, responseBodyType.Arguments[0], responseBodyType.Arguments[1])); } - if (responseBodyType.Equals(typeof(string)) && ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain"))) + if (IsPlainTextResponse(responseBodyType)) { return response.Content().InvokeToString(); } - if (responseBodyType.IsFrameworkType) - { - return response.Content().ToObjectFromJson(responseBodyType); - } - if (responseBodyType.IsEnum) + if (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) { - return responseBodyType.ToEnum(response.Content().ToObjectFromJson(responseBodyType.UnderlyingEnumType)); + var element = declarations["document"].As().RootElement(); + var value = ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( + responseBodyType.WithNullable(false), + element, + declarations["data"].As(), + ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.WireOptionsField.As(), + responseBodyType.Equals(typeof(TimeSpan)) || responseBodyType.Equals(typeof(TimeSpan?)) + ? SerializationFormat.Duration_Constant + : SerializationFormat.Default); + return responseBodyType.IsNullable + ? new TernaryConditionalExpression(element.ValueKindEqualsNull(), Null.CastTo(responseBodyType), value) + : value; } return result.CastTo(responseBodyType); } + private bool IsPlainTextResponse(CSharpType responseBodyType) + => responseBodyType.Equals(typeof(string)) && ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain")); + private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) { if (!type.IsFrameworkType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs index 69d952fd84f..0145d57568a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs @@ -3050,12 +3050,7 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() Assert.IsNotNull(body); var result = body!.ToDisplayString(); - Assert.AreEqual( - "global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1));\n\n" + - "using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1));\n" + - "global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions());\n" + - "return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse());\n", - result); + Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), result); var asyncConvenienceMethod = convenienceMethods .FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); @@ -3065,12 +3060,7 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() Assert.IsNotNull(body); result = body!.ToDisplayString(); - Assert.AreEqual( - "global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1));\n\n" + - "using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1));\n" + - "global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false);\n" + - "return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse());\n", - result); + Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), result); } [Test] @@ -3147,12 +3137,7 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() Assert.IsNotNull(body); var result = body!.ToDisplayString(); - Assert.AreEqual( - "global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1));\n\n" + - "using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1));\n" + - "global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions());\n" + - "return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse());\n", - result); + Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), result); var asyncConvenienceMethod = convenienceMethods .FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); @@ -3162,12 +3147,7 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() Assert.IsNotNull(body); result = body!.ToDisplayString(); - Assert.AreEqual( - "global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1));\n\n" + - "using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1));\n" + - "global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false);\n" + - "return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse());\n", - result); + Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), result); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs new file mode 100644 index 00000000000..47c24d19bea --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -0,0 +1,7 @@ +global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); + +using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); +global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs new file mode 100644 index 00000000000..4f08f0724f1 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -0,0 +1,7 @@ +global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); + +using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); +global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs new file mode 100644 index 00000000000..4667dec956b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -0,0 +1,7 @@ +global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); + +using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); +global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs new file mode 100644 index 00000000000..3792fa19dcd --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -0,0 +1,7 @@ +global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); + +using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); +global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index ecd8a142b0c..4b4aad7c3cd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -35,7 +36,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string param2, bool? param3 = default, string param4 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -44,7 +47,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index bc72ecb5894..78a58777566 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -28,14 +29,18 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param2, string param1 = default, global::System.Threading.CancellationToken cancellationToken = default) { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index dec0cb1513e..5de1339c64e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -35,7 +36,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string param2, bool? param3 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -44,7 +47,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index c1f11b6273c..732ac769151 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -2,9 +2,11 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Sample.Models; @@ -34,7 +36,9 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, global::Sample.Models.SampleModel body, bool? param3 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -42,7 +46,9 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index f97dddf4f4a..3b98a1bf806 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -2,9 +2,11 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,7 +38,9 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(string itemId, int filter, string region, string sort = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -45,7 +49,9 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index ffa25774611..a000b37200e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -35,7 +36,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string content, string @select = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -44,7 +47,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index df446a2081b..633639a6700 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -34,7 +35,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param2, bool param3, string param1, global::System.Threading.CancellationToken cancellationToken = default) @@ -43,7 +46,9 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 6aadbf6d2f5..ce7639dbf6a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -909,7 +909,7 @@ public void ListMethodWithEnumParameter(bool isExtensible, InputRequestLocation convenienceMethod.BodyStatements!.ToDisplayString()); } } - #pragma warning restore SCME0005 +#pragma warning restore SCME0005 } // Enum bodies must be serialized via Utf8JsonWriter (not BinaryData.FromObjectAsJson) to stay AOT/trim safe (IL2026/IL3050). @@ -1559,21 +1559,29 @@ public void ListMethodIsRenamedToGet() } [TestCase(typeof(int))] + [TestCase(typeof(int), true)] + [TestCase(typeof(int?))] + [TestCase(typeof(int?), true)] [TestCase(typeof(long))] [TestCase(typeof(float))] [TestCase(typeof(double))] + [TestCase(typeof(decimal))] [TestCase(typeof(bool))] + [TestCase(typeof(bool?))] [TestCase(typeof(string))] [TestCase(typeof(Uri))] [TestCase(typeof(BinaryData))] [TestCase(typeof(DateTimeOffset))] [TestCase(typeof(TimeSpan))] - public void ScalarReturnTypeMethods(Type type) + [TestCase(typeof(TimeSpan?))] + public void ScalarReturnTypeMethods(Type type, bool isAsync = false) { - InputType? inputType = type switch + var underlyingType = Nullable.GetUnderlyingType(type); + InputType? inputType = (underlyingType ?? type) switch { { } t when t == typeof(float) => InputPrimitiveType.Float32, { } t when t == typeof(double) => InputPrimitiveType.Float64, + { } t when t == typeof(decimal) => new InputPrimitiveType(InputPrimitiveTypeKind.Decimal128, "decimal128", "TypeSpec.decimal128"), { } t when t == typeof(bool) => InputPrimitiveType.Boolean, { } t when t == typeof(string) => InputPrimitiveType.String, { } t when t == typeof(DateTimeOffset) => InputPrimitiveType.PlainDate, @@ -1585,6 +1593,11 @@ public void ScalarReturnTypeMethods(Type type) _ => null }; + if (underlyingType != null) + { + inputType = new InputNullableType(inputType!); + } + var inputOperation = InputFactory.Operation( "GetScalar", responses: [InputFactory.OperationResponse([200], inputType!)]); @@ -1600,9 +1613,54 @@ public void ScalarReturnTypeMethods(Type type) Assert.IsNotNull(methodCollection); var convenienceMethod = methodCollection.FirstOrDefault(m => m.Signature.Parameters.All(p => p.Name != "options") - && m.Signature.Name == $"{inputOperation.Name.ToIdentifierName()}"); + && m.Signature.Name == $"{inputOperation.Name.ToIdentifierName()}{(isAsync ? "Async" : "")}"); - Assert.AreEqual(Helpers.GetExpectedFromFile(type.Name), convenienceMethod!.BodyStatements!.ToDisplayString()); + var baselineName = underlyingType != null ? $"{underlyingType.Name}Nullable" : type.Name; + Assert.AreEqual(Helpers.GetExpectedFromFile($"{baselineName}{(isAsync ? "Async" : "")}"), convenienceMethod!.BodyStatements!.ToDisplayString()); + } + + [TestCase(true, true, false)] + [TestCase(true, false, false)] + [TestCase(false, true, false)] + [TestCase(false, false, false)] + [TestCase(true, true, true)] + [TestCase(false, false, true)] + public void EnumReturnTypeMethods(bool isString, bool isExtensible, bool isNullable) + { + InputType inputType = isString + ? InputFactory.StringEnum("TestEnum", [("Value", "value")], isExtensible: isExtensible) + : InputFactory.Int32Enum("TestEnum", [("Value", 1)], isExtensible: isExtensible); + if (isNullable) + { + inputType = new InputNullableType(inputType); + } + + var operation = InputFactory.Operation("GetEnum", responses: [InputFactory.OperationResponse([200], inputType)]); + var serviceMethod = InputFactory.BasicServiceMethod("GetEnum", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetEnum"); + + Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), method.BodyStatements!.ToDisplayString()); + } + + [Test] + public void PlainTextReturnTypeMethods() + { + var operation = InputFactory.Operation("GetText", responses: + [InputFactory.OperationResponse([200], InputPrimitiveType.String, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetText", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetText"); + + Assert.AreEqual(Helpers.GetExpectedFromFile(), method.BodyStatements!.ToDisplayString()); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs new file mode 100644 index 00000000000..cf15ec0d514 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs new file mode 100644 index 00000000000..02d66f03515 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs new file mode 100644 index 00000000000..70834653d41 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetInt32()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs new file mode 100644 index 00000000000..35876263549 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs new file mode 100644 index 00000000000..ef8194f4df2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs new file mode 100644 index 00000000000..666000fa161 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs new file mode 100644 index 00000000000..fa5d2eb3c6d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs @@ -0,0 +1,2 @@ +global::System.ClientModel.ClientResult result = this.GetText(cancellationToken.ToRequestOptions()); +return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index a418e708844..82c172f78f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetBoolean(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs new file mode 100644 index 00000000000..9bc1ea1a75b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index dd967f8292f..9c4fa167439 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDateTimeOffset(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs new file mode 100644 index 00000000000..1236e585138 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDecimal(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index b6d44cd9c10..3514cf0da05 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDouble(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index cb0644c9c72..996b365188c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs new file mode 100644 index 00000000000..66d8edd58bb --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs new file mode 100644 index 00000000000..6c4818e8aba --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs new file mode 100644 index 00000000000..04cd1e0f43b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 558d73a47ea..2de5e1fdd7f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt64(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index df2eb3be24c..79ee02d7dc0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetSingle(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index 1cf02c42f1e..ae5734d099c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 9012ebf182c..a692c529b59 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,2 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs new file mode 100644 index 00000000000..be31c359cc6 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -0,0 +1,4 @@ +global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); +global::System.BinaryData data = result.GetRawResponse().Content; +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 9e3d6da09ad..b6b37600972 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -12,6 +12,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.ServerSentEvents; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using SampleTypeSpec.Models.Custom; @@ -1086,7 +1087,9 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToObjectFromJson()), result.GetRawResponse()); + BinaryData data = result.GetRawResponse().Content; + using JsonDocument document = JsonDocument.Parse(data); + return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); } /// get extensible enum. @@ -1095,7 +1098,9 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToObjectFromJson()), result.GetRawResponse()); + BinaryData data = result.GetRawResponse().Content; + using JsonDocument document = JsonDocument.Parse(data); + return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); } /// From bea225a87acae21fcd528c60cd9af99ccd0df4a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 18:36:59 +0000 Subject: [PATCH 03/47] fix(http-client-csharp): preserve BOM handling for primitive responses Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 6 +++-- ...ity_BothMethodsParamOrderChanged(Async).cs | 4 +-- ...lity_BothMethodsParamOrderChanged(Sync).cs | 4 +-- ...nvenienceMethodParamOrderChanged(Async).cs | 4 +-- ...onvenienceMethodParamOrderChanged(Sync).cs | 4 +-- ...ltipleNewOptionalNonBodyParametersAdded.cs | 9 ++++--- ...dyParameterDoesNotAddBackCompatOverload.cs | 9 ++++--- ...bility_NewOptionalNonBodyParameterAdded.cs | 9 ++++--- ...ionalNonBodyParameterAddedWithModelBody.cs | 10 +++---- ...rameterAddedWithPathAndHeaderParameters.cs | 10 +++---- ...ty_NewOptionalParameterWithReservedName.cs | 9 ++++--- ...edParameterDoesNotAddBackCompatOverload.cs | 9 ++++--- ...numReturnTypeMethods(False,False,False).cs | 4 +-- ...EnumReturnTypeMethods(False,False,True).cs | 4 +-- ...EnumReturnTypeMethods(False,True,False).cs | 4 +-- ...EnumReturnTypeMethods(True,False,False).cs | 4 +-- .../EnumReturnTypeMethods(True,True,False).cs | 4 +-- .../EnumReturnTypeMethods(True,True,True).cs | 4 +-- .../ScalarReturnTypeMethods(Boolean).cs | 4 +-- ...calarReturnTypeMethods(BooleanNullable).cs | 4 +-- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +-- .../ScalarReturnTypeMethods(Decimal).cs | 4 +-- .../ScalarReturnTypeMethods(Double).cs | 4 +-- .../ScalarReturnTypeMethods(Int32).cs | 4 +-- .../ScalarReturnTypeMethods(Int32Async).cs | 4 +-- .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 +-- ...arReturnTypeMethods(Int32NullableAsync).cs | 4 +-- .../ScalarReturnTypeMethods(Int64).cs | 4 +-- .../ScalarReturnTypeMethods(Single).cs | 4 +-- .../ScalarReturnTypeMethods(String).cs | 4 +-- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 +-- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 +-- .../Local.Tests/ExtensibleEnumTests.cs | 27 +++++++++++++++++++ .../src/Generated/SampleTypeSpecClient.cs | 9 ++++--- 34 files changed, 119 insertions(+), 84 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 34790e14f2c..a67a8158cb8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -639,10 +639,12 @@ private IEnumerable GetStackVariablesForReturnValueConversi && !responseBodyType.Equals(typeof(BinaryData)) && !IsPlainTextResponse(responseBodyType)) { + var data = result.GetRawResponse().Content(); + // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. var statements = new MethodBodyStatement[] { - Declare("data", result.GetRawResponse().Content(), out var data), - UsingDeclare("document", data.Parse(), out var document) + UsingDeclare("stream", data.ToStream(), out var stream), + UsingDeclare("document", JsonDocumentSnippets.Parse(stream), out var document) }; declarations["data"] = data; declarations["document"] = document; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index 47c24d19bea..6de7dc53458 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -2,6 +2,6 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index 4f08f0724f1..71b9abbf9f0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -2,6 +2,6 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index 4667dec956b..de3fe14253f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -2,6 +2,6 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index 3792fa19dcd..3c1a5d8dfe1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -2,6 +2,6 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index 4b4aad7c3cd..c912c916118 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +37,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -47,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index 78a58777566..ad97eaf9be1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -29,8 +30,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -38,8 +39,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index 5de1339c64e..fc71052b495 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +37,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -47,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index 732ac769151..4aa676b5f2b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -2,10 +2,10 @@ #nullable disable -using System; using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +36,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -46,8 +46,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index 3b98a1bf806..e046039d6a4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -2,10 +2,10 @@ #nullable disable -using System; using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -38,8 +38,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -49,8 +49,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index a000b37200e..fac41dddf6d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -6,6 +6,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +37,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -47,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index 633639a6700..43264ee1b2c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -35,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } @@ -46,8 +47,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index cf15ec0d514..8061161a972 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 02d66f03515..e7dd0a3014f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 70834653d41..dfca1a2aff1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetInt32()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index 35876263549..4af25f57081 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString().ToTestEnum(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index ef8194f4df2..f5c5e5776b6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 666000fa161..d9891706fd4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index 82c172f78f8..2baefc83537 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetBoolean(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index 9bc1ea1a75b..d4b91918ecd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index 9c4fa167439..a877064a916 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDateTimeOffset(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index 1236e585138..a3b87b103eb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDecimal(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 3514cf0da05..5fd1536283c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDouble(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 996b365188c..2d3b19cb4ee 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index 66d8edd58bb..5794a99428f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 6c4818e8aba..3901a9bfa12 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 04cd1e0f43b..16126a5c58b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 2de5e1fdd7f..b32aeb63258 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt64(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index 79ee02d7dc0..03a8dc023c5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetSingle(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index ae5734d099c..ea431eea35e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index a692c529b59..809ae51f500 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index be31c359cc6..58c6c56e1d6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,4 +1,4 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); +using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); +using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index c348067affa..99e188a2ded 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -2,9 +2,13 @@ // Licensed under the MIT License. using System; +using System.ClientModel; +using System.ClientModel.Primitives; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Threading.Tasks; +using Moq; using NUnit.Framework; using SampleTypeSpec; @@ -12,6 +16,29 @@ namespace TestProjects.Local.Tests { public class ExtensibleEnumTests { + [TestCase(false, false)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(true, true)] + public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) + { + var content = BinaryData.FromString((hasBom ? "\uFEFF" : "") + "\"Monday\""); + var response = new Mock(); + response.SetupGet(r => r.Content).Returns(content); + var protocolResult = ClientResult.FromResponse(response.Object); + var client = new Mock { CallBase = true }; + client.Setup(c => c.GetUnknownValue(It.IsAny())).Returns(protocolResult); + client.Setup(c => c.GetUnknownValueAsync(It.IsAny())).ReturnsAsync(protocolResult); + + var result = isAsync + ? await client.Object.GetUnknownValueAsync() + : client.Object.GetUnknownValue(); + + Assert.AreEqual("Monday", result.Value.ToString()); + Assert.AreSame(response.Object, result.GetRawResponse()); + Assert.AreSame(content, result.GetRawResponse().Content); + } + [TestCase("a", "A", true)] [TestCase("A", "A", true)] [TestCase("A", "B", false)] diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index b6b37600972..54818f20ae8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -10,6 +10,7 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Linq; using System.Net.ServerSentEvents; using System.Text.Json; @@ -1087,8 +1088,8 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - BinaryData data = result.GetRawResponse().Content; - using JsonDocument document = JsonDocument.Parse(data); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); } @@ -1098,8 +1099,8 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - BinaryData data = result.GetRawResponse().Content; - using JsonDocument document = JsonDocument.Parse(data); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); } From e5e08e6320d8560236bc2ebf0be31d285ff900e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:20:33 +0000 Subject: [PATCH 04/47] test(http-client-csharp): validate complete primitive response methods Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../ClientProviders/ClientProviderTests.cs | 20 +++++++++++-------- ...ity_BothMethodsParamOrderChanged(Async).cs | 15 ++++++++------ ...lity_BothMethodsParamOrderChanged(Sync).cs | 15 ++++++++------ ...nvenienceMethodParamOrderChanged(Async).cs | 15 ++++++++------ ...onvenienceMethodParamOrderChanged(Sync).cs | 15 ++++++++------ .../ScmMethodProviderCollectionTests.cs | 12 ++++++++--- ...numReturnTypeMethods(False,False,False).cs | 11 ++++++---- ...EnumReturnTypeMethods(False,False,True).cs | 11 ++++++---- ...EnumReturnTypeMethods(False,True,False).cs | 11 ++++++---- ...EnumReturnTypeMethods(True,False,False).cs | 11 ++++++---- .../EnumReturnTypeMethods(True,True,False).cs | 11 ++++++---- .../EnumReturnTypeMethods(True,True,True).cs | 11 ++++++---- .../PlainTextReturnTypeMethods.cs | 7 +++++-- .../ScalarReturnTypeMethods(BinaryData).cs | 7 +++++-- .../ScalarReturnTypeMethods(Boolean).cs | 11 ++++++---- ...calarReturnTypeMethods(BooleanNullable).cs | 11 ++++++---- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Decimal).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Double).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Int32).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Int32Async).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Int32Nullable).cs | 11 ++++++---- ...arReturnTypeMethods(Int32NullableAsync).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Int64).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Single).cs | 11 ++++++---- .../ScalarReturnTypeMethods(String).cs | 11 ++++++---- .../ScalarReturnTypeMethods(TimeSpan).cs | 11 ++++++---- ...alarReturnTypeMethods(TimeSpanNullable).cs | 11 ++++++---- .../ScalarReturnTypeMethods(Uri).cs | 13 +++++++----- 29 files changed, 215 insertions(+), 124 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs index 0145d57568a..fef94f5ff15 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs @@ -3049,8 +3049,9 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() var body = syncConvenienceMethod!.BodyStatements; Assert.IsNotNull(body); - var result = body!.ToDisplayString(); - Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), result); + using var syncWriter = new CodeWriter(); + syncWriter.WriteMethod(syncConvenienceMethod); + Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), syncWriter.ToString(false)); var asyncConvenienceMethod = convenienceMethods .FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); @@ -3059,8 +3060,9 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() body = asyncConvenienceMethod!.BodyStatements; Assert.IsNotNull(body); - result = body!.ToDisplayString(); - Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), result); + using var asyncWriter = new CodeWriter(); + asyncWriter.WriteMethod(asyncConvenienceMethod); + Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), asyncWriter.ToString(false)); } [Test] @@ -3136,8 +3138,9 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() var body = syncConvenienceMethod!.BodyStatements; Assert.IsNotNull(body); - var result = body!.ToDisplayString(); - Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), result); + using var syncWriter = new CodeWriter(); + syncWriter.WriteMethod(syncConvenienceMethod); + Assert.AreEqual(Helpers.GetExpectedFromFile("Sync"), syncWriter.ToString(false)); var asyncConvenienceMethod = convenienceMethods .FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); @@ -3146,8 +3149,9 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() body = asyncConvenienceMethod!.BodyStatements; Assert.IsNotNull(body); - result = body!.ToDisplayString(); - Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), result); + using var asyncWriter = new CodeWriter(); + asyncWriter.WriteMethod(asyncConvenienceMethod); + Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), asyncWriter.ToString(false)); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index 6de7dc53458..a1621ae50c7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -1,7 +1,10 @@ -global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); +public virtual async global::System.Threading.Tasks.Task> UpdateResourceAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); -using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); -global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); + global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index 71b9abbf9f0..725cdf8bd69 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -1,7 +1,10 @@ -global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); +public virtual global::System.ClientModel.ClientResult UpdateResource(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); -using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); -global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); + global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index de3fe14253f..ef9ce3a313b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -1,7 +1,10 @@ -global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); +public virtual async global::System.Threading.Tasks.Task> GetDataAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); -using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); -global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); + global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index 3c1a5d8dfe1..fa20dabd5d7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -1,7 +1,10 @@ -global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); +public virtual global::System.ClientModel.ClientResult GetData(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +{ + global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); -using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); -global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); + global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index ce7639dbf6a..99f08608b3d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1616,7 +1616,9 @@ public void ScalarReturnTypeMethods(Type type, bool isAsync = false) && m.Signature.Name == $"{inputOperation.Name.ToIdentifierName()}{(isAsync ? "Async" : "")}"); var baselineName = underlyingType != null ? $"{underlyingType.Name}Nullable" : type.Name; - Assert.AreEqual(Helpers.GetExpectedFromFile($"{baselineName}{(isAsync ? "Async" : "")}"), convenienceMethod!.BodyStatements!.ToDisplayString()); + using var writer = new CodeWriter(); + writer.WriteMethod(convenienceMethod!); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{baselineName}{(isAsync ? "Async" : "")}"), writer.ToString(false)); } [TestCase(true, true, false)] @@ -1644,7 +1646,9 @@ public void EnumReturnTypeMethods(bool isString, bool isExtensible, bool isNulla var method = new ScmMethodProviderCollection(serviceMethod, client!) .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetEnum"); - Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), method.BodyStatements!.ToDisplayString()); + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), writer.ToString(false)); } [Test] @@ -1660,7 +1664,9 @@ public void PlainTextReturnTypeMethods() var method = new ScmMethodProviderCollection(serviceMethod, client!) .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetText"); - Assert.AreEqual(Helpers.GetExpectedFromFile(), method.BodyStatements!.ToDisplayString()); + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(), writer.ToString(false)); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 8061161a972..e272f7b5645 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index e7dd0a3014f..107a3af9d1f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index dfca1a2aff1..e038285e893 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetInt32()), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetInt32()), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index 4af25f57081..e7bf466d31d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString().ToTestEnum(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString().ToTestEnum(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index f5c5e5776b6..cef13277068 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index d9891706fd4..b627389142a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs index fa5d2eb3c6d..95920e5f6ba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs @@ -1,2 +1,5 @@ -global::System.ClientModel.ClientResult result = this.GetText(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetText(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetText(cancellationToken.ToRequestOptions()); + return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BinaryData).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BinaryData).cs index efcc1bbf33a..5069a349ea3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BinaryData).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BinaryData).cs @@ -1,2 +1,5 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content, result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index 2baefc83537..e7fb61baf44 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetBoolean(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetBoolean(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index d4b91918ecd..fab18b5d6a8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index a877064a916..7418cfee158 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDateTimeOffset(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDateTimeOffset(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index a3b87b103eb..80c21d2af40 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDecimal(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDecimal(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 5fd1536283c..2b3fc4bb08b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDouble(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDouble(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 2d3b19cb4ee..091dc5e833d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index 5794a99428f..db499d75196 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); +public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 3901a9bfa12..7c7241c2bf5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 16126a5c58b..bc9bf98057b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); +public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index b32aeb63258..8a3480d044f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt64(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt64(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index 03a8dc023c5..f08f48c32e1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetSingle(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetSingle(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index ea431eea35e..5e5251f0a56 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 809ae51f500..7354733900c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index 58c6c56e1d6..defe1586ff0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,4 +1,7 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); -return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs index 3a0a7cfdd2e..c6a19f33fe1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs @@ -1,5 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -global::System.BinaryData data = result.GetRawResponse().Content; -using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); -global::System.Text.Json.JsonElement element = document.RootElement; -return global::System.ClientModel.ClientResult.FromValue(new global::System.Uri(element.GetString(), global::System.UriKind.RelativeOrAbsolute), result.GetRawResponse()); +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + global::System.BinaryData data = result.GetRawResponse().Content; + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + global::System.Text.Json.JsonElement element = document.RootElement; + return global::System.ClientModel.ClientResult.FromValue(new global::System.Uri(element.GetString(), global::System.UriKind.RelativeOrAbsolute), result.GetRawResponse()); +} From 06ea139aecedd259d9e8627a0adb1f17e95aae1c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:31:58 +0000 Subject: [PATCH 05/47] Fix cspell error for FEFF in ExtensibleEnumTests.cs Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 99e188a2ded..e07267199cf 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// cspell:ignore FEFF + using System; using System.ClientModel; using System.ClientModel.Primitives; From 927840511fbef53ef828e85fd8186e42098b2bbc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:46:37 +0000 Subject: [PATCH 06/47] Cache enum/scalar response value in a variable instead of inline ternary Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 50 +++++++++++++------ ...ity_BothMethodsParamOrderChanged(Async).cs | 3 +- ...lity_BothMethodsParamOrderChanged(Sync).cs | 3 +- ...nvenienceMethodParamOrderChanged(Async).cs | 3 +- ...onvenienceMethodParamOrderChanged(Sync).cs | 3 +- ...ltipleNewOptionalNonBodyParametersAdded.cs | 6 ++- ...dyParameterDoesNotAddBackCompatOverload.cs | 6 ++- ...bility_NewOptionalNonBodyParameterAdded.cs | 6 ++- ...ionalNonBodyParameterAddedWithModelBody.cs | 6 ++- ...rameterAddedWithPathAndHeaderParameters.cs | 6 ++- ...ty_NewOptionalParameterWithReservedName.cs | 6 ++- ...edParameterDoesNotAddBackCompatOverload.cs | 6 ++- ...numReturnTypeMethods(False,False,False).cs | 3 +- ...EnumReturnTypeMethods(False,False,True).cs | 3 +- ...EnumReturnTypeMethods(False,True,False).cs | 3 +- ...EnumReturnTypeMethods(True,False,False).cs | 3 +- .../EnumReturnTypeMethods(True,True,False).cs | 3 +- .../EnumReturnTypeMethods(True,True,True).cs | 3 +- .../ScalarReturnTypeMethods(Boolean).cs | 3 +- ...calarReturnTypeMethods(BooleanNullable).cs | 3 +- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 3 +- .../ScalarReturnTypeMethods(Decimal).cs | 3 +- .../ScalarReturnTypeMethods(Double).cs | 3 +- .../ScalarReturnTypeMethods(Int32).cs | 3 +- .../ScalarReturnTypeMethods(Int32Async).cs | 3 +- .../ScalarReturnTypeMethods(Int32Nullable).cs | 3 +- ...arReturnTypeMethods(Int32NullableAsync).cs | 3 +- .../ScalarReturnTypeMethods(Int64).cs | 3 +- .../ScalarReturnTypeMethods(Single).cs | 3 +- .../ScalarReturnTypeMethods(String).cs | 3 +- .../ScalarReturnTypeMethods(TimeSpan).cs | 3 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 3 +- 32 files changed, 110 insertions(+), 54 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index a67a8158cb8..6672de77d60 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -295,7 +295,7 @@ .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out va Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result), .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations), IsConvertibleFromBinaryData(responseBodyType) - ? Return(result.FromValue(GetResultConversion(result, result.GetRawResponse(), responseBodyType, resultDeclarations), result.GetRawResponse())) + ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] { @@ -854,6 +854,39 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression return scopedApi.Add(element); } + private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) + { + var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) + || responseBodyType.IsReadOnlyMemory + || responseBodyType.IsList + || responseBodyType.IsDictionary + || IsPlainTextResponse(responseBodyType); + + if (!isSpecialCaseType && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum)) + { + var element = declarations["document"].As().RootElement(); + var deserializedValue = ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( + responseBodyType.WithNullable(false), + element, + declarations["data"].As(), + ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.WireOptionsField.As(), + responseBodyType.Equals(typeof(TimeSpan)) || responseBodyType.Equals(typeof(TimeSpan?)) + ? SerializationFormat.Duration_Constant + : SerializationFormat.Default); + var valueExpression = responseBodyType.IsNullable + ? new TernaryConditionalExpression(element.ValueKindEqualsNull(), Null.CastTo(responseBodyType), deserializedValue) + : deserializedValue; + + return + [ + Declare("value", responseBodyType, valueExpression, out var value), + Return(result.FromValue(value, response)) + ]; + } + + return [Return(result.FromValue(GetResultConversion(result, response, responseBodyType, declarations), response))]; + } + private ValueExpression GetResultConversion(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { if (responseBodyType.Equals(typeof(BinaryData))) @@ -876,21 +909,6 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon { return response.Content().InvokeToString(); } - if (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) - { - var element = declarations["document"].As().RootElement(); - var value = ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( - responseBodyType.WithNullable(false), - element, - declarations["data"].As(), - ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.WireOptionsField.As(), - responseBodyType.Equals(typeof(TimeSpan)) || responseBodyType.Equals(typeof(TimeSpan?)) - ? SerializationFormat.Duration_Constant - : SerializationFormat.Default); - return responseBodyType.IsNullable - ? new TernaryConditionalExpression(element.ValueKindEqualsNull(), Null.CastTo(responseBodyType), value) - : value; - } return result.CastTo(responseBodyType); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index a1621ae50c7..4f4f9c88a54 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -6,5 +6,6 @@ global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index 725cdf8bd69..9647d755f34 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -6,5 +6,6 @@ global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index ef9ce3a313b..98e5b272a4c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -6,5 +6,6 @@ global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index fa20dabd5d7..70c3d6840d5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -6,5 +6,6 @@ global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index c912c916118..9f5ac587a7a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -39,7 +39,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string param2, bool? param3 = default, string param4 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -50,7 +51,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index ad97eaf9be1..b2b7509ea97 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -32,7 +32,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param2, string param1 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -41,7 +42,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index fc71052b495..faa71292be9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -39,7 +39,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string param2, bool? param3 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -50,7 +51,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index 4aa676b5f2b..06887b83305 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -38,7 +38,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, global::Sample.Models.SampleModel body, bool? param3 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -48,7 +49,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index e046039d6a4..0186a8403aa 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -40,7 +40,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(string itemId, int filter, string region, string sort = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -51,7 +52,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } #pragma warning disable AZC0002 // Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index fac41dddf6d..88c49fd8973 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -39,7 +39,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string content, string @select = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -50,7 +51,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index 43264ee1b2c..01908bd29d0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -38,7 +38,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param2, bool param3, string param1, global::System.Threading.CancellationToken cancellationToken = default) @@ -49,7 +50,8 @@ public partial class TestClient global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index e272f7b5645..0dd4072a034 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); + global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 107a3af9d1f..9555f3050c6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(), result.GetRawResponse()); + global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index e038285e893..5d6b1510df6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetInt32()), result.GetRawResponse()); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index e7bf466d31d..c9592dd36ce 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString().ToTestEnum(), result.GetRawResponse()); + global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index cef13277068..e3a9e300663 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index b627389142a..4db817d4b6f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()), result.GetRawResponse()); + global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index e7fb61baf44..dd042ee9fac 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetBoolean(), result.GetRawResponse()); + bool value = document.RootElement.GetBoolean(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index fab18b5d6a8..4c349955a9a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(), result.GetRawResponse()); + bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index 7418cfee158..c662a01442e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDateTimeOffset(), result.GetRawResponse()); + global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index 80c21d2af40..ec18a48717d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDecimal(), result.GetRawResponse()); + decimal value = document.RootElement.GetDecimal(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 2b3fc4bb08b..01640da0a2c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetDouble(), result.GetRawResponse()); + double value = document.RootElement.GetDouble(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 091dc5e833d..7daaac8eb0b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); + int value = document.RootElement.GetInt32(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index db499d75196..cbabcf7db21 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt32(), result.GetRawResponse()); + int value = document.RootElement.GetInt32(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 7c7241c2bf5..d06a4e400b4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); + int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index bc9bf98057b..833c8a112f0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(), result.GetRawResponse()); + int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 8a3480d044f..85908b80a17 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetInt64(), result.GetRawResponse()); + long value = document.RootElement.GetInt64(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index f08f48c32e1..aed0acb79b7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetSingle(), result.GetRawResponse()); + float value = document.RootElement.GetSingle(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index 5e5251f0a56..ce8389519d2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetString(), result.GetRawResponse()); + string value = document.RootElement.GetString(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 7354733900c..3ef165eb6ee 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue(document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); + global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index defe1586ff0..a28d0b0e0f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -3,5 +3,6 @@ global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); - return global::System.ClientModel.ClientResult.FromValue((document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"), result.GetRawResponse()); + global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From 248bdc9fb8b214f99bda0fef44247a163413cad5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:09:19 +0000 Subject: [PATCH 07/47] Handle text/plain content type for primitive and enum responses Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 91 ++++++++++++++++++- .../ScmMethodProviderCollectionTests.cs | 53 +++++++++++ ...nTextEnumReturnTypeMethods(False,False).cs | 6 ++ ...inTextEnumReturnTypeMethods(False,True).cs | 6 ++ ...inTextEnumReturnTypeMethods(True,False).cs | 6 ++ ...ainTextEnumReturnTypeMethods(True,True).cs | 6 ++ ...ainTextScalarReturnTypeMethods(Boolean).cs | 6 ++ ...PlainTextScalarReturnTypeMethods(Int32).cs | 6 ++ ...inTextScalarReturnTypeMethods(TimeSpan).cs | 6 ++ .../Local.Tests/ExtensibleEnumTests.cs | 2 +- .../src/Generated/SampleTypeSpecClient.cs | 12 +-- 11 files changed, 189 insertions(+), 11 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 6672de77d60..4bf7c8cb1b0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// cspell:ignore FEFF + using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.IO; using System.Linq; using System.Net.ServerSentEvents; @@ -637,7 +640,7 @@ private IEnumerable GetStackVariablesForReturnValueConversi if (IsConvertibleFromBinaryData(responseBodyType) && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && !responseBodyType.Equals(typeof(BinaryData)) - && !IsPlainTextResponse(responseBodyType)) + && !IsPlainTextConversion(responseBodyType)) { var data = result.GetRawResponse().Content(); // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. @@ -856,6 +859,21 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { + // Operations that return a non-string primitive or enum with a text/plain content type are not JSON-encoded, + // so the value must be parsed from the raw response text instead of going through JsonDocument. A leading + // UTF-8 BOM is stripped first to match the tolerance previously provided by JsonDocument/ToObjectFromJson. + if (IsPlainTextConversion(responseBodyType) && !responseBodyType.Equals(typeof(string))) + { + var content = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); + var valueExpression = GetPlainTextValueConversion(responseBodyType, content); + + return + [ + Declare("value", responseBodyType, valueExpression, out var value), + Return(result.FromValue(value, response)) + ]; + } + var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) || responseBodyType.IsReadOnlyMemory || responseBodyType.IsList @@ -913,7 +931,76 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon } private bool IsPlainTextResponse(CSharpType responseBodyType) - => responseBodyType.Equals(typeof(string)) && ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain")); + => responseBodyType.Equals(typeof(string)) && HasPlainTextContentType(); + + /// + /// Whether has a text/plain content type and is a type this generator + /// knows how to parse directly from the raw response text, without treating it as JSON. + /// + private bool IsPlainTextConversion(CSharpType responseBodyType) + => HasPlainTextContentType() && IsSupportedPlainTextType(responseBodyType); + + private bool HasPlainTextContentType() + => ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain")); + + private static bool IsSupportedPlainTextType(CSharpType type) + { + var nonNullableType = type.WithNullable(false); + if (nonNullableType.IsEnum) + { + return IsSupportedPlainTextType(nonNullableType.UnderlyingEnumType!); + } + + if (!nonNullableType.IsFrameworkType) + { + return false; + } + + var frameworkType = nonNullableType.FrameworkType; + return frameworkType == typeof(string) + || frameworkType == typeof(bool) + || frameworkType == typeof(byte) + || frameworkType == typeof(sbyte) + || frameworkType == typeof(short) + || frameworkType == typeof(ushort) + || frameworkType == typeof(int) + || frameworkType == typeof(uint) + || frameworkType == typeof(long) + || frameworkType == typeof(ulong) + || frameworkType == typeof(float) + || frameworkType == typeof(double) + || frameworkType == typeof(decimal) + || frameworkType == typeof(Guid) + || frameworkType == typeof(Uri) + || frameworkType == typeof(TimeSpan) + || frameworkType == typeof(DateTimeOffset); + } + + /// + /// Builds an expression that parses (the raw text/plain response body) into + /// , without relying on JSON parsing or reflection-based conversion. + /// + private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueExpression content) + { + var nonNullableType = valueType.WithNullable(false); + if (nonNullableType.IsEnum) + { + return nonNullableType.ToEnum(GetPlainTextValueConversion(nonNullableType.UnderlyingEnumType!, content)); + } + + var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); + var frameworkType = nonNullableType.FrameworkType; + return frameworkType switch + { + Type t when t == typeof(string) => content, + Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), + Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), + Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), + Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier()!)), + Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal("O")), + _ => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType) + }; + } private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 99f08608b3d..6b746eef4c1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1669,6 +1669,59 @@ public void PlainTextReturnTypeMethods() Assert.AreEqual(Helpers.GetExpectedFromFile(), writer.ToString(false)); } + [TestCase(typeof(int))] + [TestCase(typeof(bool))] + [TestCase(typeof(TimeSpan))] + public void PlainTextScalarReturnTypeMethods(Type type) + { + InputType inputType = type switch + { + { } t when t == typeof(int) => InputPrimitiveType.Int32, + { } t when t == typeof(bool) => InputPrimitiveType.Boolean, + { } t when t == typeof(TimeSpan) => InputPrimitiveType.PlainTime, + _ => throw new NotSupportedException() + }; + + var operation = InputFactory.Operation("GetPlainTextScalar", responses: + [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextScalar", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextScalar"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(type.Name), writer.ToString(false)); + } + + [TestCase(true, true)] + [TestCase(true, false)] + [TestCase(false, true)] + [TestCase(false, false)] + public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible) + { + InputType inputType = isString + ? InputFactory.StringEnum("TestEnum", [("Value", "value")], isExtensible: isExtensible) + : InputFactory.Int32Enum("TestEnum", [("Value", 1)], isExtensible: isExtensible); + + var operation = InputFactory.Operation("GetPlainTextEnum", responses: + [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextEnum", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextEnum"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible}"), writer.ToString(false)); + } + [Test] public void TestUnionResponseType() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs new file mode 100644 index 00000000000..bcabff11c16 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum value = int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs new file mode 100644 index 00000000000..0666d6f51d8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs new file mode 100644 index 00000000000..f360b4939f1 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum value = result.GetRawResponse().Content.ToString().TrimStart('').ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs new file mode 100644 index 00000000000..6fa4400555e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs new file mode 100644 index 00000000000..f2f666c704a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + bool value = bool.Parse(result.GetRawResponse().Content.ToString().TrimStart('')); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs new file mode 100644 index 00000000000..e320659eb5b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + int value = int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs new file mode 100644 index 00000000000..fb368f8ef33 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString().TrimStart(''), "c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index e07267199cf..2e58189ccf3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -24,7 +24,7 @@ public class ExtensibleEnumTests [TestCase(true, true)] public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) { - var content = BinaryData.FromString((hasBom ? "\uFEFF" : "") + "\"Monday\""); + var content = BinaryData.FromString((hasBom ? "\uFEFF" : "") + "Monday"); var response = new Mock(); response.SetupGet(r => r.Content).Returns(content); var protocolResult = ClientResult.FromResponse(response.Object); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 54818f20ae8..58eac4ed6dd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -10,10 +10,8 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; using System.Net.ServerSentEvents; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; using SampleTypeSpec.Models.Custom; @@ -1088,9 +1086,8 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); - return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + return ClientResult.FromValue(value, result.GetRawResponse()); } /// get extensible enum. @@ -1099,9 +1096,8 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); - return ClientResult.FromValue(new DaysOfWeekExtensibleEnum(document.RootElement.GetString()), result.GetRawResponse()); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + return ClientResult.FromValue(value, result.GetRawResponse()); } /// From bba90fc4868ea9e128dc80ff8bfdf0e851228f76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:15:24 +0000 Subject: [PATCH 08/47] Add nullable enum test coverage for remaining isString/isExtensible combinations Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../test/Providers/ScmMethodProviderCollectionTests.cs | 2 ++ .../EnumReturnTypeMethods(False,True,True).cs | 8 ++++++++ .../EnumReturnTypeMethods(True,False,True).cs | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 6b746eef4c1..66d6a3c64e2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1626,6 +1626,8 @@ public void ScalarReturnTypeMethods(Type type, bool isAsync = false) [TestCase(false, true, false)] [TestCase(false, false, false)] [TestCase(true, true, true)] + [TestCase(true, false, true)] + [TestCase(false, true, true)] [TestCase(false, false, true)] public void EnumReturnTypeMethods(bool isString, bool isExtensible, bool isNullable) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs new file mode 100644 index 00000000000..940c12a3f7d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -0,0 +1,8 @@ +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs new file mode 100644 index 00000000000..0072803b03f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -0,0 +1,8 @@ +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From 0e496fefe20223eecad74a86bf4e6c9d464a3a85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:34:31 +0000 Subject: [PATCH 09/47] Simplify plain-text response checks, avoid null-forgiving, fix mixed content-type detection Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 60 +++++++++++-------- .../ScmMethodProviderCollectionTests.cs | 20 +++++++ ...entTypeScalarResponseUsesJsonConversion.cs | 8 +++ 3 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 4bf7c8cb1b0..1d10ca5d91b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -875,9 +875,7 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re } var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) - || responseBodyType.IsReadOnlyMemory - || responseBodyType.IsList - || responseBodyType.IsDictionary + || responseBodyType.IsCollection || IsPlainTextResponse(responseBodyType); if (!isSpecialCaseType && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum)) @@ -941,14 +939,20 @@ private bool IsPlainTextConversion(CSharpType responseBodyType) => HasPlainTextContentType() && IsSupportedPlainTextType(responseBodyType); private bool HasPlainTextContentType() - => ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain")); + { + var contentTypes = ServiceMethod.Operation.Responses + .Where(r => r.IsErrorResponse is false) + .SelectMany(r => r.ContentTypes) + .ToList(); + return contentTypes.Count > 0 && contentTypes.All(ct => ct == "text/plain"); + } private static bool IsSupportedPlainTextType(CSharpType type) { var nonNullableType = type.WithNullable(false); if (nonNullableType.IsEnum) { - return IsSupportedPlainTextType(nonNullableType.UnderlyingEnumType!); + return IsSupportedPlainTextType(nonNullableType.UnderlyingEnumType); } if (!nonNullableType.IsFrameworkType) @@ -956,24 +960,27 @@ private static bool IsSupportedPlainTextType(CSharpType type) return false; } - var frameworkType = nonNullableType.FrameworkType; - return frameworkType == typeof(string) - || frameworkType == typeof(bool) - || frameworkType == typeof(byte) - || frameworkType == typeof(sbyte) - || frameworkType == typeof(short) - || frameworkType == typeof(ushort) - || frameworkType == typeof(int) - || frameworkType == typeof(uint) - || frameworkType == typeof(long) - || frameworkType == typeof(ulong) - || frameworkType == typeof(float) - || frameworkType == typeof(double) - || frameworkType == typeof(decimal) - || frameworkType == typeof(Guid) - || frameworkType == typeof(Uri) - || frameworkType == typeof(TimeSpan) - || frameworkType == typeof(DateTimeOffset); + return nonNullableType.FrameworkType switch + { + Type t when t == typeof(string) => true, + Type t when t == typeof(bool) => true, + Type t when t == typeof(byte) => true, + Type t when t == typeof(sbyte) => true, + Type t when t == typeof(short) => true, + Type t when t == typeof(ushort) => true, + Type t when t == typeof(int) => true, + Type t when t == typeof(uint) => true, + Type t when t == typeof(long) => true, + Type t when t == typeof(ulong) => true, + Type t when t == typeof(float) => true, + Type t when t == typeof(double) => true, + Type t when t == typeof(decimal) => true, + Type t when t == typeof(Guid) => true, + Type t when t == typeof(Uri) => true, + Type t when t == typeof(TimeSpan) => true, + Type t when t == typeof(DateTimeOffset) => true, + _ => false + }; } /// @@ -985,7 +992,7 @@ private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueE var nonNullableType = valueType.WithNullable(false); if (nonNullableType.IsEnum) { - return nonNullableType.ToEnum(GetPlainTextValueConversion(nonNullableType.UnderlyingEnumType!, content)); + return nonNullableType.ToEnum(GetPlainTextValueConversion(nonNullableType.UnderlyingEnumType, content)); } var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); @@ -997,7 +1004,10 @@ private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueE Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier()!)), - Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal("O")), + // "U" is reserved by TypeFormattersDefinition.ParseDateTimeOffset for Unix-time parsing; any other + // specifier (including this one) falls through to standard invariant-culture DateTimeOffset parsing, + // matching the default (non-Unix) format used by the JSON deserialization path. + Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(SerializationFormat.DateTime_ISO8601.ToFormatSpecifier()!)), _ => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType) }; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 66d6a3c64e2..f6a0ceb56ba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1724,6 +1724,26 @@ public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible) Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible}"), writer.ToString(false)); } + [Test] + public void MixedContentTypeScalarResponseUsesJsonConversion() + { + // When a response declares text/plain alongside another content type (e.g. application/json), the + // wire format cannot be assumed to be raw text, so the JSON conversion path must be used instead. + var operation = InputFactory.Operation("GetScalar", responses: + [InputFactory.OperationResponse([200], InputPrimitiveType.Int32, contentTypes: ["application/json", "text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetScalar", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetScalar"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(), writer.ToString(false)); + } + [Test] public void TestUnionResponseType() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs new file mode 100644 index 00000000000..88d44fbf0e4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -0,0 +1,8 @@ +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + int value = document.RootElement.GetInt32(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From c6bbcbe03b731dda4b1c93d235cadfdd057db61f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:43:04 +0000 Subject: [PATCH 10/47] fix(http-client-csharp): refine plain text response conversion Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 85 +++++++++++-------- .../ScmMethodProviderCollectionTests.cs | 35 ++++++-- ...umReturnTypeMethods(False,False,False).cs} | 0 ...EnumReturnTypeMethods(False,False,True).cs | 6 ++ ...numReturnTypeMethods(False,True,False).cs} | 0 ...tEnumReturnTypeMethods(False,True,True).cs | 6 ++ ...numReturnTypeMethods(True,False,False).cs} | 0 ...tEnumReturnTypeMethods(True,False,True).cs | 6 ++ ...EnumReturnTypeMethods(True,True,False).cs} | 0 ...xtEnumReturnTypeMethods(True,True,True).cs | 6 ++ ...calarReturnTypeMethods(BooleanNullable).cs | 6 ++ ...ScalarReturnTypeMethods(DateTimeOffset).cs | 6 ++ ...tScalarReturnTypeMethods(Int32Nullable).cs | 6 ++ ...alarReturnTypeMethods(TimeSpanNullable).cs | 6 ++ 14 files changed, 124 insertions(+), 44 deletions(-) rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextEnumReturnTypeMethods(False,False).cs => PlainTextEnumReturnTypeMethods(False,False,False).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextEnumReturnTypeMethods(False,True).cs => PlainTextEnumReturnTypeMethods(False,True,False).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextEnumReturnTypeMethods(True,False).cs => PlainTextEnumReturnTypeMethods(True,False,False).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextEnumReturnTypeMethods(True,True).cs => PlainTextEnumReturnTypeMethods(True,True,False).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 4bf7c8cb1b0..6d70ac5b146 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -865,7 +865,10 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re if (IsPlainTextConversion(responseBodyType) && !responseBodyType.Equals(typeof(string))) { var content = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); - var valueExpression = GetPlainTextValueConversion(responseBodyType, content); + var deserializedValue = GetPlainTextValueConversion(responseBodyType, content); + var valueExpression = responseBodyType.IsNullable + ? new TernaryConditionalExpression(content.Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) + : deserializedValue; return [ @@ -876,8 +879,7 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) || responseBodyType.IsReadOnlyMemory - || responseBodyType.IsList - || responseBodyType.IsDictionary + || responseBodyType.IsCollection || IsPlainTextResponse(responseBodyType); if (!isSpecialCaseType && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum)) @@ -941,39 +943,41 @@ private bool IsPlainTextConversion(CSharpType responseBodyType) => HasPlainTextContentType() && IsSupportedPlainTextType(responseBodyType); private bool HasPlainTextContentType() - => ServiceMethod.Operation.Responses.Any(r => r.IsErrorResponse is false && r.ContentTypes.Contains("text/plain")); + { + var responses = ServiceMethod.Operation.Responses.Where(r => r.IsErrorResponse is false); + return responses.Any() && responses.All(r => r.ContentTypes.Count == 1 && r.ContentTypes[0] == "text/plain"); + } private static bool IsSupportedPlainTextType(CSharpType type) { var nonNullableType = type.WithNullable(false); - if (nonNullableType.IsEnum) - { - return IsSupportedPlainTextType(nonNullableType.UnderlyingEnumType!); - } - - if (!nonNullableType.IsFrameworkType) - { - return false; - } - - var frameworkType = nonNullableType.FrameworkType; - return frameworkType == typeof(string) - || frameworkType == typeof(bool) - || frameworkType == typeof(byte) - || frameworkType == typeof(sbyte) - || frameworkType == typeof(short) - || frameworkType == typeof(ushort) - || frameworkType == typeof(int) - || frameworkType == typeof(uint) - || frameworkType == typeof(long) - || frameworkType == typeof(ulong) - || frameworkType == typeof(float) - || frameworkType == typeof(double) - || frameworkType == typeof(decimal) - || frameworkType == typeof(Guid) - || frameworkType == typeof(Uri) - || frameworkType == typeof(TimeSpan) - || frameworkType == typeof(DateTimeOffset); + if (nonNullableType is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) + { + return IsSupportedPlainTextType(underlyingEnumType); + } + + return nonNullableType.FrameworkType switch + { + Type t when nonNullableType.IsFrameworkType + && (t == typeof(string) + || t == typeof(bool) + || t == typeof(byte) + || t == typeof(sbyte) + || t == typeof(short) + || t == typeof(ushort) + || t == typeof(int) + || t == typeof(uint) + || t == typeof(long) + || t == typeof(ulong) + || t == typeof(float) + || t == typeof(double) + || t == typeof(decimal) + || t == typeof(Guid) + || t == typeof(Uri) + || t == typeof(TimeSpan) + || t == typeof(DateTimeOffset)) => true, + _ => false + }; } /// @@ -983,9 +987,9 @@ private static bool IsSupportedPlainTextType(CSharpType type) private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueExpression content) { var nonNullableType = valueType.WithNullable(false); - if (nonNullableType.IsEnum) + if (nonNullableType is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) { - return nonNullableType.ToEnum(GetPlainTextValueConversion(nonNullableType.UnderlyingEnumType!, content)); + return nonNullableType.ToEnum(GetPlainTextValueConversion(underlyingEnumType, content)); } var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); @@ -996,12 +1000,21 @@ private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueE Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), - Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier()!)), - Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal("O")), + Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), + Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(GetResponseSerializationFormat().ToFormatSpecifier())), _ => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType) }; } + private SerializationFormat GetResponseSerializationFormat() + { + var responseBodyType = ServiceMethod.Operation.Responses + .FirstOrDefault(r => r.IsErrorResponse is false)?.BodyType; + return responseBodyType is null + ? SerializationFormat.Default + : ScmCodeModelGenerator.Instance.TypeFactory.GetSerializationFormat(responseBodyType); + } + private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) { if (!type.IsFrameworkType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 66d6a3c64e2..3fcbce42fc5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1672,17 +1672,27 @@ public void PlainTextReturnTypeMethods() } [TestCase(typeof(int))] + [TestCase(typeof(int?))] [TestCase(typeof(bool))] + [TestCase(typeof(bool?))] [TestCase(typeof(TimeSpan))] + [TestCase(typeof(TimeSpan?))] + [TestCase(typeof(DateTimeOffset))] public void PlainTextScalarReturnTypeMethods(Type type) { - InputType inputType = type switch + var underlyingType = Nullable.GetUnderlyingType(type); + InputType inputType = (underlyingType ?? type) switch { { } t when t == typeof(int) => InputPrimitiveType.Int32, { } t when t == typeof(bool) => InputPrimitiveType.Boolean, { } t when t == typeof(TimeSpan) => InputPrimitiveType.PlainTime, + { } t when t == typeof(DateTimeOffset) => InputPrimitiveType.PlainDate, _ => throw new NotSupportedException() }; + if (underlyingType != null) + { + inputType = new InputNullableType(inputType); + } var operation = InputFactory.Operation("GetPlainTextScalar", responses: [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); @@ -1696,18 +1706,27 @@ public void PlainTextScalarReturnTypeMethods(Type type) using var writer = new CodeWriter(); writer.WriteMethod(method); - Assert.AreEqual(Helpers.GetExpectedFromFile(type.Name), writer.ToString(false)); + var baselineName = underlyingType != null ? $"{underlyingType.Name}Nullable" : type.Name; + Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } - [TestCase(true, true)] - [TestCase(true, false)] - [TestCase(false, true)] - [TestCase(false, false)] - public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible) + [TestCase(true, true, false)] + [TestCase(true, false, false)] + [TestCase(false, true, false)] + [TestCase(false, false, false)] + [TestCase(true, true, true)] + [TestCase(true, false, true)] + [TestCase(false, true, true)] + [TestCase(false, false, true)] + public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible, bool isNullable) { InputType inputType = isString ? InputFactory.StringEnum("TestEnum", [("Value", "value")], isExtensible: isExtensible) : InputFactory.Int32Enum("TestEnum", [("Value", 1)], isExtensible: isExtensible); + if (isNullable) + { + inputType = new InputNullableType(inputType); + } var operation = InputFactory.Operation("GetPlainTextEnum", responses: [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); @@ -1721,7 +1740,7 @@ public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible) using var writer = new CodeWriter(); writer.WriteMethod(method); - Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible}"), writer.ToString(false)); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), writer.ToString(false)); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs new file mode 100644 index 00000000000..f105807bcc3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs new file mode 100644 index 00000000000..39faab9a647 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs new file mode 100644 index 00000000000..3724b0d34db --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : result.GetRawResponse().Content.ToString().TrimStart('').ToTestEnum(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs new file mode 100644 index 00000000000..dd584b67d9a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs new file mode 100644 index 00000000000..2f89f35b043 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + bool? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((bool?)null) : bool.Parse(result.GetRawResponse().Content.ToString().TrimStart('')); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs new file mode 100644 index 00000000000..4ca6d99cb2a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(result.GetRawResponse().Content.ToString().TrimStart(''), "D"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs new file mode 100644 index 00000000000..8ec8038a396 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + int? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((int?)null) : int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs new file mode 100644 index 00000000000..9229cc2065f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -0,0 +1,6 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString().TrimStart(''), "c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From d9df7e9b69a6f7321517bd98f1150f0dfd528e61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:54:09 +0000 Subject: [PATCH 11/47] refactor(http-client-csharp): consolidate plain text response helpers Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 126 ++++++++---------- 1 file changed, 53 insertions(+), 73 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 85ac9fd2500..2265dc0e3e8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -640,7 +640,7 @@ private IEnumerable GetStackVariablesForReturnValueConversi if (IsConvertibleFromBinaryData(responseBodyType) && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && !responseBodyType.Equals(typeof(BinaryData)) - && !IsPlainTextConversion(responseBodyType)) + && GetPlainTextValueConversion(responseBodyType, result.GetRawResponse()) is null) { var data = result.GetRawResponse().Content(); // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. @@ -859,27 +859,18 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { - // Operations that return a non-string primitive or enum with a text/plain content type are not JSON-encoded, - // so the value must be parsed from the raw response text instead of going through JsonDocument. A leading - // UTF-8 BOM is stripped first to match the tolerance previously provided by JsonDocument/ToObjectFromJson. - if (IsPlainTextConversion(responseBodyType) && !responseBodyType.Equals(typeof(string))) + if (!responseBodyType.Equals(typeof(string)) && GetPlainTextValueConversion(responseBodyType, response) is { } plainTextValue) { - var content = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); - var deserializedValue = GetPlainTextValueConversion(responseBodyType, content); - var valueExpression = responseBodyType.IsNullable - ? new TernaryConditionalExpression(content.Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) - : deserializedValue; - return [ - Declare("value", responseBodyType, valueExpression, out var value), + Declare("value", responseBodyType, plainTextValue, out var value), Return(result.FromValue(value, response)) ]; } var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) || responseBodyType.IsCollection - || IsPlainTextResponse(responseBodyType); + || (responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()); if (!isSpecialCaseType && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum)) { @@ -924,88 +915,77 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon { return declarations["value"].CastTo(new CSharpType(responseBodyType.OutputType.FrameworkType, responseBodyType.Arguments[0], responseBodyType.Arguments[1])); } - if (IsPlainTextResponse(responseBodyType)) + if (responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()) { return response.Content().InvokeToString(); } return result.CastTo(responseBodyType); } - private bool IsPlainTextResponse(CSharpType responseBodyType) - => responseBodyType.Equals(typeof(string)) && HasPlainTextContentType(); - - /// - /// Whether has a text/plain content type and is a type this generator - /// knows how to parse directly from the raw response text, without treating it as JSON. - /// - private bool IsPlainTextConversion(CSharpType responseBodyType) - => HasPlainTextContentType() && IsSupportedPlainTextType(responseBodyType); - - private bool HasPlainTextContentType() - { - var contentTypes = ServiceMethod.Operation.Responses - .Where(r => r.IsErrorResponse is false) - .SelectMany(r => r.ContentTypes); - return contentTypes.Any() && contentTypes.All(contentType => contentType == "text/plain"); - } - - private static bool IsSupportedPlainTextType(CSharpType type) + private ValueExpression? GetPlainTextValueConversion(CSharpType responseBodyType, HttpResponseApi response) { - var nonNullableType = type.WithNullable(false); - if (nonNullableType is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) + if (!HasOnlyPlainTextContentType()) { - return IsSupportedPlainTextType(underlyingEnumType); - } - - return nonNullableType.FrameworkType switch - { - Type t when nonNullableType.IsFrameworkType - && (t == typeof(string) - || t == typeof(bool) - || t == typeof(byte) - || t == typeof(sbyte) - || t == typeof(short) - || t == typeof(ushort) - || t == typeof(int) - || t == typeof(uint) - || t == typeof(long) - || t == typeof(ulong) - || t == typeof(float) - || t == typeof(double) - || t == typeof(decimal) - || t == typeof(Guid) - || t == typeof(Uri) - || t == typeof(TimeSpan) - || t == typeof(DateTimeOffset)) => true, - _ => false - }; - } + return null; + } - /// - /// Builds an expression that parses (the raw text/plain response body) into - /// , without relying on JSON parsing or reflection-based conversion. - /// - private ValueExpression GetPlainTextValueConversion(CSharpType valueType, ValueExpression content) - { - var nonNullableType = valueType.WithNullable(false); + // Primitive and enum text/plain bodies are not JSON-encoded. Strip a leading UTF-8 BOM to preserve + // the tolerance previously provided by JsonDocument/ToObjectFromJson. + var content = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); + var nonNullableType = responseBodyType.WithNullable(false); + var typeToDeserialize = nonNullableType; + CSharpType? enumType = null; if (nonNullableType is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) { - return nonNullableType.ToEnum(GetPlainTextValueConversion(underlyingEnumType, content)); + enumType = nonNullableType; + typeToDeserialize = underlyingEnumType; } var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); - var frameworkType = nonNullableType.FrameworkType; - return frameworkType switch + ValueExpression? deserializedValue = typeToDeserialize.FrameworkType switch { Type t when t == typeof(string) => content, Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), - Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(GetResponseSerializationFormat().ToFormatSpecifier())), - _ => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType) + Type frameworkType when typeToDeserialize.IsFrameworkType + && (frameworkType == typeof(byte) + || frameworkType == typeof(sbyte) + || frameworkType == typeof(short) + || frameworkType == typeof(ushort) + || frameworkType == typeof(int) + || frameworkType == typeof(uint) + || frameworkType == typeof(long) + || frameworkType == typeof(ulong) + || frameworkType == typeof(float) + || frameworkType == typeof(double) + || frameworkType == typeof(decimal)) + => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType), + _ => null }; + if (deserializedValue is null) + { + return null; + } + + if (enumType is not null) + { + deserializedValue = enumType.ToEnum(deserializedValue); + } + + return responseBodyType.IsNullable + ? new TernaryConditionalExpression(content.Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) + : deserializedValue; + } + + private bool HasOnlyPlainTextContentType() + { + var contentTypes = ServiceMethod.Operation.Responses + .Where(r => r.IsErrorResponse is false) + .SelectMany(r => r.ContentTypes); + return contentTypes.Any() && contentTypes.All(contentType => contentType == "text/plain"); } private SerializationFormat GetResponseSerializationFormat() From 755b311a29acdda88a0e3a9779d0ee74e772ebab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 21:08:38 +0000 Subject: [PATCH 12/47] perf(http-client-csharp): cache plain text response content Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 26 ++++++------------- ...numReturnTypeMethods(False,False,False).cs | 3 ++- ...EnumReturnTypeMethods(False,False,True).cs | 3 ++- ...EnumReturnTypeMethods(False,True,False).cs | 3 ++- ...tEnumReturnTypeMethods(False,True,True).cs | 3 ++- ...EnumReturnTypeMethods(True,False,False).cs | 3 ++- ...tEnumReturnTypeMethods(True,False,True).cs | 3 ++- ...tEnumReturnTypeMethods(True,True,False).cs | 3 ++- ...xtEnumReturnTypeMethods(True,True,True).cs | 3 ++- ...ainTextScalarReturnTypeMethods(Boolean).cs | 3 ++- ...calarReturnTypeMethods(BooleanNullable).cs | 3 ++- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 3 ++- ...PlainTextScalarReturnTypeMethods(Int32).cs | 3 ++- ...tScalarReturnTypeMethods(Int32Nullable).cs | 3 ++- ...inTextScalarReturnTypeMethods(TimeSpan).cs | 3 ++- ...alarReturnTypeMethods(TimeSpanNullable).cs | 3 ++- 16 files changed, 38 insertions(+), 33 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 2265dc0e3e8..88ab08c8ecd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -640,7 +640,7 @@ private IEnumerable GetStackVariablesForReturnValueConversi if (IsConvertibleFromBinaryData(responseBodyType) && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && !responseBodyType.Equals(typeof(BinaryData)) - && GetPlainTextValueConversion(responseBodyType, result.GetRawResponse()) is null) + && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. @@ -859,11 +859,13 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { - if (!responseBodyType.Equals(typeof(string)) && GetPlainTextValueConversion(responseBodyType, response) is { } plainTextValue) + if (!responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()) { + var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); return [ - Declare("value", responseBodyType, plainTextValue, out var value), + Declare("content", typeof(string), contentExpression, out var content), + Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, content), out var value), Return(result.FromValue(value, response)) ]; } @@ -922,16 +924,8 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon return result.CastTo(responseBodyType); } - private ValueExpression? GetPlainTextValueConversion(CSharpType responseBodyType, HttpResponseApi response) + private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, ValueExpression content) { - if (!HasOnlyPlainTextContentType()) - { - return null; - } - - // Primitive and enum text/plain bodies are not JSON-encoded. Strip a leading UTF-8 BOM to preserve - // the tolerance previously provided by JsonDocument/ToObjectFromJson. - var content = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var nonNullableType = responseBodyType.WithNullable(false); var typeToDeserialize = nonNullableType; CSharpType? enumType = null; @@ -942,7 +936,7 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon } var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); - ValueExpression? deserializedValue = typeToDeserialize.FrameworkType switch + var deserializedValue = typeToDeserialize.FrameworkType switch { Type t when t == typeof(string) => content, Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), @@ -963,12 +957,8 @@ Type frameworkType when typeToDeserialize.IsFrameworkType || frameworkType == typeof(double) || frameworkType == typeof(decimal)) => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType), - _ => null + _ => Static(typeToDeserialize.FrameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(typeToDeserialize.FrameworkType) }; - if (deserializedValue is null) - { - return null; - } if (enumType is not null) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs index bcabff11c16..e3de8f298ee 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum value = int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs index f105807bcc3..50c6b59e268 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs index 0666d6f51d8..6076a3a76f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture)); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs index 39faab9a647..d64c68f1027 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture)); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs index f360b4939f1..5db2345600e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum value = result.GetRawResponse().Content.ToString().TrimStart('').ToTestEnum(); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = content.ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs index 3724b0d34db..d2a202f6cfd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : result.GetRawResponse().Content.ToString().TrimStart('').ToTestEnum(); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : content.ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs index 6fa4400555e..c2384e9e4a1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs index dd584b67d9a..623779b8b72 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs index f2f666c704a..e60aa9f8da9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - bool value = bool.Parse(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + bool value = bool.Parse(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs index 2f89f35b043..ca99c0f17d5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - bool? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((bool?)null) : bool.Parse(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + bool? value = (content == "null") ? ((bool?)null) : bool.Parse(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs index 4ca6d99cb2a..2096ab0828b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(result.GetRawResponse().Content.ToString().TrimStart(''), "D"); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(content, "D"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs index e320659eb5b..5830cf55741 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - int value = int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + int value = int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs index 8ec8038a396..7effa4ebe9c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - int? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((int?)null) : int.Parse(result.GetRawResponse().Content.ToString().TrimStart(''), global::System.Globalization.CultureInfo.InvariantCulture); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + int? value = (content == "null") ? ((int?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs index fb368f8ef33..d9c3cf72cbd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString().TrimStart(''), "c"); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs index 9229cc2065f..d3f255bbac3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,6 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().TrimStart('') == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString().TrimStart(''), "c"); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From ca77e1dcac19c4e7d60fdacacd169f7a5807af86 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 21:26:58 +0000 Subject: [PATCH 13/47] fix(http-client-csharp): fix unreachable text/plain conversion for excluded scalar types Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 12 +++++++++++- .../Providers/ScmMethodProviderCollectionTests.cs | 6 ++++++ .../PlainTextScalarReturnTypeMethods(Byte).cs | 7 +++++++ .../PlainTextScalarReturnTypeMethods(SByte).cs | 7 +++++++ .../PlainTextScalarReturnTypeMethods(Uri).cs | 7 +++++++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 88ab08c8ecd..c5a82773746 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -297,7 +297,7 @@ .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out va .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out var paramDeclarations), Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result), .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations), - IsConvertibleFromBinaryData(responseBodyType) + ShouldUseResultConversionStatements(responseBodyType) ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] @@ -1013,6 +1013,16 @@ private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) type.Equals(typeof(Guid?)); } + // Text/plain primitive and enum responses are parsed directly from the response content, bypassing the + // BinaryData/JsonDocument conversion path entirely. Route them through GetResultConversionStatements even + // when the response body type isn't in the IsConvertibleFromBinaryData allow-list (e.g. Guid, Uri, or the + // byte/short/unsigned integer types), otherwise they would incorrectly fall back to JSON parsing. + private bool ShouldUseResultConversionStatements(CSharpType responseBodyType) + { + return IsConvertibleFromBinaryData(responseBodyType) + || ((responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && HasOnlyPlainTextContentType()); + } + private static bool IsConvertibleFromBinaryData(CSharpType type) { if (type.Equals(typeof(BinaryData))) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index eb417a075f0..9e34f8bb6fc 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1678,6 +1678,9 @@ public void PlainTextReturnTypeMethods() [TestCase(typeof(TimeSpan))] [TestCase(typeof(TimeSpan?))] [TestCase(typeof(DateTimeOffset))] + [TestCase(typeof(Uri))] + [TestCase(typeof(byte))] + [TestCase(typeof(sbyte))] public void PlainTextScalarReturnTypeMethods(Type type) { var underlyingType = Nullable.GetUnderlyingType(type); @@ -1687,6 +1690,9 @@ public void PlainTextScalarReturnTypeMethods(Type type) { } t when t == typeof(bool) => InputPrimitiveType.Boolean, { } t when t == typeof(TimeSpan) => InputPrimitiveType.PlainTime, { } t when t == typeof(DateTimeOffset) => InputPrimitiveType.PlainDate, + { } t when t == typeof(Uri) => InputPrimitiveType.Url, + { } t when t == typeof(byte) => new InputPrimitiveType(InputPrimitiveTypeKind.UInt8, "uint8", "TypeSpec.uint8"), + { } t when t == typeof(sbyte) => new InputPrimitiveType(InputPrimitiveTypeKind.Int8, "int8", "TypeSpec.int8"), _ => throw new NotSupportedException() }; if (underlyingType != null) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs new file mode 100644 index 00000000000..0f2787434cd --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + byte value = byte.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs new file mode 100644 index 00000000000..59c32d7181d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + sbyte value = sbyte.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs new file mode 100644 index 00000000000..0df7aa47628 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.Uri value = new global::System.Uri(content); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From 26058cc6c86c4142d0b1c1e6376e84b987be1e72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 21:43:51 +0000 Subject: [PATCH 14/47] refactor(http-client-csharp): inline single-use ShouldUseResultConversionStatements helper Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index c5a82773746..ad7248cc6ab 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -297,7 +297,12 @@ .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out va .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out var paramDeclarations), Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result), .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations), - ShouldUseResultConversionStatements(responseBodyType) + // Text/plain primitive and enum responses are parsed directly from the response content, bypassing the + // BinaryData/JsonDocument conversion path entirely. Route them through GetResultConversionStatements even + // when the response body type isn't in the IsConvertibleFromBinaryData allow-list (e.g. Guid, Uri, or the + // byte/short/unsigned integer types), otherwise they would incorrectly fall back to JSON parsing. + IsConvertibleFromBinaryData(responseBodyType) + || ((responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && HasOnlyPlainTextContentType()) ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] @@ -1013,16 +1018,6 @@ private static bool ShouldBuildStackVarForFrameworkType(CSharpType type) type.Equals(typeof(Guid?)); } - // Text/plain primitive and enum responses are parsed directly from the response content, bypassing the - // BinaryData/JsonDocument conversion path entirely. Route them through GetResultConversionStatements even - // when the response body type isn't in the IsConvertibleFromBinaryData allow-list (e.g. Guid, Uri, or the - // byte/short/unsigned integer types), otherwise they would incorrectly fall back to JSON parsing. - private bool ShouldUseResultConversionStatements(CSharpType responseBodyType) - { - return IsConvertibleFromBinaryData(responseBodyType) - || ((responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && HasOnlyPlainTextContentType()); - } - private static bool IsConvertibleFromBinaryData(CSharpType type) { if (type.Equals(typeof(BinaryData))) From f7cd15f7446997a238f994044e3f2219a1a0034c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Sep 2026 22:46:16 +0000 Subject: [PATCH 15/47] chore(http-client-csharp): regenerate Sample-TypeSpec test project Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 58eac4ed6dd..e516a3707e6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -1086,7 +1086,8 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); return ClientResult.FromValue(value, result.GetRawResponse()); } @@ -1096,7 +1097,8 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString().TrimStart('')); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); return ClientResult.FromValue(value, result.GetRawResponse()); } From 59cd7789a3e9e8c0630a345ccbecb902536a8b27 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:39:56 +0000 Subject: [PATCH 16/47] fix(http-client-csharp): restrict raw text response parsing to primitive and enum types Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 79 +++++++++++++------ .../ScmMethodProviderCollectionTests.cs | 33 ++++++++ ...sPreserveExistingConversion(BinaryData).cs | 5 ++ ...sPreserveExistingConversion(Dictionary).cs | 19 +++++ ...sponsesPreserveExistingConversion(List).cs | 17 ++++ ...ponsesPreserveExistingConversion(Model).cs | 5 ++ 6 files changed, 133 insertions(+), 25 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(BinaryData).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Dictionary).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(List).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Model).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index ad7248cc6ab..ef794a60a42 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -302,7 +302,7 @@ .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, // when the response body type isn't in the IsConvertibleFromBinaryData allow-list (e.g. Guid, Uri, or the // byte/short/unsigned integer types), otherwise they would incorrectly fall back to JSON parsing. IsConvertibleFromBinaryData(responseBodyType) - || ((responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && HasOnlyPlainTextContentType()) + || (IsPlainTextParsableType(responseBodyType) && HasOnlyPlainTextContentType()) ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] @@ -864,7 +864,7 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { - if (!responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()) + if (!responseBodyType.Equals(typeof(string)) && IsPlainTextParsableType(responseBodyType) && HasOnlyPlainTextContentType()) { var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); return @@ -931,17 +931,11 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, ValueExpression content) { - var nonNullableType = responseBodyType.WithNullable(false); - var typeToDeserialize = nonNullableType; - CSharpType? enumType = null; - if (nonNullableType is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) - { - enumType = nonNullableType; - typeToDeserialize = underlyingEnumType; - } + var parseType = GetPlainTextParseType(responseBodyType, out var enumType) + ?? throw new InvalidOperationException($"Unsupported plain text response type: {responseBodyType}."); var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); - var deserializedValue = typeToDeserialize.FrameworkType switch + var deserializedValue = parseType switch { Type t when t == typeof(string) => content, Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), @@ -949,20 +943,8 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(GetResponseSerializationFormat().ToFormatSpecifier())), - Type frameworkType when typeToDeserialize.IsFrameworkType - && (frameworkType == typeof(byte) - || frameworkType == typeof(sbyte) - || frameworkType == typeof(short) - || frameworkType == typeof(ushort) - || frameworkType == typeof(int) - || frameworkType == typeof(uint) - || frameworkType == typeof(long) - || frameworkType == typeof(ulong) - || frameworkType == typeof(float) - || frameworkType == typeof(double) - || frameworkType == typeof(decimal)) - => Static(frameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(frameworkType), - _ => Static(typeToDeserialize.FrameworkType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(typeToDeserialize.FrameworkType) + // The remaining supported types are numeric and all expose a static Parse(string, IFormatProvider) method. + _ => Static(parseType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(parseType) }; if (enumType is not null) @@ -975,6 +957,53 @@ Type frameworkType when typeToDeserialize.IsFrameworkType : deserializedValue; } + private static bool IsPlainTextParsableType(CSharpType responseBodyType) + => GetPlainTextParseType(responseBodyType, out _) is not null; + + /// + /// Gets the framework type that a raw text response body is parsed into, or null when the response body + /// type isn't a primitive or enum that can be parsed from raw text. Types such as , + /// collections and generated models keep their existing conversion. + /// + private static Type? GetPlainTextParseType(CSharpType responseBodyType, out CSharpType? enumType) + { + enumType = null; + var typeToParse = responseBodyType.WithNullable(false); + if (typeToParse is { IsEnum: true, UnderlyingEnumType: { } underlyingEnumType }) + { + enumType = typeToParse; + typeToParse = underlyingEnumType; + } + + if (!typeToParse.IsFrameworkType) + { + return null; + } + + var frameworkType = typeToParse.FrameworkType; + return frameworkType switch + { + Type t when t == typeof(string) + || t == typeof(bool) + || t == typeof(Guid) + || t == typeof(Uri) + || t == typeof(TimeSpan) + || t == typeof(DateTimeOffset) + || t == typeof(byte) + || t == typeof(sbyte) + || t == typeof(short) + || t == typeof(ushort) + || t == typeof(int) + || t == typeof(uint) + || t == typeof(long) + || t == typeof(ulong) + || t == typeof(float) + || t == typeof(double) + || t == typeof(decimal) => frameworkType, + _ => null + }; + } + private bool HasOnlyPlainTextContentType() { var contentTypes = ServiceMethod.Operation.Responses diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 9e34f8bb6fc..ff20c62cf10 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1749,6 +1749,39 @@ public void PlainTextEnumReturnTypeMethods(bool isString, bool isExtensible, boo Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), writer.ToString(false)); } + [TestCase("BinaryData")] + [TestCase("Model")] + [TestCase("List")] + [TestCase("Dictionary")] + public void PlainTextSpecialCaseResponsesPreserveExistingConversion(string kind) + { + // Raw binary, generated model and collection responses are not parsed from raw text even when text/plain + // is their only content type, they keep their existing conversion. + InputType inputType = kind switch + { + "BinaryData" => InputPrimitiveType.Any, + "Model" => InputFactory.Model("TestModel", properties: + [InputFactory.Property("name", InputPrimitiveType.String, isRequired: true)]), + "List" => InputFactory.Array(InputPrimitiveType.Int32), + "Dictionary" => InputFactory.Dictionary(InputPrimitiveType.Int32), + _ => throw new NotSupportedException() + }; + + var operation = InputFactory.Operation("GetSpecialCase", responses: + [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetSpecialCase", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetSpecialCase"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(kind), writer.ToString(false)); + } + [Test] public void MixedContentTypeScalarResponseUsesJsonConversion() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(BinaryData).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(BinaryData).cs new file mode 100644 index 00000000000..887f2fc78ac --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(BinaryData).cs @@ -0,0 +1,5 @@ +public virtual global::System.ClientModel.ClientResult GetSpecialCase(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetSpecialCase(cancellationToken.ToRequestOptions()); + return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Dictionary).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Dictionary).cs new file mode 100644 index 00000000000..38cd0036aa4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Dictionary).cs @@ -0,0 +1,19 @@ +public virtual global::System.ClientModel.ClientResult> GetSpecialCase(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetSpecialCase(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.IDictionary value = new global::System.Collections.Generic.Dictionary(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndObject)) + { + break; + } + string propertyName = jsonReader.GetString(); + jsonReader.Read(); + value.Add(propertyName, jsonReader.GetInt32()); + } + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyDictionary)value), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(List).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(List).cs new file mode 100644 index 00000000000..e5c154635df --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(List).cs @@ -0,0 +1,17 @@ +public virtual global::System.ClientModel.ClientResult> GetSpecialCase(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetSpecialCase(cancellationToken.ToRequestOptions()); + global::System.Collections.Generic.List value = new global::System.Collections.Generic.List(); + global::System.BinaryData data = result.GetRawResponse().Content; + global::System.Text.Json.Utf8JsonReader jsonReader = new global::System.Text.Json.Utf8JsonReader(data.ToMemory().Span); + jsonReader.Read(); + while (jsonReader.Read()) + { + if ((jsonReader.TokenType == global::System.Text.Json.JsonTokenType.EndArray)) + { + break; + } + value.Add(jsonReader.GetInt32()); + } + return global::System.ClientModel.ClientResult.FromValue(((global::System.Collections.Generic.IReadOnlyList)value), result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Model).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Model).cs new file mode 100644 index 00000000000..bd099dc8b94 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextSpecialCaseResponsesPreserveExistingConversion(Model).cs @@ -0,0 +1,5 @@ +public virtual global::System.ClientModel.ClientResult GetSpecialCase(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetSpecialCase(cancellationToken.ToRequestOptions()); + return global::System.ClientModel.ClientResult.FromValue(((global::Sample.Models.TestModel)result), result.GetRawResponse()); +} From 46fc557ff115c12fb3bff85543327950e27a2351 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:44:10 +0000 Subject: [PATCH 17/47] fix(http-client-csharp): allow relative URIs in plain text response parsing Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 2 +- .../PlainTextScalarReturnTypeMethods(Uri).cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index ef794a60a42..aaaa27e855a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -940,7 +940,7 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, Type t when t == typeof(string) => content, Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), - Type t when t == typeof(Uri) => New.Instance(typeof(Uri), content), + Type t when t == typeof(Uri) => New.Instance(content, FrameworkEnumValue(UriKind.RelativeOrAbsolute)), Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(GetResponseSerializationFormat().ToFormatSpecifier())), // The remaining supported types are numeric and all expose a static Parse(string, IFormatProvider) method. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs index 0df7aa47628..e657b2b0bb5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.Uri value = new global::System.Uri(content); + global::System.Uri value = new global::System.Uri(content, global::System.UriKind.RelativeOrAbsolute); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From 30b94133dfb92db7677cdb45f4626df22b4baf56 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:57:32 +0000 Subject: [PATCH 18/47] fix(http-client-csharp): return null for unsupported plain text conversions Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index aaaa27e855a..36661fea3be 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -867,12 +867,16 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re if (!responseBodyType.Equals(typeof(string)) && IsPlainTextParsableType(responseBodyType) && HasOnlyPlainTextContentType()) { var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); - return - [ - Declare("content", typeof(string), contentExpression, out var content), - Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, content), out var value), - Return(result.FromValue(value, response)) - ]; + var contentDeclaration = Declare("content", typeof(string), contentExpression, out var content); + if (GetPlainTextValueConversion(responseBodyType, content) is { } valueExpression) + { + return + [ + contentDeclaration, + Declare("value", responseBodyType, valueExpression, out var value), + Return(result.FromValue(value, response)) + ]; + } } var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) @@ -929,10 +933,13 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon return result.CastTo(responseBodyType); } - private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, ValueExpression content) + private ValueExpression? GetPlainTextValueConversion(CSharpType responseBodyType, ValueExpression content) { - var parseType = GetPlainTextParseType(responseBodyType, out var enumType) - ?? throw new InvalidOperationException($"Unsupported plain text response type: {responseBodyType}."); + var parseType = GetPlainTextParseType(responseBodyType, out var enumType); + if (parseType is null) + { + return null; + } var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); var deserializedValue = parseType switch From de7abee1d3fdfdc3b09aef5f0cfe03cc3990d42d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 22:58:56 +0000 Subject: [PATCH 19/47] refactor(http-client-csharp): resolve plain text parser before content Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 36661fea3be..4e3c070c9a3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -864,19 +864,16 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) { - if (!responseBodyType.Equals(typeof(string)) && IsPlainTextParsableType(responseBodyType) && HasOnlyPlainTextContentType()) + var plainTextParseType = GetPlainTextParseType(responseBodyType, out var enumType); + if (!responseBodyType.Equals(typeof(string)) && plainTextParseType is not null && HasOnlyPlainTextContentType()) { var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); - var contentDeclaration = Declare("content", typeof(string), contentExpression, out var content); - if (GetPlainTextValueConversion(responseBodyType, content) is { } valueExpression) - { - return - [ - contentDeclaration, - Declare("value", responseBodyType, valueExpression, out var value), - Return(result.FromValue(value, response)) - ]; - } + return + [ + Declare("content", typeof(string), contentExpression, out var content), + Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, plainTextParseType, enumType, content), out var value), + Return(result.FromValue(value, response)) + ]; } var isSpecialCaseType = responseBodyType.Equals(typeof(BinaryData)) @@ -933,14 +930,8 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon return result.CastTo(responseBodyType); } - private ValueExpression? GetPlainTextValueConversion(CSharpType responseBodyType, ValueExpression content) + private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, Type parseType, CSharpType? enumType, ValueExpression content) { - var parseType = GetPlainTextParseType(responseBodyType, out var enumType); - if (parseType is null) - { - return null; - } - var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); var deserializedValue = parseType switch { From cd41087c9e00a39e9768e6fbea8879f1c6004d03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:11:20 +0000 Subject: [PATCH 20/47] test(http-client-csharp): avoid FEFF token in Local extensible enum test Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../TestProjects/Local.Tests/ExtensibleEnumTests.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 2e58189ccf3..30b94d70932 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// cspell:ignore FEFF - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -24,7 +22,8 @@ public class ExtensibleEnumTests [TestCase(true, true)] public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) { - var content = BinaryData.FromString((hasBom ? "\uFEFF" : "") + "Monday"); + var bom = hasBom ? char.ConvertFromUtf32(65279) : string.Empty; + var content = BinaryData.FromString(bom + "Monday"); var response = new Mock(); response.SetupGet(r => r.Content).Returns(content); var protocolResult = ClientResult.FromResponse(response.Object); From 2c5ad788e9b5450e8b8fcc081d09dc39e57a4ae9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:12:07 +0000 Subject: [PATCH 21/47] test(http-client-csharp): build BOM prefix from UTF-8 preamble Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 30b94d70932..6874e0fdbd4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Text; using System.Threading.Tasks; using Moq; using NUnit.Framework; @@ -22,7 +23,7 @@ public class ExtensibleEnumTests [TestCase(true, true)] public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) { - var bom = hasBom ? char.ConvertFromUtf32(65279) : string.Empty; + var bom = hasBom ? Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) : string.Empty; var content = BinaryData.FromString(bom + "Monday"); var response = new Mock(); response.SetupGet(r => r.Content).Returns(content); From 22c6a9d5c8d6c636ee31257644300f06e8fff40b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:12:24 +0000 Subject: [PATCH 22/47] fix(http-client-csharp): trim plain-text content before null-sentinel comparison Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 2 +- .../PlainTextEnumReturnTypeMethods(False,False,True).cs | 2 +- .../PlainTextEnumReturnTypeMethods(False,True,True).cs | 2 +- .../PlainTextEnumReturnTypeMethods(True,False,True).cs | 2 +- .../PlainTextEnumReturnTypeMethods(True,True,True).cs | 2 +- .../PlainTextScalarReturnTypeMethods(BooleanNullable).cs | 2 +- .../PlainTextScalarReturnTypeMethods(Int32Nullable).cs | 2 +- .../PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 4e3c070c9a3..9f7489905f3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -951,7 +951,7 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, } return responseBodyType.IsNullable - ? new TernaryConditionalExpression(content.Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) + ? new TernaryConditionalExpression(content.Invoke(nameof(string.Trim)).As().Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) : deserializedValue; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs index 50c6b59e268..972e902f810 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs index d64c68f1027..3fadb9f4cc3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs index d2a202f6cfd..32773d0b10c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : content.ToTestEnum(); + global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : content.ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs index 623779b8b72..99ffd919910 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(content); + global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs index ca99c0f17d5..99144f3d66d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - bool? value = (content == "null") ? ((bool?)null) : bool.Parse(content); + bool? value = (content.Trim() == "null") ? ((bool?)null) : bool.Parse(content); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs index 7effa4ebe9c..19ce9ffe81b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - int? value = (content == "null") ? ((int?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + int? value = (content.Trim() == "null") ? ((int?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs index d3f255bbac3..a829e291f20 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From c541f53c1b1941c3c3c043405c2e517dffe60235 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:20:14 +0000 Subject: [PATCH 23/47] fix(http-client-csharp): honor duration wire encoding in plain-text TimeSpan parsing Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 30 +++++++++++++++++- .../ScmMethodProviderCollectionTests.cs | 31 +++++++++++++++++++ ...TextDurationReturnTypeMethods(Constant).cs | 7 +++++ ...nTextDurationReturnTypeMethods(Iso8601).cs | 7 +++++ ...DurationReturnTypeMethods(Milliseconds).cs | 7 +++++ ...nTextDurationReturnTypeMethods(Seconds).cs | 7 +++++ ...inTextScalarReturnTypeMethods(TimeSpan).cs | 2 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 2 +- 8 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 9f7489905f3..6bd7aabf66c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -939,7 +939,7 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, Type t when t == typeof(bool) => Static().Invoke(nameof(bool.Parse), content).As(), Type t when t == typeof(Guid) => Static().Invoke(nameof(Guid.Parse), content).As(), Type t when t == typeof(Uri) => New.Instance(content, FrameworkEnumValue(UriKind.RelativeOrAbsolute)), - Type t when t == typeof(TimeSpan) => content.As().ParseTimeSpan(Literal(SerializationFormat.Duration_Constant.ToFormatSpecifier() ?? throw new InvalidOperationException())), + Type t when t == typeof(TimeSpan) => GetPlainTextTimeSpanConversion(content, invariantCulture), Type t when t == typeof(DateTimeOffset) => content.As().ParseDateTimeOffset(Literal(GetResponseSerializationFormat().ToFormatSpecifier())), // The remaining supported types are numeric and all expose a static Parse(string, IFormatProvider) method. _ => Static(parseType).Invoke(nameof(int.Parse), [content, invariantCulture]).As(parseType) @@ -955,6 +955,34 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, : deserializedValue; } + /// + /// Builds the raw-text conversion for a response, honoring the response body's wire + /// encoding. Numeric duration encodings (seconds/milliseconds) parse the content as a number and construct + /// the from it, matching 's JSON handling; + /// all other encodings (ISO 8601, constant, plain time) parse the content directly using the corresponding + /// format specifier. + /// + private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, ValueExpression invariantCulture) + { + var format = GetResponseSerializationFormat(); + return format switch + { + SerializationFormat.Duration_Seconds => + TimeSpanSnippets.FromSeconds(Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As()), + SerializationFormat.Duration_Seconds_Int64 => + TimeSpanSnippets.FromSeconds(LongSnippets.Parse(content, invariantCulture)), + SerializationFormat.Duration_Seconds_Float or SerializationFormat.Duration_Seconds_Double => + TimeSpanSnippets.FromSeconds(Static().Invoke(nameof(double.Parse), [content, invariantCulture]).As()), + SerializationFormat.Duration_Milliseconds => + TimeSpanSnippets.FromMilliseconds(Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As()), + SerializationFormat.Duration_Milliseconds_Int64 => + TimeSpanSnippets.FromMilliseconds(LongSnippets.Parse(content, invariantCulture)), + SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => + TimeSpanSnippets.FromMilliseconds(Static().Invoke(nameof(double.Parse), [content, invariantCulture]).As()), + _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? SerializationFormat.Duration_Constant.ToFormatSpecifier())) + }; + } + private static bool IsPlainTextParsableType(CSharpType responseBodyType) => GetPlainTextParseType(responseBodyType, out _) is not null; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index ff20c62cf10..5b70ea86129 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1716,6 +1716,37 @@ public void PlainTextScalarReturnTypeMethods(Type type) Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } + [TestCase("Iso8601")] + [TestCase("Constant")] + [TestCase("Seconds")] + [TestCase("Milliseconds")] + public void PlainTextDurationReturnTypeMethods(string encoding) + { + DurationKnownEncoding durationEncoding = encoding switch + { + "Iso8601" => DurationKnownEncoding.Iso8601, + "Constant" => DurationKnownEncoding.Constant, + "Seconds" => DurationKnownEncoding.Seconds, + "Milliseconds" => DurationKnownEncoding.Milliseconds, + _ => throw new NotSupportedException() + }; + InputType inputType = new InputDurationType(durationEncoding, "duration", "TypeSpec.duration", InputPrimitiveType.Int32, null); + + var operation = InputFactory.Operation("GetPlainTextDuration", responses: + [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextDuration", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(encoding), writer.ToString(false)); + } + [TestCase(true, true, false)] [TestCase(true, false, false)] [TestCase(false, true, false)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs new file mode 100644 index 00000000000..b67c8f1613f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs new file mode 100644 index 00000000000..0725410f59b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "P"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs new file mode 100644 index 00000000000..9a0394de94b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs new file mode 100644 index 00000000000..1effae407a0 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs index d9c3cf72cbd..f8786805243 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs index a829e291f20..a3debf5c6f5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -2,6 +2,6 @@ { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From d44785e1e92f785351ffa085dff2e37a7ea52b36 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:24:47 +0000 Subject: [PATCH 24/47] test(http-client-csharp): expand duration wire-encoding coverage to Int64/Float32/Float64 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 4 +++- .../ScmMethodProviderCollectionTests.cs | 24 +++++++++++++------ ...nReturnTypeMethods(MillisecondsFloat32).cs | 7 ++++++ ...nReturnTypeMethods(MillisecondsFloat64).cs | 7 ++++++ ...onReturnTypeMethods(MillisecondsInt32).cs} | 0 ...ionReturnTypeMethods(MillisecondsInt64).cs | 7 ++++++ ...rationReturnTypeMethods(SecondsFloat32).cs | 7 ++++++ ...rationReturnTypeMethods(SecondsFloat64).cs | 7 ++++++ ...urationReturnTypeMethods(SecondsInt32).cs} | 0 ...DurationReturnTypeMethods(SecondsInt64).cs | 7 ++++++ 10 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextDurationReturnTypeMethods(Milliseconds).cs => PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/{PlainTextDurationReturnTypeMethods(Seconds).cs => PlainTextDurationReturnTypeMethods(SecondsInt32).cs} (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 6bd7aabf66c..bbcec033448 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -979,7 +979,9 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, TimeSpanSnippets.FromMilliseconds(LongSnippets.Parse(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => TimeSpanSnippets.FromMilliseconds(Static().Invoke(nameof(double.Parse), [content, invariantCulture]).As()), - _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? SerializationFormat.Duration_Constant.ToFormatSpecifier())) + // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; + // fall back to the constant format specifier for the (practically unreachable) default case. + _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? "c")) }; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 5b70ea86129..87e3440ee87 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1716,11 +1716,17 @@ public void PlainTextScalarReturnTypeMethods(Type type) Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } - [TestCase("Iso8601")] - [TestCase("Constant")] - [TestCase("Seconds")] - [TestCase("Milliseconds")] - public void PlainTextDurationReturnTypeMethods(string encoding) + [TestCase("Iso8601", null)] + [TestCase("Constant", null)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int32)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int64)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float32)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float64)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int32)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int64)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64)] + public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind) { DurationKnownEncoding durationEncoding = encoding switch { @@ -1730,7 +1736,10 @@ public void PlainTextDurationReturnTypeMethods(string encoding) "Milliseconds" => DurationKnownEncoding.Milliseconds, _ => throw new NotSupportedException() }; - InputType inputType = new InputDurationType(durationEncoding, "duration", "TypeSpec.duration", InputPrimitiveType.Int32, null); + var wireType = wireKind is { } kind + ? new InputPrimitiveType(kind, kind.ToString()!.ToLowerInvariant(), $"TypeSpec.{kind.ToString()!.ToLowerInvariant()}") + : InputPrimitiveType.Int32; + InputType inputType = new InputDurationType(durationEncoding, "duration", "TypeSpec.duration", wireType, null); var operation = InputFactory.Operation("GetPlainTextDuration", responses: [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); @@ -1744,7 +1753,8 @@ public void PlainTextDurationReturnTypeMethods(string encoding) using var writer = new CodeWriter(); writer.WriteMethod(method); - Assert.AreEqual(Helpers.GetExpectedFromFile(encoding), writer.ToString(false)); + var baselineName = wireKind is { } k ? $"{encoding}{k}" : encoding; + Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } [TestCase(true, true, false)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs new file mode 100644 index 00000000000..b409ec033c1 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs new file mode 100644 index 00000000000..b409ec033c1 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Milliseconds).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs new file mode 100644 index 00000000000..293a46a6697 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs new file mode 100644 index 00000000000..023e5e55402 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs new file mode 100644 index 00000000000..023e5e55402 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Seconds).cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs new file mode 100644 index 00000000000..f0be3cce208 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From bfd606d206323fcad7600cb6ee1583163fa02cee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:27:42 +0000 Subject: [PATCH 25/47] refactor(http-client-csharp): extract ParseNumeric helper and add nullable duration test coverage Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 17 ++++++++--- .../ScmMethodProviderCollectionTests.cs | 29 +++++++++++-------- ...ReturnTypeMethods(SecondsInt32Nullable).cs | 7 +++++ 3 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index bbcec033448..fcb31b76d6b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -968,23 +968,32 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, return format switch { SerializationFormat.Duration_Seconds => - TimeSpanSnippets.FromSeconds(Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As()), + TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Seconds_Int64 => TimeSpanSnippets.FromSeconds(LongSnippets.Parse(content, invariantCulture)), SerializationFormat.Duration_Seconds_Float or SerializationFormat.Duration_Seconds_Double => - TimeSpanSnippets.FromSeconds(Static().Invoke(nameof(double.Parse), [content, invariantCulture]).As()), + TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds => - TimeSpanSnippets.FromMilliseconds(Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As()), + TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Int64 => TimeSpanSnippets.FromMilliseconds(LongSnippets.Parse(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => - TimeSpanSnippets.FromMilliseconds(Static().Invoke(nameof(double.Parse), [content, invariantCulture]).As()), + TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; // fall back to the constant format specifier for the (practically unreachable) default case. _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? "c")) }; } + /// + /// Builds a T.Parse(content, invariantCulture) invocation for the given numeric . + /// + private static ScopedApi ParseNumeric(ValueExpression content, ValueExpression invariantCulture) + where T : struct + { + return Static().Invoke("Parse", [content, invariantCulture]).As(); + } + private static bool IsPlainTextParsableType(CSharpType responseBodyType) => GetPlainTextParseType(responseBodyType, out _) is not null; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 87e3440ee87..06f871c452e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1716,17 +1716,18 @@ public void PlainTextScalarReturnTypeMethods(Type type) Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } - [TestCase("Iso8601", null)] - [TestCase("Constant", null)] - [TestCase("Seconds", InputPrimitiveTypeKind.Int32)] - [TestCase("Seconds", InputPrimitiveTypeKind.Int64)] - [TestCase("Seconds", InputPrimitiveTypeKind.Float32)] - [TestCase("Seconds", InputPrimitiveTypeKind.Float64)] - [TestCase("Milliseconds", InputPrimitiveTypeKind.Int32)] - [TestCase("Milliseconds", InputPrimitiveTypeKind.Int64)] - [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32)] - [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64)] - public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind) + [TestCase("Iso8601", null, false)] + [TestCase("Constant", null, false)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int32, false)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int64, false)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float32, false)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float64, false)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int32, false)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int64, false)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32, false)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, false)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] + public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind, bool isNullable) { DurationKnownEncoding durationEncoding = encoding switch { @@ -1740,6 +1741,10 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy ? new InputPrimitiveType(kind, kind.ToString()!.ToLowerInvariant(), $"TypeSpec.{kind.ToString()!.ToLowerInvariant()}") : InputPrimitiveType.Int32; InputType inputType = new InputDurationType(durationEncoding, "duration", "TypeSpec.duration", wireType, null); + if (isNullable) + { + inputType = new InputNullableType(inputType); + } var operation = InputFactory.Operation("GetPlainTextDuration", responses: [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); @@ -1753,7 +1758,7 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy using var writer = new CodeWriter(); writer.WriteMethod(method); - var baselineName = wireKind is { } k ? $"{encoding}{k}" : encoding; + var baselineName = (wireKind is { } k ? $"{encoding}{k}" : encoding) + (isNullable ? "Nullable" : string.Empty); Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs new file mode 100644 index 00000000000..365537f1083 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From edecbdf912d8a48f21fd91f905cbbed0487a040e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:29:44 +0000 Subject: [PATCH 26/47] test(http-client-csharp): add Iso8601 nullable duration case, use nameof for Parse method name Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 2 +- .../test/Providers/ScmMethodProviderCollectionTests.cs | 1 + .../PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index fcb31b76d6b..a3e56dbb22d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -991,7 +991,7 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, private static ScopedApi ParseNumeric(ValueExpression content, ValueExpression invariantCulture) where T : struct { - return Static().Invoke("Parse", [content, invariantCulture]).As(); + return Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As(); } private static bool IsPlainTextParsableType(CSharpType responseBodyType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 06f871c452e..1189a2ea91f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1727,6 +1727,7 @@ public void PlainTextScalarReturnTypeMethods(Type type) [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32, false)] [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, false)] [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] + [TestCase("Iso8601", null, true)] public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind, bool isNullable) { DurationKnownEncoding durationEncoding = encoding switch diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs new file mode 100644 index 00000000000..1f60b8012ac --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "P"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From c45a1417b42679a4ad1f40336a19a437fd5f8846 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:31:58 +0000 Subject: [PATCH 27/47] docs(http-client-csharp): clarify duration float/double parsing intent, expand nullable coverage Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 5 +++++ .../test/Providers/ScmMethodProviderCollectionTests.cs | 3 +++ ...PlainTextDurationReturnTypeMethods(ConstantNullable).cs | 7 +++++++ ...rationReturnTypeMethods(MillisecondsFloat64Nullable).cs | 7 +++++++ ...nTextDurationReturnTypeMethods(SecondsInt64Nullable).cs | 7 +++++++ 5 files changed, 29 insertions(+) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index a3e56dbb22d..5dd82952c15 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -972,12 +972,15 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Seconds_Int64 => TimeSpanSnippets.FromSeconds(LongSnippets.Parse(content, invariantCulture)), SerializationFormat.Duration_Seconds_Float or SerializationFormat.Duration_Seconds_Double => + // Float and Double wire encodings are intentionally collapsed to a single double.Parse, + // matching MrwSerializationTypeDefinition's JSON path, which uses GetDouble() for both. TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds => TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Int64 => TimeSpanSnippets.FromMilliseconds(LongSnippets.Parse(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => + // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; // fall back to the constant format specifier for the (practically unreachable) default case. @@ -991,6 +994,8 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, private static ScopedApi ParseNumeric(ValueExpression content, ValueExpression invariantCulture) where T : struct { + // "Parse" is the static method name on every numeric type this is instantiated with (int, long, double); + // nameof(int.Parse) is used to keep the literal refactor-safe. return Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As(); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 1189a2ea91f..5949ff938c1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1728,6 +1728,9 @@ public void PlainTextScalarReturnTypeMethods(Type type) [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, false)] [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] [TestCase("Iso8601", null, true)] + [TestCase("Constant", null, true)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int64, true)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, true)] public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind, bool isNullable) { DurationKnownEncoding durationEncoding = encoding switch diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs new file mode 100644 index 00000000000..73d84d2e0c2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs new file mode 100644 index 00000000000..c563f8434c5 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs new file mode 100644 index 00000000000..717d685be14 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From feb55b21711f17dc22ea64040ba10e28c6a25568 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:33:10 +0000 Subject: [PATCH 28/47] refactor(http-client-csharp): use string trim snippet Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 2 +- .../src/Snippets/StringSnippets.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 5dd82952c15..df14063aa72 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -951,7 +951,7 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, } return responseBodyType.IsNullable - ? new TernaryConditionalExpression(content.Invoke(nameof(string.Trim)).As().Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) + ? new TernaryConditionalExpression(content.As().Trim().Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) : deserializedValue; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/StringSnippets.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/StringSnippets.cs index 41a9b42a01e..9850d18d12e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/StringSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/StringSnippets.cs @@ -33,6 +33,9 @@ public static ValueExpression Split(this ScopedApi stringExpression, Val public static ScopedApi Substring(this ScopedApi stringExpression, ValueExpression startIndex) => stringExpression.Invoke(nameof(string.Substring), [startIndex], null, false).As(); + public static ScopedApi Trim(this ScopedApi stringExpression) + => stringExpression.Invoke(nameof(string.Trim)).As(); + public static ValueExpression ToCharArray(this ScopedApi stringExpression) => stringExpression.Invoke(nameof(string.ToCharArray), Array.Empty(), null, false); From ba43450a5e65b2ca0d0cbb871deef0eb0fc50bd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:33:26 +0000 Subject: [PATCH 29/47] refactor(http-client-csharp): unify Int64 duration parsing through ParseNumeric helper Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index df14063aa72..74c10816563 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -970,7 +970,7 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Seconds => TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Seconds_Int64 => - TimeSpanSnippets.FromSeconds(LongSnippets.Parse(content, invariantCulture)), + TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Seconds_Float or SerializationFormat.Duration_Seconds_Double => // Float and Double wire encodings are intentionally collapsed to a single double.Parse, // matching MrwSerializationTypeDefinition's JSON path, which uses GetDouble() for both. @@ -978,7 +978,7 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Milliseconds => TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Int64 => - TimeSpanSnippets.FromMilliseconds(LongSnippets.Parse(content, invariantCulture)), + TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), From 71a36dd1f40666ba8001249387bc27d823def7cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:34:29 +0000 Subject: [PATCH 30/47] test(http-client-csharp): reorder nullable duration test cases for readability Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../test/Providers/ScmMethodProviderCollectionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 5949ff938c1..bfed696c59c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1726,9 +1726,9 @@ public void PlainTextScalarReturnTypeMethods(Type type) [TestCase("Milliseconds", InputPrimitiveTypeKind.Int64, false)] [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32, false)] [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, false)] - [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] [TestCase("Iso8601", null, true)] [TestCase("Constant", null, true)] + [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] [TestCase("Seconds", InputPrimitiveTypeKind.Int64, true)] [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, true)] public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind, bool isNullable) From 6fc56266178ccde40ee162a4e3ce9eec301d71fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:36:09 +0000 Subject: [PATCH 31/47] refactor(http-client-csharp): unify numeric duration parsing Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 4 +--- .../test/Providers/ScmMethodProviderCollectionTests.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 74c10816563..ad30ec69202 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -994,9 +994,7 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, private static ScopedApi ParseNumeric(ValueExpression content, ValueExpression invariantCulture) where T : struct { - // "Parse" is the static method name on every numeric type this is instantiated with (int, long, double); - // nameof(int.Parse) is used to keep the literal refactor-safe. - return Static().Invoke(nameof(int.Parse), [content, invariantCulture]).As(); + return Static().Invoke("Parse", [content, invariantCulture]).As(); } private static bool IsPlainTextParsableType(CSharpType responseBodyType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index bfed696c59c..72f07940795 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1742,7 +1742,7 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy _ => throw new NotSupportedException() }; var wireType = wireKind is { } kind - ? new InputPrimitiveType(kind, kind.ToString()!.ToLowerInvariant(), $"TypeSpec.{kind.ToString()!.ToLowerInvariant()}") + ? new InputPrimitiveType(kind, kind.ToString().ToLowerInvariant(), $"TypeSpec.{kind.ToString().ToLowerInvariant()}") : InputPrimitiveType.Int32; InputType inputType = new InputDurationType(durationEncoding, "duration", "TypeSpec.duration", wireType, null); if (isNullable) From b47987167a876ff3096e469dcf1871b3dc8412a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:36:28 +0000 Subject: [PATCH 32/47] test(http-client-csharp): complete full nullable duration wire-encoding coverage Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../test/Providers/ScmMethodProviderCollectionTests.cs | 5 +++++ ...rationReturnTypeMethods(MillisecondsFloat32Nullable).cs | 7 +++++++ ...DurationReturnTypeMethods(MillisecondsInt32Nullable).cs | 7 +++++++ ...DurationReturnTypeMethods(MillisecondsInt64Nullable).cs | 7 +++++++ ...extDurationReturnTypeMethods(SecondsFloat32Nullable).cs | 7 +++++++ ...extDurationReturnTypeMethods(SecondsFloat64Nullable).cs | 7 +++++++ 6 files changed, 40 insertions(+) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 72f07940795..42e72a9bc5b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1730,6 +1730,11 @@ public void PlainTextScalarReturnTypeMethods(Type type) [TestCase("Constant", null, true)] [TestCase("Seconds", InputPrimitiveTypeKind.Int32, true)] [TestCase("Seconds", InputPrimitiveTypeKind.Int64, true)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float32, true)] + [TestCase("Seconds", InputPrimitiveTypeKind.Float64, true)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int32, true)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Int64, true)] + [TestCase("Milliseconds", InputPrimitiveTypeKind.Float32, true)] [TestCase("Milliseconds", InputPrimitiveTypeKind.Float64, true)] public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTypeKind? wireKind, bool isNullable) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs new file mode 100644 index 00000000000..c563f8434c5 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs new file mode 100644 index 00000000000..b1dfebeae4c --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs new file mode 100644 index 00000000000..1cc826ce0f2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs new file mode 100644 index 00000000000..27675746fa4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs new file mode 100644 index 00000000000..27675746fa4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} From 6a50498dd76afa926b8097676d8a5bca1b8aca6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:38:04 +0000 Subject: [PATCH 33/47] fix(http-client-csharp): reject unsupported duration formats Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index ad30ec69202..2a0d3f42332 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -982,9 +982,8 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; - // fall back to the constant format specifier for the (practically unreachable) default case. - _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? "c")) + // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. + _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? throw new InvalidOperationException($"Unsupported duration serialization format: {format}"))) }; } @@ -994,6 +993,7 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, private static ScopedApi ParseNumeric(ValueExpression content, ValueExpression invariantCulture) where T : struct { + // Static members on a generic type parameter cannot be referenced by nameof. return Static().Invoke("Parse", [content, invariantCulture]).As(); } From 8993f864df7e33b074e76d77db1b3244a456bb53 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:42:27 +0000 Subject: [PATCH 34/47] test(http-client-csharp): add negative test for unsupported duration encoding throw Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 4 +++- .../ScmMethodProviderCollectionTests.cs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 2a0d3f42332..b88c7fc9a46 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -982,7 +982,9 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. + // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; + // any other format (e.g. a custom/unrecognized duration encoding, which maps to + // SerializationFormat.Default and has no format specifier) is unsupported and throws. _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? throw new InvalidOperationException($"Unsupported duration serialization format: {format}"))) }; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 42e72a9bc5b..471f274de10 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1771,6 +1771,23 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } + [Test] + public void PlainTextDurationReturnTypeMethodsThrowsForUnsupportedEncoding() + { + InputType inputType = new InputDurationType(new DurationKnownEncoding("Custom"), "duration", "TypeSpec.duration", InputPrimitiveType.Int32, null); + + var operation = InputFactory.Operation("GetPlainTextDuration", responses: + [InputFactory.OperationResponse([200], inputType, contentTypes: ["text/plain"])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextDuration", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var methods = new ScmMethodProviderCollection(serviceMethod, client!); + Assert.Throws(() => + methods.Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration")); + } + [TestCase(true, true, false)] [TestCase(true, false, false)] [TestCase(false, true, false)] From b1270a9c1795765b385f8faf2cbe07e875b9924a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:50:12 +0000 Subject: [PATCH 35/47] test(http-client-csharp): cover JSON BOM primitive responses Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Local.Tests/ExtensibleEnumTests.cs | 21 +++++++ .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 4 ++ .../SampleTypeSpecClient.RestClient.cs | 12 ++++ .../src/Generated/SampleTypeSpecClient.cs | 60 +++++++++++++++++++ 4 files changed, 97 insertions(+) diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 6874e0fdbd4..99bbe190a16 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -41,6 +41,27 @@ public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) Assert.AreSame(content, result.GetRawResponse().Content); } + [TestCase(false)] + [TestCase(true)] + public async Task JsonPrimitiveResponseDeserializationWithBom(bool isAsync) + { + var content = BinaryData.FromString(Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) + "42"); + var response = new Mock(); + response.SetupGet(r => r.Content).Returns(content); + var protocolResult = ClientResult.FromResponse(response.Object); + var client = new Mock { CallBase = true }; + client.Setup(c => c.GetInt32Value(It.IsAny())).Returns(protocolResult); + client.Setup(c => c.GetInt32ValueAsync(It.IsAny())).ReturnsAsync(protocolResult); + + var result = isAsync + ? await client.Object.GetInt32ValueAsync() + : client.Object.GetInt32Value(); + + Assert.AreEqual(42, result.Value); + Assert.AreSame(response.Object, result.GetRawResponse()); + Assert.AreSame(content, result.GetRawResponse().Content); + } + [TestCase("a", "A", true)] [TestCase("A", "A", true)] [TestCase("A", "B", false)] diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 7daa3c98cff..43b0dc7784c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -622,6 +622,10 @@ op returnsAnonymousModel(): { @doc("get extensible enum") op getUnknownValue(): DaysOfWeekExtensibleEnum; +@route("/int32-value") +@doc("get int32") +op getInt32Value(): int32; + @doc("When set protocol false and convenient true, then the protocol method should be internal") @route("internalProtocol") @post diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index 23707366819..c900b5f4737 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -231,6 +231,18 @@ internal PipelineMessage CreateGetUnknownValueRequest(RequestOptions options) return message; } + internal PipelineMessage CreateGetInt32ValueRequest(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/int32-value", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } + internal PipelineMessage CreateInternalProtocolRequest(BinaryContent content, RequestOptions options) { ClientUriBuilder uri = new ClientUriBuilder(); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index e516a3707e6..ee96d096732 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -10,8 +10,10 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Linq; using System.Net.ServerSentEvents; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using SampleTypeSpec.Models.Custom; @@ -1102,6 +1104,64 @@ public virtual async Task> GetUnknownValu return ClientResult.FromValue(value, result.GetRawResponse()); } + /// + /// [Protocol Method] get int32 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetInt32Value(RequestOptions options) + { + using PipelineMessage message = CreateGetInt32ValueRequest(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] get int32 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetInt32ValueAsync(RequestOptions options) + { + using PipelineMessage message = CreateGetInt32ValueRequest(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// get int32. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult GetInt32Value(CancellationToken cancellationToken = default) + { + ClientResult result = GetInt32Value(cancellationToken.ToRequestOptions()); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); + int value = document.RootElement.GetInt32(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + + /// get int32. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task> GetInt32ValueAsync(CancellationToken cancellationToken = default) + { + ClientResult result = await GetInt32ValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); + int value = document.RootElement.GetInt32(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + /// /// [Protocol Method] When set protocol false and convenient true, then the protocol method should be internal /// From 65f2bafbe04a4989ef693e7af522ddcf4bf8dcdc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 15:57:49 +0000 Subject: [PATCH 36/47] fix(http-client-csharp): trim BOM before JSON primitive parse Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 6 +++--- .../EnumReturnTypeMethods(False,False,False).cs | 4 ++-- .../EnumReturnTypeMethods(False,False,True).cs | 4 ++-- .../EnumReturnTypeMethods(False,True,False).cs | 4 ++-- .../EnumReturnTypeMethods(False,True,True).cs | 4 ++-- .../EnumReturnTypeMethods(True,False,False).cs | 4 ++-- .../EnumReturnTypeMethods(True,False,True).cs | 4 ++-- .../EnumReturnTypeMethods(True,True,False).cs | 4 ++-- .../EnumReturnTypeMethods(True,True,True).cs | 4 ++-- .../MixedContentTypeScalarResponseUsesJsonConversion.cs | 4 ++-- .../ScalarReturnTypeMethods(Boolean).cs | 4 ++-- .../ScalarReturnTypeMethods(BooleanNullable).cs | 4 ++-- .../ScalarReturnTypeMethods(DateTimeOffset).cs | 4 ++-- .../ScalarReturnTypeMethods(Decimal).cs | 4 ++-- .../ScalarReturnTypeMethods(Double).cs | 4 ++-- .../ScalarReturnTypeMethods(Int32).cs | 4 ++-- .../ScalarReturnTypeMethods(Int32Async).cs | 4 ++-- .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 ++-- .../ScalarReturnTypeMethods(Int32NullableAsync).cs | 4 ++-- .../ScalarReturnTypeMethods(Int64).cs | 4 ++-- .../ScalarReturnTypeMethods(Single).cs | 4 ++-- .../ScalarReturnTypeMethods(String).cs | 4 ++-- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 ++-- .../ScalarReturnTypeMethods(TimeSpanNullable).cs | 4 ++-- 24 files changed, 49 insertions(+), 49 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index b88c7fc9a46..1728621c288 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -648,11 +648,11 @@ private IEnumerable GetStackVariablesForReturnValueConversi && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); - // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. + var content = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var statements = new MethodBodyStatement[] { - UsingDeclare("stream", data.ToStream(), out var stream), - UsingDeclare("document", JsonDocumentSnippets.Parse(stream), out var document) + Declare("content", typeof(string), content, out var contentValue), + UsingDeclare("document", JsonDocumentSnippets.Parse(contentValue), out var document) }; declarations["data"] = data; declarations["document"] = document; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 0dd4072a034..852aebbba1e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 9555f3050c6..436e4b9279f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 5d6b1510df6..69683a932f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs index 940c12a3f7d..e004129df37 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index c9592dd36ce..be09c28980b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs index 0072803b03f..5ce2e23099b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index e3a9e300663..1cf3ed795da 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 4db817d4b6f..057ea1ef413 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs index 88d44fbf0e4..31b82c8fc16 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index dd042ee9fac..e17daacdef4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); bool value = document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index 4c349955a9a..bd688db8f2d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index c662a01442e..3e25c024fec 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index ec18a48717d..9fe273cc03b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); decimal value = document.RootElement.GetDecimal(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 01640da0a2c..8ccb380fa30 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); double value = document.RootElement.GetDouble(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 7daaac8eb0b..4f2ebeaa888 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index cbabcf7db21..c27126bbfa8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index d06a4e400b4..22b846f5be7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 833c8a112f0..50fc187fe0b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 85908b80a17..124dd51dac5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); long value = document.RootElement.GetInt64(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index aed0acb79b7..732c97cb9a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); float value = document.RootElement.GetSingle(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index ce8389519d2..8476e83978d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 3ef165eb6ee..be7599b073c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index a28d0b0e0f8..bf91854b34f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } From 2248ca171ae61b4f92f0f7100616fa8f2db938fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:02:53 +0000 Subject: [PATCH 37/47] test(http-client-csharp): cover JSON primitive BOM responses Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Local.Tests/PrimitiveResponseTests.cs | 43 + .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 8 + .../SampleTypeSpecClient.RestClient.cs | 12 + .../src/Generated/SampleTypeSpecClient.cs | 58 + .../Local/Sample-TypeSpec/tspCodeModel.json | 2504 +++++++++-------- 5 files changed, 1447 insertions(+), 1178 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs new file mode 100644 index 00000000000..c9d6fbc23ab --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text; +using System.Threading.Tasks; +using Moq; +using NUnit.Framework; +using SampleTypeSpec; + +namespace TestProjects.Local.Tests +{ + public class PrimitiveResponseTests + { + [TestCase(false, false)] + [TestCase(false, true)] + [TestCase(true, false)] + [TestCase(true, true)] + public async Task JsonInt32ResponseDeserialization(bool hasBom, bool isAsync) + { + var payload = Encoding.UTF8.GetBytes("42"); + var content = hasBom + ? BinaryData.FromBytes([.. Encoding.UTF8.GetPreamble(), .. payload]) + : BinaryData.FromBytes(payload); + var response = new Mock(); + response.SetupGet(r => r.Content).Returns(content); + var protocolResult = ClientResult.FromResponse(response.Object); + var client = new Mock { CallBase = true }; + client.Setup(c => c.GetJsonInt32(It.IsAny())).Returns(protocolResult); + client.Setup(c => c.GetJsonInt32Async(It.IsAny())).ReturnsAsync(protocolResult); + + var result = isAsync + ? await client.Object.GetJsonInt32Async() + : client.Object.GetJsonInt32(); + + Assert.AreEqual(42, result.Value); + Assert.AreSame(response.Object, result.GetRawResponse()); + Assert.AreSame(content, result.GetRawResponse().Content); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 43b0dc7784c..3c51d594ab5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -951,3 +951,11 @@ op receiveJsonLines(): JsonlStream; @get @route("/streaming/sse/receive") op receiveSse(): SSEStream; + +@get +@route("/json-int32") +@doc("get JSON int32") +op getJsonInt32(): { + @body body: int32; + @header contentType: "application/json"; +}; diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index c900b5f4737..eeab869dfe9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -511,5 +511,17 @@ internal PipelineMessage CreateReceiveSseRequest(RequestOptions options) message.Apply(options); return message; } + + internal PipelineMessage CreateGetJsonInt32Request(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/json-int32", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index ee96d096732..16f6cb05633 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -2123,6 +2123,64 @@ public virtual async Task>> Re } #pragma warning restore SCME0005 // Type is for evaluation purposes only and is subject to change or removal in future updates. + /// + /// [Protocol Method] get JSON int32 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetJsonInt32(RequestOptions options) + { + using PipelineMessage message = CreateGetJsonInt32Request(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] get JSON int32 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetJsonInt32Async(RequestOptions options) + { + using PipelineMessage message = CreateGetJsonInt32Request(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// get JSON int32. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult GetJsonInt32(CancellationToken cancellationToken = default) + { + ClientResult result = GetJsonInt32(cancellationToken.ToRequestOptions()); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); + int value = document.RootElement.GetInt32(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + + /// get JSON int32. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task> GetJsonInt32Async(CancellationToken cancellationToken = default) + { + ClientResult result = await GetJsonInt32Async(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + using Stream stream = result.GetRawResponse().Content.ToStream(); + using JsonDocument document = JsonDocument.Parse(stream); + int value = document.RootElement.GetInt32(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + /// Initializes a new instance of AnimalOperations. public virtual AnimalOperations GetAnimalOperationsClient() { diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index c9dfa4e0ea7..623f6c30b1a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -1030,7 +1030,7 @@ { "$id": "86", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType", + "name": "GetJsonInt32ResponseContentType", "namespace": "", "usage": "None", "valueType": { @@ -1081,7 +1081,7 @@ { "$id": "92", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType1", + "name": "GetJsonInt32ResponseContentType1", "namespace": "", "usage": "None", "valueType": { @@ -1098,7 +1098,7 @@ { "$id": "94", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType2", + "name": "GetJsonInt32ResponseContentType2", "namespace": "", "usage": "None", "valueType": { @@ -1115,7 +1115,7 @@ { "$id": "96", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType3", + "name": "GetJsonInt32ResponseContentType3", "namespace": "", "usage": "None", "valueType": { @@ -1132,7 +1132,7 @@ { "$id": "98", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType4", + "name": "GetJsonInt32ResponseContentType4", "namespace": "", "usage": "None", "valueType": { @@ -1149,7 +1149,7 @@ { "$id": "100", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType5", + "name": "GetJsonInt32ResponseContentType5", "namespace": "", "usage": "None", "valueType": { @@ -1166,7 +1166,7 @@ { "$id": "102", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType6", + "name": "GetJsonInt32ResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -1285,7 +1285,7 @@ { "$id": "116", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType7", + "name": "GetJsonInt32ResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -1302,7 +1302,7 @@ { "$id": "118", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType8", + "name": "GetJsonInt32ResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -1319,7 +1319,7 @@ { "$id": "120", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType9", + "name": "GetJsonInt32ResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -1336,7 +1336,7 @@ { "$id": "122", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType10", + "name": "GetJsonInt32ResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -1353,7 +1353,7 @@ { "$id": "124", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType11", + "name": "GetJsonInt32ResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -1438,7 +1438,7 @@ { "$id": "134", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType12", + "name": "GetJsonInt32ResponseContentType12", "namespace": "", "usage": "None", "valueType": { @@ -1455,7 +1455,7 @@ { "$id": "136", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType13", + "name": "GetJsonInt32ResponseContentType13", "namespace": "", "usage": "None", "valueType": { @@ -1557,7 +1557,7 @@ { "$id": "148", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType14", + "name": "GetJsonInt32ResponseContentType14", "namespace": "", "usage": "None", "valueType": { @@ -1574,7 +1574,7 @@ { "$id": "150", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType15", + "name": "GetJsonInt32ResponseContentType15", "namespace": "", "usage": "None", "valueType": { @@ -1591,7 +1591,7 @@ { "$id": "152", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType16", + "name": "GetJsonInt32ResponseContentType16", "namespace": "", "usage": "None", "valueType": { @@ -1608,7 +1608,7 @@ { "$id": "154", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType17", + "name": "GetJsonInt32ResponseContentType17", "namespace": "", "usage": "None", "valueType": { @@ -1625,7 +1625,7 @@ { "$id": "156", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType18", + "name": "GetJsonInt32ResponseContentType18", "namespace": "", "usage": "None", "valueType": { @@ -1659,7 +1659,7 @@ { "$id": "160", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType19", + "name": "GetJsonInt32ResponseContentType19", "namespace": "", "usage": "None", "valueType": { @@ -1676,7 +1676,7 @@ { "$id": "162", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType20", + "name": "GetJsonInt32ResponseContentType20", "namespace": "", "usage": "None", "valueType": { @@ -1693,7 +1693,7 @@ { "$id": "164", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType21", + "name": "GetJsonInt32ResponseContentType21", "namespace": "", "usage": "None", "valueType": { @@ -1710,7 +1710,7 @@ { "$id": "166", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType22", + "name": "GetJsonInt32ResponseContentType22", "namespace": "", "usage": "None", "valueType": { @@ -1727,7 +1727,7 @@ { "$id": "168", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType23", + "name": "GetJsonInt32ResponseContentType23", "namespace": "", "usage": "None", "valueType": { @@ -1744,7 +1744,7 @@ { "$id": "170", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType24", + "name": "GetJsonInt32ResponseContentType24", "namespace": "", "usage": "None", "valueType": { @@ -1761,7 +1761,7 @@ { "$id": "172", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType25", + "name": "GetJsonInt32ResponseContentType25", "namespace": "", "usage": "None", "valueType": { @@ -1778,7 +1778,7 @@ { "$id": "174", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType26", + "name": "GetJsonInt32ResponseContentType26", "namespace": "", "usage": "None", "valueType": { @@ -1795,7 +1795,7 @@ { "$id": "176", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType27", + "name": "GetJsonInt32ResponseContentType27", "namespace": "", "usage": "None", "valueType": { @@ -2067,7 +2067,7 @@ { "$id": "208", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType28", + "name": "GetJsonInt32ResponseContentType28", "namespace": "", "usage": "None", "valueType": { @@ -2084,7 +2084,7 @@ { "$id": "210", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType29", + "name": "GetJsonInt32ResponseContentType29", "namespace": "", "usage": "None", "valueType": { @@ -2101,7 +2101,7 @@ { "$id": "212", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType30", + "name": "GetJsonInt32ResponseContentType30", "namespace": "", "usage": "None", "valueType": { @@ -2118,7 +2118,7 @@ { "$id": "214", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType31", + "name": "GetJsonInt32ResponseContentType31", "namespace": "", "usage": "None", "valueType": { @@ -2135,7 +2135,7 @@ { "$id": "216", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType32", + "name": "GetJsonInt32ResponseContentType32", "namespace": "", "usage": "None", "valueType": { @@ -2152,7 +2152,7 @@ { "$id": "218", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType33", + "name": "GetJsonInt32ResponseContentType33", "namespace": "", "usage": "None", "valueType": { @@ -2169,7 +2169,7 @@ { "$id": "220", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType34", + "name": "GetJsonInt32ResponseContentType34", "namespace": "", "usage": "None", "valueType": { @@ -2186,7 +2186,7 @@ { "$id": "222", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType35", + "name": "GetJsonInt32ResponseContentType35", "namespace": "", "usage": "None", "valueType": { @@ -2203,7 +2203,7 @@ { "$id": "224", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType36", + "name": "GetJsonInt32ResponseContentType36", "namespace": "", "usage": "None", "valueType": { @@ -2220,7 +2220,7 @@ { "$id": "226", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType37", + "name": "GetJsonInt32ResponseContentType37", "namespace": "", "usage": "None", "valueType": { @@ -2237,7 +2237,7 @@ { "$id": "228", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType6", + "name": "GetJsonInt32ResponseContentType38", "namespace": "", "usage": "None", "valueType": { @@ -2247,14 +2247,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "230", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType7", + "name": "GetJsonInt32ResponseContentType39", "namespace": "", "usage": "None", "valueType": { @@ -2264,14 +2264,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "232", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType38", + "name": "GetXmlAdvancedModelResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -2281,14 +2281,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "234", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType39", + "name": "GetXmlAdvancedModelResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -2298,14 +2298,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "236", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType8", + "name": "GetJsonInt32ResponseContentType40", "namespace": "", "usage": "None", "valueType": { @@ -2315,14 +2315,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "238", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType9", + "name": "GetJsonInt32ResponseContentType41", "namespace": "", "usage": "None", "valueType": { @@ -2332,14 +2332,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "240", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType10", + "name": "GetXmlAdvancedModelResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -2356,7 +2356,7 @@ { "$id": "242", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType11", + "name": "GetXmlAdvancedModelResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -2373,7 +2373,7 @@ { "$id": "244", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType40", + "name": "GetXmlAdvancedModelResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -2383,14 +2383,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "246", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType41", + "name": "GetXmlAdvancedModelResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -2400,14 +2400,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "248", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType42", + "name": "GetJsonInt32ResponseContentType42", "namespace": "", "usage": "None", "valueType": { @@ -2424,7 +2424,7 @@ { "$id": "250", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType43", + "name": "GetJsonInt32ResponseContentType43", "namespace": "", "usage": "None", "valueType": { @@ -2441,7 +2441,7 @@ { "$id": "252", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType44", + "name": "GetJsonInt32ResponseContentType44", "namespace": "", "usage": "None", "valueType": { @@ -2458,7 +2458,7 @@ { "$id": "254", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType45", + "name": "GetJsonInt32ResponseContentType45", "namespace": "", "usage": "None", "valueType": { @@ -2471,11 +2471,45 @@ "value": "application/json", "decorators": [], "isExactName": false + }, + { + "$id": "256", + "kind": "constant", + "name": "GetJsonInt32ResponseContentType46", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "258", + "kind": "constant", + "name": "GetJsonInt32ResponseContentType47", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false } ], "models": [ { - "$id": "256", + "$id": "260", "kind": "model", "name": "Thing", "apiVersions": [ @@ -2495,7 +2529,7 @@ "isExactName": false, "properties": [ { - "$id": "257", + "$id": "261", "kind": "property", "name": "name", "apiVersions": [ @@ -2505,7 +2539,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "258", + "$id": "262", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2526,7 +2560,7 @@ "isExactName": false }, { - "$id": "259", + "$id": "263", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -2536,23 +2570,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "260", + "$id": "264", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "261", + "$id": "265", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "262", + "$id": "266", "kind": "array", "name": "Array", "valueType": { - "$id": "263", + "$id": "267", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2562,7 +2596,7 @@ "decorators": [] }, { - "$id": "264", + "$id": "268", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2588,7 +2622,7 @@ "isExactName": false }, { - "$id": "265", + "$id": "269", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -2615,7 +2649,7 @@ "isExactName": false }, { - "$id": "266", + "$id": "270", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -2625,10 +2659,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "267", + "$id": "271", "kind": "nullable", "type": { - "$id": "268", + "$id": "272", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2651,7 +2685,7 @@ "isExactName": false }, { - "$id": "269", + "$id": "273", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -2661,10 +2695,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "270", + "$id": "274", "kind": "nullable", "type": { - "$id": "271", + "$id": "275", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2687,7 +2721,7 @@ "isExactName": false }, { - "$id": "272", + "$id": "276", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -2714,7 +2748,7 @@ "isExactName": false }, { - "$id": "273", + "$id": "277", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -2741,7 +2775,7 @@ "isExactName": false }, { - "$id": "274", + "$id": "278", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -2768,7 +2802,7 @@ "isExactName": false }, { - "$id": "275", + "$id": "279", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -2795,7 +2829,7 @@ "isExactName": false }, { - "$id": "276", + "$id": "280", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -2805,7 +2839,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "277", + "$id": "281", "kind": "nullable", "type": { "$ref": "5" @@ -2827,7 +2861,7 @@ "isExactName": false }, { - "$id": "278", + "$id": "282", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -2854,7 +2888,7 @@ "isExactName": false }, { - "$id": "279", + "$id": "283", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -2881,7 +2915,7 @@ "isExactName": false }, { - "$id": "280", + "$id": "284", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -2908,7 +2942,7 @@ "isExactName": false }, { - "$id": "281", + "$id": "285", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -2918,7 +2952,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "282", + "$id": "286", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2939,7 +2973,7 @@ "isExactName": false }, { - "$id": "283", + "$id": "287", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -2949,14 +2983,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "284", + "$id": "288", "kind": "nullable", "type": { - "$id": "285", + "$id": "289", "kind": "array", "name": "Array1", "valueType": { - "$id": "286", + "$id": "290", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2982,7 +3016,7 @@ "isExactName": false }, { - "$id": "287", + "$id": "291", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -2992,10 +3026,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "288", + "$id": "292", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -3014,7 +3048,7 @@ "isExactName": false }, { - "$id": "289", + "$id": "293", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3024,7 +3058,7 @@ "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "290", + "$id": "294", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3047,7 +3081,7 @@ ] }, { - "$id": "291", + "$id": "295", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3067,7 +3101,7 @@ "isExactName": false, "properties": [ { - "$id": "292", + "$id": "296", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3077,7 +3111,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "293", + "$id": "297", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3098,7 +3132,7 @@ "isExactName": false }, { - "$id": "294", + "$id": "298", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -3108,7 +3142,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "295", + "$id": "299", "kind": "int32", "name": "int32", "encode": "string", @@ -3130,7 +3164,7 @@ "isExactName": false }, { - "$id": "296", + "$id": "300", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -3140,7 +3174,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "297", + "$id": "301", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -3164,7 +3198,7 @@ "isExactName": false }, { - "$id": "298", + "$id": "302", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -3174,10 +3208,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "299", + "$id": "303", "kind": "dict", "keyType": { - "$id": "300", + "$id": "304", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3203,7 +3237,7 @@ "isExactName": false }, { - "$id": "301", + "$id": "305", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -3213,7 +3247,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "256" + "$ref": "260" }, "optional": false, "readOnly": false, @@ -3230,7 +3264,7 @@ "isExactName": false }, { - "$id": "302", + "$id": "306", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -3257,7 +3291,7 @@ "isExactName": false }, { - "$id": "303", + "$id": "307", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -3267,7 +3301,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "304", + "$id": "308", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -3291,7 +3325,7 @@ "isExactName": false }, { - "$id": "305", + "$id": "309", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -3318,7 +3352,7 @@ "isExactName": false }, { - "$id": "306", + "$id": "310", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -3345,7 +3379,7 @@ "isExactName": false }, { - "$id": "307", + "$id": "311", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -3355,7 +3389,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "308", + "$id": "312", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -3379,7 +3413,7 @@ "isExactName": false }, { - "$id": "309", + "$id": "313", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -3406,7 +3440,7 @@ "isExactName": false }, { - "$id": "310", + "$id": "314", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -3433,7 +3467,7 @@ "isExactName": false }, { - "$id": "311", + "$id": "315", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -3443,7 +3477,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "312", + "$id": "316", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -3467,7 +3501,7 @@ "isExactName": false }, { - "$id": "313", + "$id": "317", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -3494,7 +3528,7 @@ "isExactName": false }, { - "$id": "314", + "$id": "318", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -3504,7 +3538,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "315", + "$id": "319", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -3528,7 +3562,7 @@ "isExactName": false }, { - "$id": "316", + "$id": "320", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -3555,7 +3589,7 @@ "isExactName": false }, { - "$id": "317", + "$id": "321", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -3565,7 +3599,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "318", + "$id": "322", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3586,7 +3620,7 @@ "isExactName": false }, { - "$id": "319", + "$id": "323", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -3596,7 +3630,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "320", + "$id": "324", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3617,7 +3651,7 @@ "isExactName": false }, { - "$id": "321", + "$id": "325", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -3627,17 +3661,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "322", + "$id": "326", "kind": "dict", "keyType": { - "$id": "323", + "$id": "327", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "324", + "$id": "328", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3660,7 +3694,7 @@ "isExactName": false }, { - "$id": "325", + "$id": "329", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -3670,7 +3704,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "322" + "$ref": "326" }, "optional": true, "readOnly": false, @@ -3687,7 +3721,7 @@ "isExactName": false }, { - "$id": "326", + "$id": "330", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -3697,7 +3731,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "322" + "$ref": "326" }, "optional": false, "readOnly": true, @@ -3714,7 +3748,7 @@ "isExactName": false }, { - "$id": "327", + "$id": "331", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -3724,7 +3758,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "322" + "$ref": "326" }, "optional": true, "readOnly": true, @@ -3741,7 +3775,7 @@ "isExactName": false }, { - "$id": "328", + "$id": "332", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -3751,7 +3785,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "329", + "$id": "333", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -3771,7 +3805,7 @@ "isExactName": false, "properties": [ { - "$id": "330", + "$id": "334", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -3781,10 +3815,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "331", + "$id": "335", "kind": "nullable", "type": { - "$id": "332", + "$id": "336", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3807,7 +3841,7 @@ "isExactName": false }, { - "$id": "333", + "$id": "337", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -3817,7 +3851,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "334", + "$id": "338", "kind": "nullable", "type": { "$ref": "22" @@ -3839,7 +3873,7 @@ "isExactName": false }, { - "$id": "335", + "$id": "339", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -3849,7 +3883,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "336", + "$id": "340", "kind": "nullable", "type": { "$ref": "17" @@ -3887,7 +3921,7 @@ "isExactName": false }, { - "$id": "337", + "$id": "341", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -3897,7 +3931,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "338", + "$id": "342", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -3921,10 +3955,10 @@ ] }, { - "$ref": "329" + "$ref": "333" }, { - "$id": "339", + "$id": "343", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -3939,7 +3973,7 @@ "isExactName": false, "properties": [ { - "$id": "340", + "$id": "344", "kind": "property", "name": "p1", "apiVersions": [ @@ -3948,7 +3982,7 @@ ], "doc": "header parameter", "type": { - "$id": "341", + "$id": "345", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3965,7 +3999,7 @@ "isExactName": false }, { - "$id": "342", + "$id": "346", "kind": "property", "name": "action", "apiVersions": [ @@ -3974,7 +4008,7 @@ ], "doc": "body parameter", "type": { - "$ref": "291" + "$ref": "295" }, "optional": false, "readOnly": false, @@ -3987,7 +4021,7 @@ "isExactName": false }, { - "$id": "343", + "$id": "347", "kind": "property", "name": "p2", "apiVersions": [ @@ -3996,7 +4030,7 @@ ], "doc": "path parameter", "type": { - "$id": "344", + "$id": "348", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4015,7 +4049,7 @@ ] }, { - "$id": "345", + "$id": "349", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4035,7 +4069,7 @@ "isExactName": false, "properties": [ { - "$id": "346", + "$id": "350", "kind": "property", "name": "name", "apiVersions": [ @@ -4045,7 +4079,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "347", + "$id": "351", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4068,7 +4102,7 @@ ] }, { - "$id": "348", + "$id": "352", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -4088,7 +4122,7 @@ "isExactName": false, "properties": [ { - "$id": "349", + "$id": "353", "kind": "property", "name": "otherName", "apiVersions": [ @@ -4098,7 +4132,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "350", + "$id": "354", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4121,7 +4155,7 @@ ] }, { - "$id": "351", + "$id": "355", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -4141,7 +4175,7 @@ "properties": [] }, { - "$id": "352", + "$id": "356", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -4160,7 +4194,7 @@ "isExactName": false, "properties": [ { - "$id": "353", + "$id": "357", "kind": "property", "name": "things", "apiVersions": [ @@ -4169,11 +4203,11 @@ ], "serializedName": "things", "type": { - "$id": "354", + "$id": "358", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "256" + "$ref": "260" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -4193,7 +4227,7 @@ "isExactName": false }, { - "$id": "355", + "$id": "359", "kind": "property", "name": "next", "apiVersions": [ @@ -4202,7 +4236,7 @@ ], "serializedName": "next", "type": { - "$id": "356", + "$id": "360", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -4225,7 +4259,7 @@ ] }, { - "$id": "357", + "$id": "361", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -4244,7 +4278,7 @@ "isExactName": false, "properties": [ { - "$id": "358", + "$id": "362", "kind": "property", "name": "things", "apiVersions": [ @@ -4253,7 +4287,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4270,7 +4304,7 @@ "isExactName": false }, { - "$id": "359", + "$id": "363", "kind": "property", "name": "next", "apiVersions": [ @@ -4279,7 +4313,7 @@ ], "serializedName": "next", "type": { - "$id": "360", + "$id": "364", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4302,7 +4336,7 @@ ] }, { - "$id": "361", + "$id": "365", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -4321,7 +4355,7 @@ "isExactName": false, "properties": [ { - "$id": "362", + "$id": "366", "kind": "property", "name": "things", "apiVersions": [ @@ -4330,7 +4364,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4347,7 +4381,7 @@ "isExactName": false }, { - "$id": "363", + "$id": "367", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -4356,7 +4390,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "364", + "$id": "368", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4379,7 +4413,7 @@ ] }, { - "$id": "365", + "$id": "369", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -4395,7 +4429,7 @@ "isExactName": false, "properties": [ { - "$id": "366", + "$id": "370", "kind": "property", "name": "things", "apiVersions": [ @@ -4404,7 +4438,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4423,7 +4457,7 @@ ] }, { - "$id": "367", + "$id": "371", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -4442,7 +4476,7 @@ "isExactName": false, "properties": [ { - "$id": "368", + "$id": "372", "kind": "property", "name": "items", "apiVersions": [ @@ -4451,7 +4485,7 @@ ], "serializedName": "items", "type": { - "$ref": "354" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4470,7 +4504,7 @@ ] }, { - "$id": "369", + "$id": "373", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -4489,7 +4523,7 @@ "isExactName": false, "properties": [ { - "$id": "370", + "$id": "374", "kind": "property", "name": "name", "apiVersions": [ @@ -4499,7 +4533,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "371", + "$id": "375", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4520,7 +4554,7 @@ "isExactName": false }, { - "$id": "372", + "$id": "376", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -4530,7 +4564,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "373", + "$id": "377", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4551,7 +4585,7 @@ "isExactName": false }, { - "$id": "374", + "$id": "378", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -4561,7 +4595,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "375", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4582,7 +4616,7 @@ "isExactName": false }, { - "$id": "376", + "$id": "380", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -4592,7 +4626,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "377", + "$id": "381", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4613,7 +4647,7 @@ "isExactName": false }, { - "$id": "378", + "$id": "382", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -4623,7 +4657,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "379", + "$id": "383", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4646,7 +4680,7 @@ ] }, { - "$id": "380", + "$id": "384", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -4671,7 +4705,7 @@ "isExactName": false, "properties": [ { - "$id": "381", + "$id": "385", "kind": "property", "name": "name", "apiVersions": [ @@ -4680,7 +4714,7 @@ ], "serializedName": "name", "type": { - "$id": "382", + "$id": "386", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4701,7 +4735,7 @@ "isExactName": false }, { - "$id": "383", + "$id": "387", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4710,7 +4744,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "384", + "$id": "388", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4731,7 +4765,7 @@ "isExactName": false }, { - "$id": "385", + "$id": "389", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -4740,7 +4774,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "386", + "$id": "390", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4761,7 +4795,7 @@ "isExactName": false }, { - "$id": "387", + "$id": "391", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -4770,10 +4804,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "388", + "$id": "392", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -4792,7 +4826,7 @@ "isExactName": false }, { - "$id": "389", + "$id": "393", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -4801,10 +4835,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "390", + "$id": "394", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -4823,7 +4857,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "395", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -4832,20 +4866,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "392", + "$id": "396", "kind": "nullable", "type": { - "$id": "393", + "$id": "397", "kind": "dict", "keyType": { - "$id": "394", + "$id": "398", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "395", + "$id": "399", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4870,7 +4904,7 @@ "isExactName": false }, { - "$id": "396", + "$id": "400", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -4879,10 +4913,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "397", + "$id": "401", "kind": "nullable", "type": { - "$ref": "393" + "$ref": "397" }, "namespace": "SampleTypeSpec" }, @@ -4901,7 +4935,7 @@ "isExactName": false }, { - "$id": "398", + "$id": "402", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -4910,7 +4944,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "393" + "$ref": "397" }, "optional": false, "readOnly": false, @@ -4927,7 +4961,7 @@ "isExactName": false }, { - "$id": "399", + "$id": "403", "kind": "property", "name": "foo", "apiVersions": [ @@ -4936,7 +4970,7 @@ ], "serializedName": "foo", "type": { - "$id": "400", + "$id": "404", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -4961,7 +4995,7 @@ "isExactName": false, "properties": [ { - "$id": "401", + "$id": "405", "kind": "property", "name": "bar", "apiVersions": [ @@ -4970,7 +5004,7 @@ ], "serializedName": "bar", "type": { - "$id": "402", + "$id": "406", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5007,7 +5041,7 @@ "isExactName": false }, { - "$id": "403", + "$id": "407", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5016,11 +5050,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "404", + "$id": "408", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "400" + "$ref": "404" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5040,7 +5074,7 @@ "isExactName": false }, { - "$id": "405", + "$id": "409", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -5049,11 +5083,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "406", + "$id": "410", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "404" + "$ref": "408" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5073,7 +5107,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "411", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -5082,17 +5116,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "408", + "$id": "412", "kind": "dict", "keyType": { - "$id": "409", + "$id": "413", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "400" + "$ref": "404" }, "decorators": [] }, @@ -5111,7 +5145,7 @@ "isExactName": false }, { - "$id": "410", + "$id": "414", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -5120,17 +5154,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "411", + "$id": "415", "kind": "dict", "keyType": { - "$id": "412", + "$id": "416", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "408" + "$ref": "412" }, "decorators": [] }, @@ -5149,7 +5183,7 @@ "isExactName": false }, { - "$id": "413", + "$id": "417", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -5158,17 +5192,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "414", + "$id": "418", "kind": "dict", "keyType": { - "$id": "415", + "$id": "419", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "404" + "$ref": "408" }, "decorators": [] }, @@ -5187,7 +5221,7 @@ "isExactName": false }, { - "$id": "416", + "$id": "420", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -5196,11 +5230,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "417", + "$id": "421", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "408" + "$ref": "412" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5222,10 +5256,10 @@ ] }, { - "$ref": "400" + "$ref": "404" }, { - "$id": "418", + "$id": "422", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -5254,7 +5288,7 @@ "isExactName": false, "properties": [ { - "$id": "419", + "$id": "423", "kind": "property", "name": "name", "apiVersions": [ @@ -5264,7 +5298,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "420", + "$id": "424", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5287,7 +5321,7 @@ "isExactName": false }, { - "$id": "421", + "$id": "425", "kind": "property", "name": "age", "apiVersions": [ @@ -5297,7 +5331,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "422", + "$id": "426", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5320,7 +5354,7 @@ "isExactName": false }, { - "$id": "423", + "$id": "427", "kind": "property", "name": "enabled", "apiVersions": [ @@ -5330,7 +5364,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "424", + "$id": "428", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5353,7 +5387,7 @@ "isExactName": false }, { - "$id": "425", + "$id": "429", "kind": "property", "name": "score", "apiVersions": [ @@ -5363,7 +5397,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "426", + "$id": "430", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -5386,7 +5420,7 @@ "isExactName": false }, { - "$id": "427", + "$id": "431", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -5396,7 +5430,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "428", + "$id": "432", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5419,7 +5453,7 @@ "isExactName": false }, { - "$id": "429", + "$id": "433", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5429,7 +5463,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "430", + "$id": "434", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5452,7 +5486,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "435", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -5462,10 +5496,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "432", + "$id": "436", "kind": "nullable", "type": { - "$id": "433", + "$id": "437", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5490,7 +5524,7 @@ "isExactName": false }, { - "$id": "434", + "$id": "438", "kind": "property", "name": "id", "apiVersions": [ @@ -5500,7 +5534,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "435", + "$id": "439", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5528,7 +5562,7 @@ "isExactName": false }, { - "$id": "436", + "$id": "440", "kind": "property", "name": "version", "apiVersions": [ @@ -5538,7 +5572,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "437", + "$id": "441", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5566,7 +5600,7 @@ "isExactName": false }, { - "$id": "438", + "$id": "442", "kind": "property", "name": "isActive", "apiVersions": [ @@ -5576,7 +5610,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "439", + "$id": "443", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5604,7 +5638,7 @@ "isExactName": false }, { - "$id": "440", + "$id": "444", "kind": "property", "name": "originalName", "apiVersions": [ @@ -5614,7 +5648,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "441", + "$id": "445", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5644,7 +5678,7 @@ "isExactName": false }, { - "$id": "442", + "$id": "446", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -5654,7 +5688,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "443", + "$id": "447", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5688,7 +5722,7 @@ "isExactName": false }, { - "$id": "444", + "$id": "448", "kind": "property", "name": "content", "apiVersions": [ @@ -5698,7 +5732,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "445", + "$id": "449", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5726,7 +5760,7 @@ "isExactName": false }, { - "$id": "446", + "$id": "450", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -5736,7 +5770,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "262" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -5761,7 +5795,7 @@ "isExactName": false }, { - "$id": "447", + "$id": "451", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -5771,7 +5805,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "285" + "$ref": "289" }, "optional": false, "readOnly": false, @@ -5796,7 +5830,7 @@ "isExactName": false }, { - "$id": "448", + "$id": "452", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -5806,11 +5840,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "449", + "$id": "453", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "450", + "$id": "454", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -5839,7 +5873,7 @@ "isExactName": false, "properties": [ { - "$id": "451", + "$id": "455", "kind": "property", "name": "itemName", "apiVersions": [ @@ -5849,7 +5883,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "452", + "$id": "456", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5872,7 +5906,7 @@ "isExactName": false }, { - "$id": "453", + "$id": "457", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -5882,7 +5916,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "454", + "$id": "458", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5905,7 +5939,7 @@ "isExactName": false }, { - "$id": "455", + "$id": "459", "kind": "property", "name": "itemId", "apiVersions": [ @@ -5915,7 +5949,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "456", + "$id": "460", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5970,7 +6004,7 @@ "isExactName": false }, { - "$id": "457", + "$id": "461", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -5980,7 +6014,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "262" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -6000,7 +6034,7 @@ "isExactName": false }, { - "$id": "458", + "$id": "462", "kind": "property", "name": "items", "apiVersions": [ @@ -6010,7 +6044,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "449" + "$ref": "453" }, "optional": false, "readOnly": false, @@ -6037,7 +6071,7 @@ "isExactName": false }, { - "$id": "459", + "$id": "463", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -6047,7 +6081,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "460", + "$id": "464", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -6069,7 +6103,7 @@ "isExactName": false, "properties": [ { - "$id": "461", + "$id": "465", "kind": "property", "name": "value", "apiVersions": [ @@ -6079,7 +6113,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "462", + "$id": "466", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6102,7 +6136,7 @@ "isExactName": false }, { - "$id": "463", + "$id": "467", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -6112,7 +6146,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "464", + "$id": "468", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6158,7 +6192,7 @@ "isExactName": false }, { - "$id": "465", + "$id": "469", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -6168,7 +6202,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "460" + "$ref": "464" }, "optional": true, "readOnly": false, @@ -6187,7 +6221,7 @@ "isExactName": false }, { - "$id": "466", + "$id": "470", "kind": "property", "name": "metadata", "apiVersions": [ @@ -6197,17 +6231,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "467", + "$id": "471", "kind": "dict", "keyType": { - "$id": "468", + "$id": "472", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "469", + "$id": "473", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6232,7 +6266,7 @@ "isExactName": false }, { - "$id": "470", + "$id": "474", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -6242,12 +6276,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "471", + "$id": "475", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "472", + "$id": "476", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6273,7 +6307,7 @@ "isExactName": false }, { - "$id": "473", + "$id": "477", "kind": "property", "name": "duration", "apiVersions": [ @@ -6283,12 +6317,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "474", + "$id": "478", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "475", + "$id": "479", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6314,7 +6348,7 @@ "isExactName": false }, { - "$id": "476", + "$id": "480", "kind": "property", "name": "data", "apiVersions": [ @@ -6324,7 +6358,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "477", + "$id": "481", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -6348,7 +6382,7 @@ "isExactName": false }, { - "$id": "478", + "$id": "482", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -6358,7 +6392,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "322" + "$ref": "326" }, "optional": true, "readOnly": false, @@ -6377,7 +6411,7 @@ "isExactName": false }, { - "$id": "479", + "$id": "483", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -6406,7 +6440,7 @@ "isExactName": false }, { - "$id": "480", + "$id": "484", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -6435,7 +6469,7 @@ "isExactName": false }, { - "$id": "481", + "$id": "485", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -6464,7 +6498,7 @@ "isExactName": false }, { - "$id": "482", + "$id": "486", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -6493,7 +6527,7 @@ "isExactName": false }, { - "$id": "483", + "$id": "487", "kind": "property", "name": "label", "apiVersions": [ @@ -6502,7 +6536,7 @@ ], "serializedName": "label", "type": { - "$id": "484", + "$id": "488", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6517,14 +6551,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "485", + "$id": "489", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "486", + "$id": "490", "kind": "enum", "decorators": [ { @@ -6537,7 +6571,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "487", + "$id": "491", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -6546,32 +6580,32 @@ }, "values": [ { - "$id": "488", + "$id": "492", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "486" + "$ref": "490" }, "valueType": { - "$ref": "487" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "489", + "$id": "493", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "486" + "$ref": "490" }, "valueType": { - "$ref": "487" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6589,7 +6623,7 @@ "__accessSet": true }, "valueType": { - "$ref": "487" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -6616,7 +6650,7 @@ "isExactName": false }, { - "$id": "490", + "$id": "494", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -6625,7 +6659,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "491", + "$id": "495", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6640,17 +6674,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "492", + "$id": "496", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "486" + "$ref": "490" }, "valueType": { - "$ref": "487" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6673,7 +6707,7 @@ "isExactName": false }, { - "$id": "493", + "$id": "497", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -6682,7 +6716,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "262" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -6714,7 +6748,7 @@ "isExactName": false }, { - "$id": "494", + "$id": "498", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -6723,7 +6757,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "460" + "$ref": "464" }, "optional": false, "readOnly": false, @@ -6754,7 +6788,7 @@ "isExactName": false }, { - "$id": "495", + "$id": "499", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -6763,11 +6797,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "496", + "$id": "500", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "497", + "$id": "501", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -6800,7 +6834,7 @@ "isExactName": false, "properties": [ { - "$id": "498", + "$id": "502", "kind": "property", "name": "foo", "apiVersions": [ @@ -6809,7 +6843,7 @@ ], "serializedName": "foo", "type": { - "$id": "499", + "$id": "503", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6858,7 +6892,7 @@ "isExactName": false }, { - "$id": "500", + "$id": "504", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -6867,7 +6901,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "496" + "$ref": "500" }, "optional": false, "readOnly": false, @@ -6892,7 +6926,7 @@ "isExactName": false }, { - "$id": "501", + "$id": "505", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6901,11 +6935,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "502", + "$id": "506", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "449" + "$ref": "453" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6928,7 +6962,7 @@ "isExactName": false }, { - "$id": "503", + "$id": "507", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -6937,17 +6971,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "504", + "$id": "508", "kind": "dict", "keyType": { - "$id": "505", + "$id": "509", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "450" + "$ref": "454" }, "decorators": [] }, @@ -6968,7 +7002,7 @@ "isExactName": false }, { - "$id": "506", + "$id": "510", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -6977,17 +7011,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "507", + "$id": "511", "kind": "dict", "keyType": { - "$id": "508", + "$id": "512", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "504" + "$ref": "508" }, "decorators": [] }, @@ -7008,7 +7042,7 @@ "isExactName": false }, { - "$id": "509", + "$id": "513", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7017,17 +7051,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "510", + "$id": "514", "kind": "dict", "keyType": { - "$id": "511", + "$id": "515", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "449" + "$ref": "453" }, "decorators": [] }, @@ -7048,7 +7082,7 @@ "isExactName": false }, { - "$id": "512", + "$id": "516", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -7057,11 +7091,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "513", + "$id": "517", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "504" + "$ref": "508" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7086,16 +7120,16 @@ ] }, { - "$ref": "450" + "$ref": "454" }, { - "$ref": "460" + "$ref": "464" }, { - "$ref": "497" + "$ref": "501" }, { - "$id": "514", + "$id": "518", "kind": "model", "name": "Cat", "apiVersions": [ @@ -7110,7 +7144,7 @@ "isExactName": false, "properties": [ { - "$id": "515", + "$id": "519", "kind": "property", "name": "id", "apiVersions": [ @@ -7119,7 +7153,7 @@ ], "serializedName": "id", "type": { - "$id": "516", + "$id": "520", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7146,7 +7180,7 @@ "isExactName": false }, { - "$id": "517", + "$id": "521", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -7155,7 +7189,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "518", + "$id": "522", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -7182,7 +7216,7 @@ "isExactName": false }, { - "$id": "519", + "$id": "523", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -7191,7 +7225,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "520", + "$id": "524", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7218,7 +7252,7 @@ "isExactName": false }, { - "$id": "521", + "$id": "525", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -7227,7 +7261,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "522", + "$id": "526", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -7254,7 +7288,7 @@ "isExactName": false }, { - "$id": "523", + "$id": "527", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -7263,7 +7297,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "524", + "$id": "528", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -7290,7 +7324,7 @@ "isExactName": false }, { - "$id": "525", + "$id": "529", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -7299,7 +7333,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "526", + "$id": "530", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -7326,7 +7360,7 @@ "isExactName": false }, { - "$id": "527", + "$id": "531", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -7335,7 +7369,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "528", + "$id": "532", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -7362,7 +7396,7 @@ "isExactName": false }, { - "$id": "529", + "$id": "533", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -7371,7 +7405,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "530", + "$id": "534", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -7398,7 +7432,7 @@ "isExactName": false }, { - "$id": "531", + "$id": "535", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -7407,7 +7441,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "532", + "$id": "536", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -7434,7 +7468,7 @@ "isExactName": false }, { - "$id": "533", + "$id": "537", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -7443,7 +7477,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "467" + "$ref": "471" }, "optional": false, "readOnly": false, @@ -7466,7 +7500,7 @@ "isExactName": false }, { - "$id": "534", + "$id": "538", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -7475,17 +7509,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "535", + "$id": "539", "kind": "dict", "keyType": { - "$id": "536", + "$id": "540", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "256" + "$ref": "260" }, "decorators": [] }, @@ -7510,7 +7544,7 @@ "isExactName": false }, { - "$id": "537", + "$id": "541", "kind": "property", "name": "listPart", "apiVersions": [ @@ -7519,7 +7553,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "262" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -7542,7 +7576,7 @@ "isExactName": false }, { - "$id": "538", + "$id": "542", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -7551,7 +7585,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "354" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -7574,7 +7608,7 @@ "isExactName": false }, { - "$id": "539", + "$id": "543", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -7583,11 +7617,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "540", + "$id": "544", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "541", + "$id": "545", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7617,7 +7651,7 @@ "isExactName": false }, { - "$id": "542", + "$id": "546", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -7626,7 +7660,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "543", + "$id": "547", "kind": "model", "name": "File", "apiVersions": [], @@ -7641,14 +7675,14 @@ "isFileType": true, "properties": [ { - "$id": "544", + "$id": "548", "kind": "property", "name": "contentType", "apiVersions": [], "summary": "The allowed media (MIME) types of the file contents.", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "type": { - "$id": "545", + "$id": "549", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7665,14 +7699,14 @@ "isExactName": false }, { - "$id": "546", + "$id": "550", "kind": "property", "name": "filename", "apiVersions": [], "summary": "The name of the file, if any.", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "type": { - "$id": "547", + "$id": "551", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7689,14 +7723,14 @@ "isExactName": false }, { - "$id": "548", + "$id": "552", "kind": "property", "name": "contents", "apiVersions": [], "summary": "The contents of the file.", "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", "type": { - "$id": "549", + "$id": "553", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7726,12 +7760,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "550", + "$id": "554", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "summary": "The name of the file, if any.", "apiVersions": [], "type": { - "$id": "551", + "$id": "555", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7762,12 +7796,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "552", + "$id": "556", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "summary": "The allowed media (MIME) types of the file contents.", "apiVersions": [], "type": { - "$id": "553", + "$id": "557", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7808,7 +7842,7 @@ "isExactName": false }, { - "$id": "554", + "$id": "558", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -7840,7 +7874,7 @@ "isExactName": false }, { - "$id": "555", + "$id": "559", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -7872,7 +7906,7 @@ "isExactName": false }, { - "$id": "556", + "$id": "560", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -7904,7 +7938,7 @@ "isExactName": false }, { - "$id": "557", + "$id": "561", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -7938,7 +7972,7 @@ ] }, { - "$id": "558", + "$id": "562", "kind": "model", "name": "File", "apiVersions": [], @@ -7953,18 +7987,18 @@ "isFileType": true, "properties": [ { - "$ref": "544" + "$ref": "548" }, { - "$ref": "546" + "$ref": "550" }, { - "$ref": "548" + "$ref": "552" } ] }, { - "$id": "559", + "$id": "563", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -7983,7 +8017,7 @@ "isExactName": false, "properties": [ { - "$id": "560", + "$id": "564", "kind": "property", "name": "message", "apiVersions": [ @@ -7992,7 +8026,7 @@ ], "serializedName": "message", "type": { - "$id": "561", + "$id": "565", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8015,7 +8049,7 @@ ] }, { - "$id": "562", + "$id": "566", "kind": "model", "name": "Animal", "apiVersions": [ @@ -8034,7 +8068,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "563", + "$id": "567", "kind": "property", "name": "kind", "apiVersions": [ @@ -8044,7 +8078,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "564", + "$id": "568", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8066,10 +8100,10 @@ }, "properties": [ { - "$ref": "563" + "$ref": "567" }, { - "$id": "565", + "$id": "569", "kind": "property", "name": "name", "apiVersions": [ @@ -8079,7 +8113,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "566", + "$id": "570", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8102,7 +8136,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "567", + "$id": "571", "kind": "model", "name": "Pet", "apiVersions": [ @@ -8122,7 +8156,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "568", + "$id": "572", "kind": "property", "name": "kind", "apiVersions": [ @@ -8148,14 +8182,14 @@ "isExactName": false }, "baseModel": { - "$ref": "562" + "$ref": "566" }, "properties": [ { - "$ref": "568" + "$ref": "572" }, { - "$id": "569", + "$id": "573", "kind": "property", "name": "trained", "apiVersions": [ @@ -8165,7 +8199,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "570", + "$id": "574", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8188,7 +8222,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "571", + "$id": "575", "kind": "model", "name": "Dog", "apiVersions": [ @@ -8208,11 +8242,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "567" + "$ref": "571" }, "properties": [ { - "$id": "572", + "$id": "576", "kind": "property", "name": "kind", "apiVersions": [ @@ -8238,7 +8272,7 @@ "isExactName": false }, { - "$id": "573", + "$id": "577", "kind": "property", "name": "breed", "apiVersions": [ @@ -8248,7 +8282,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "574", + "$id": "578", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8273,18 +8307,18 @@ } }, "dog": { - "$ref": "571" + "$ref": "575" } } }, { - "$ref": "567" + "$ref": "571" }, { - "$ref": "571" + "$ref": "575" }, { - "$id": "575", + "$id": "579", "kind": "model", "name": "Tree", "apiVersions": [ @@ -8309,7 +8343,7 @@ }, "isExactName": false, "baseModel": { - "$id": "576", + "$id": "580", "kind": "model", "name": "Plant", "apiVersions": [ @@ -8333,7 +8367,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "577", + "$id": "581", "kind": "property", "name": "species", "apiVersions": [ @@ -8343,7 +8377,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "578", + "$id": "582", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8370,10 +8404,10 @@ }, "properties": [ { - "$ref": "577" + "$ref": "581" }, { - "$id": "579", + "$id": "583", "kind": "property", "name": "id", "apiVersions": [ @@ -8383,7 +8417,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "580", + "$id": "584", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8409,7 +8443,7 @@ "isExactName": false }, { - "$id": "581", + "$id": "585", "kind": "property", "name": "height", "apiVersions": [ @@ -8419,7 +8453,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "582", + "$id": "586", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8447,13 +8481,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "575" + "$ref": "579" } } }, "properties": [ { - "$id": "583", + "$id": "587", "kind": "property", "name": "species", "apiVersions": [ @@ -8484,7 +8518,7 @@ "isExactName": false }, { - "$id": "584", + "$id": "588", "kind": "property", "name": "age", "apiVersions": [ @@ -8494,7 +8528,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "585", + "$id": "589", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8522,10 +8556,10 @@ ] }, { - "$ref": "576" + "$ref": "580" }, { - "$id": "586", + "$id": "590", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -8544,7 +8578,7 @@ "isExactName": false, "properties": [ { - "$id": "587", + "$id": "591", "kind": "property", "name": "numSold", "apiVersions": [ @@ -8553,7 +8587,7 @@ ], "serializedName": "numSold", "type": { - "$id": "588", + "$id": "592", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8574,7 +8608,7 @@ "isExactName": false }, { - "$id": "589", + "$id": "593", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -8583,7 +8617,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "590", + "$id": "594", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8606,7 +8640,7 @@ ] }, { - "$id": "591", + "$id": "595", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -8625,7 +8659,7 @@ "isExactName": false, "properties": [ { - "$id": "592", + "$id": "596", "kind": "property", "name": "name", "apiVersions": [ @@ -8634,7 +8668,7 @@ ], "serializedName": "name", "type": { - "$id": "593", + "$id": "597", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8655,7 +8689,7 @@ "isExactName": false }, { - "$id": "594", + "$id": "598", "kind": "property", "name": "content", "apiVersions": [ @@ -8664,7 +8698,7 @@ ], "serializedName": "content", "type": { - "$id": "595", + "$id": "599", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8687,7 +8721,7 @@ ] }, { - "$id": "596", + "$id": "600", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -8712,7 +8746,7 @@ "isExactName": false, "properties": [ { - "$id": "597", + "$id": "601", "kind": "property", "name": "modelValue", "apiVersions": [ @@ -8721,10 +8755,10 @@ ], "serializedName": "modelValue", "type": { - "$id": "598", + "$id": "602", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8743,7 +8777,7 @@ "isExactName": false }, { - "$id": "599", + "$id": "603", "kind": "property", "name": "children", "apiVersions": [ @@ -8752,17 +8786,17 @@ ], "serializedName": "children", "type": { - "$id": "600", + "$id": "604", "kind": "nullable", "type": { - "$id": "601", + "$id": "605", "kind": "array", "name": "Array2", "valueType": { - "$id": "602", + "$id": "606", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8786,7 +8820,7 @@ "isExactName": false }, { - "$id": "603", + "$id": "607", "kind": "property", "name": "childDictionary", "apiVersions": [ @@ -8795,23 +8829,23 @@ ], "serializedName": "childDictionary", "type": { - "$id": "604", + "$id": "608", "kind": "nullable", "type": { - "$id": "605", + "$id": "609", "kind": "dict", "keyType": { - "$id": "606", + "$id": "610", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "607", + "$id": "611", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8834,7 +8868,7 @@ "isExactName": false }, { - "$id": "608", + "$id": "612", "kind": "property", "name": "nestedChildren", "apiVersions": [ @@ -8843,24 +8877,24 @@ ], "serializedName": "nestedChildren", "type": { - "$id": "609", + "$id": "613", "kind": "nullable", "type": { - "$id": "610", + "$id": "614", "kind": "array", "name": "Array3", "valueType": { - "$id": "611", + "$id": "615", "kind": "nullable", "type": { - "$id": "612", + "$id": "616", "kind": "array", "name": "Array4", "valueType": { - "$id": "613", + "$id": "617", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8889,7 +8923,7 @@ "isExactName": false }, { - "$id": "614", + "$id": "618", "kind": "property", "name": "nestedChildDictionary", "apiVersions": [ @@ -8898,36 +8932,36 @@ ], "serializedName": "nestedChildDictionary", "type": { - "$id": "615", + "$id": "619", "kind": "nullable", "type": { - "$id": "616", + "$id": "620", "kind": "dict", "keyType": { - "$id": "617", + "$id": "621", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "618", + "$id": "622", "kind": "nullable", "type": { - "$id": "619", + "$id": "623", "kind": "dict", "keyType": { - "$id": "620", + "$id": "624", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "621", + "$id": "625", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8954,7 +8988,7 @@ "isExactName": false }, { - "$id": "622", + "$id": "626", "kind": "property", "name": "dictionaryChildren", "apiVersions": [ @@ -8963,30 +8997,30 @@ ], "serializedName": "dictionaryChildren", "type": { - "$id": "623", + "$id": "627", "kind": "nullable", "type": { - "$id": "624", + "$id": "628", "kind": "dict", "keyType": { - "$id": "625", + "$id": "629", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "626", + "$id": "630", "kind": "nullable", "type": { - "$id": "627", + "$id": "631", "kind": "array", "name": "Array5", "valueType": { - "$id": "628", + "$id": "632", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -9014,7 +9048,7 @@ "isExactName": false }, { - "$id": "629", + "$id": "633", "kind": "property", "name": "listOfDictionaries", "apiVersions": [ @@ -9023,30 +9057,30 @@ ], "serializedName": "listOfDictionaries", "type": { - "$id": "630", + "$id": "634", "kind": "nullable", "type": { - "$id": "631", + "$id": "635", "kind": "array", "name": "Array6", "valueType": { - "$id": "632", + "$id": "636", "kind": "nullable", "type": { - "$id": "633", + "$id": "637", "kind": "dict", "keyType": { - "$id": "634", + "$id": "638", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "635", + "$id": "639", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -9076,7 +9110,7 @@ ] }, { - "$id": "636", + "$id": "640", "kind": "model", "name": "JsonlStreamStreamingItem", "apiVersions": [], @@ -9089,7 +9123,7 @@ "isExactName": false, "properties": [ { - "$id": "637", + "$id": "641", "kind": "property", "name": "contentType", "apiVersions": [ @@ -9110,7 +9144,7 @@ "isExactName": false }, { - "$id": "638", + "$id": "642", "kind": "property", "name": "body", "apiVersions": [ @@ -9118,7 +9152,7 @@ "2024-08-16-preview" ], "type": { - "$id": "639", + "$id": "643", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "", @@ -9139,7 +9173,7 @@ ], "clients": [ { - "$id": "640", + "$id": "644", "kind": "client", "name": "SampleTypeSpecClient", "isExactName": false, @@ -9147,7 +9181,7 @@ "doc": "This is a sample typespec project.", "methods": [ { - "$id": "641", + "$id": "645", "kind": "basic", "name": "sayHi", "isExactName": false, @@ -9158,7 +9192,7 @@ ], "doc": "Return hi", "operation": { - "$id": "642", + "$id": "646", "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9166,12 +9200,12 @@ "accessibility": "public", "parameters": [ { - "$id": "643", + "$id": "647", "kind": "header", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "644", + "$id": "648", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9186,12 +9220,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "645", + "$id": "649", "kind": "method", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "646", + "$id": "650", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9211,12 +9245,12 @@ "isExactName": false }, { - "$id": "647", + "$id": "651", "kind": "query", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "648", + "$id": "652", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9231,12 +9265,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "649", + "$id": "653", "kind": "method", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "650", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9256,12 +9290,12 @@ "isExactName": false }, { - "$id": "651", + "$id": "655", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "652", + "$id": "656", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9276,12 +9310,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "653", + "$id": "657", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "654", + "$id": "658", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9301,7 +9335,7 @@ "isExactName": false }, { - "$id": "655", + "$id": "659", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9317,7 +9351,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "methodParameterSegments": [ { - "$id": "656", + "$id": "660", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9344,7 +9378,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -9369,9 +9403,6 @@ "namespace": "SampleTypeSpec" }, "parameters": [ - { - "$ref": "645" - }, { "$ref": "649" }, @@ -9379,12 +9410,15 @@ "$ref": "653" }, { - "$ref": "656" + "$ref": "657" + }, + { + "$ref": "660" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -9393,7 +9427,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "657", + "$id": "661", "kind": "basic", "name": "helloAgain", "isExactName": false, @@ -9404,7 +9438,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "658", + "$id": "662", "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9412,12 +9446,12 @@ "accessibility": "public", "parameters": [ { - "$id": "659", + "$id": "663", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "660", + "$id": "664", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9432,12 +9466,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "661", + "$id": "665", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "662", + "$id": "666", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9457,7 +9491,7 @@ "isExactName": false }, { - "$id": "663", + "$id": "667", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9473,7 +9507,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", "methodParameterSegments": [ { - "$id": "664", + "$id": "668", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9494,12 +9528,12 @@ "isExactName": false }, { - "$id": "665", + "$id": "669", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "666", + "$id": "670", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9517,12 +9551,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "667", + "$id": "671", "kind": "method", "name": "p2", "serializedName": "p2", "type": { - "$id": "668", + "$id": "672", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9542,7 +9576,7 @@ "isExactName": false }, { - "$id": "669", + "$id": "673", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9558,7 +9592,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "670", + "$id": "674", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9579,12 +9613,12 @@ "isExactName": false }, { - "$id": "671", + "$id": "675", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "295" }, "isApiVersion": false, "contentTypes": [ @@ -9598,12 +9632,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", "methodParameterSegments": [ { - "$id": "672", + "$id": "676", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "295" }, "location": "Body", "isApiVersion": false, @@ -9626,7 +9660,7 @@ 200 ], "bodyType": { - "$ref": "291" + "$ref": "295" }, "headers": [], "isErrorResponse": false, @@ -9655,24 +9689,24 @@ }, "parameters": [ { - "$ref": "661" + "$ref": "665" }, { - "$ref": "672" + "$ref": "676" }, { - "$ref": "664" + "$ref": "668" }, { - "$ref": "667" + "$ref": "671" }, { - "$ref": "670" + "$ref": "674" } ], "response": { "type": { - "$ref": "291" + "$ref": "295" } }, "isOverride": false, @@ -9681,7 +9715,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "673", + "$id": "677", "kind": "basic", "name": "noContentType", "isExactName": false, @@ -9692,7 +9726,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "674", + "$id": "678", "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9700,12 +9734,12 @@ "accessibility": "public", "parameters": [ { - "$id": "675", + "$id": "679", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "676", + "$id": "680", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9720,12 +9754,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "677", + "$id": "681", "kind": "method", "name": "info", "serializedName": "info", "type": { - "$ref": "339" + "$ref": "343" }, "location": "", "isApiVersion": false, @@ -9738,13 +9772,13 @@ "isExactName": false }, { - "$id": "678", + "$id": "682", "kind": "method", "name": "p1", "serializedName": "p1", "doc": "header parameter", "type": { - "$ref": "341" + "$ref": "345" }, "location": "", "isApiVersion": false, @@ -9760,12 +9794,12 @@ "isExactName": false }, { - "$id": "679", + "$id": "683", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "680", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9783,16 +9817,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "677" + "$ref": "681" }, { - "$id": "681", + "$id": "685", "kind": "method", "name": "p2", "serializedName": "p2", "doc": "path parameter", "type": { - "$ref": "344" + "$ref": "348" }, "location": "", "isApiVersion": false, @@ -9808,7 +9842,7 @@ "isExactName": false }, { - "$id": "682", + "$id": "686", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9825,7 +9859,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "683", + "$id": "687", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9847,7 +9881,7 @@ "isExactName": false }, { - "$id": "684", + "$id": "688", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9863,7 +9897,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "685", + "$id": "689", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9884,12 +9918,12 @@ "isExactName": false }, { - "$id": "686", + "$id": "690", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "295" }, "isApiVersion": false, "contentTypes": [ @@ -9903,16 +9937,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", "methodParameterSegments": [ { - "$ref": "677" + "$ref": "681" }, { - "$id": "687", + "$id": "691", "kind": "method", "name": "action", "serializedName": "action", "doc": "body parameter", "type": { - "$ref": "291" + "$ref": "295" }, "location": "", "isApiVersion": false, @@ -9939,7 +9973,7 @@ 200 ], "bodyType": { - "$ref": "291" + "$ref": "295" }, "headers": [], "isErrorResponse": false, @@ -9968,18 +10002,18 @@ }, "parameters": [ { - "$ref": "677" + "$ref": "681" }, { - "$ref": "683" + "$ref": "687" }, { - "$ref": "685" + "$ref": "689" } ], "response": { "type": { - "$ref": "291" + "$ref": "295" } }, "isOverride": true, @@ -9988,7 +10022,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "688", + "$id": "692", "kind": "basic", "name": "helloDemo2", "isExactName": false, @@ -9999,7 +10033,7 @@ ], "doc": "Return hi in demo2", "operation": { - "$id": "689", + "$id": "693", "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10007,7 +10041,7 @@ "accessibility": "public", "parameters": [ { - "$id": "690", + "$id": "694", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10023,7 +10057,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "691", + "$id": "695", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10050,7 +10084,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10076,12 +10110,12 @@ }, "parameters": [ { - "$ref": "691" + "$ref": "695" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10090,7 +10124,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "692", + "$id": "696", "kind": "basic", "name": "createLiteral", "isExactName": false, @@ -10101,7 +10135,7 @@ ], "doc": "Create with literal value", "operation": { - "$id": "693", + "$id": "697", "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10109,7 +10143,7 @@ "accessibility": "public", "parameters": [ { - "$id": "694", + "$id": "698", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10126,7 +10160,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", "methodParameterSegments": [ { - "$id": "695", + "$id": "699", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10148,7 +10182,7 @@ "isExactName": false }, { - "$id": "696", + "$id": "700", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10164,7 +10198,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "697", + "$id": "701", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10185,12 +10219,12 @@ "isExactName": false }, { - "$id": "698", + "$id": "702", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -10204,12 +10238,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", "methodParameterSegments": [ { - "$id": "699", + "$id": "703", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -10236,7 +10270,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10265,18 +10299,18 @@ }, "parameters": [ { - "$ref": "699" + "$ref": "703" }, { - "$ref": "695" + "$ref": "699" }, { - "$ref": "697" + "$ref": "701" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10285,7 +10319,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "700", + "$id": "704", "kind": "basic", "name": "helloLiteral", "isExactName": false, @@ -10296,7 +10330,7 @@ ], "doc": "Send literal parameters", "operation": { - "$id": "701", + "$id": "705", "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10304,7 +10338,7 @@ "accessibility": "public", "parameters": [ { - "$id": "702", + "$id": "706", "kind": "header", "name": "p1", "serializedName": "p1", @@ -10320,7 +10354,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "703", + "$id": "707", "kind": "method", "name": "p1", "serializedName": "p1", @@ -10341,7 +10375,7 @@ "isExactName": false }, { - "$id": "704", + "$id": "708", "kind": "path", "name": "p2", "serializedName": "p2", @@ -10360,7 +10394,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$id": "705", + "$id": "709", "kind": "method", "name": "p2", "serializedName": "p2", @@ -10381,7 +10415,7 @@ "isExactName": false }, { - "$id": "706", + "$id": "710", "kind": "query", "name": "p3", "serializedName": "p3", @@ -10397,7 +10431,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "707", + "$id": "711", "kind": "method", "name": "p3", "serializedName": "p3", @@ -10418,7 +10452,7 @@ "isExactName": false }, { - "$id": "708", + "$id": "712", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10434,7 +10468,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "709", + "$id": "713", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10461,7 +10495,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10487,21 +10521,21 @@ }, "parameters": [ { - "$ref": "703" + "$ref": "707" }, { - "$ref": "705" + "$ref": "709" }, { - "$ref": "707" + "$ref": "711" }, { - "$ref": "709" + "$ref": "713" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10510,7 +10544,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "710", + "$id": "714", "kind": "basic", "name": "topAction", "isExactName": false, @@ -10521,7 +10555,7 @@ ], "doc": "top level method", "operation": { - "$id": "711", + "$id": "715", "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10529,17 +10563,17 @@ "accessibility": "public", "parameters": [ { - "$id": "712", + "$id": "716", "kind": "path", "name": "action", "serializedName": "action", "type": { - "$id": "713", + "$id": "717", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "714", + "$id": "718", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10560,17 +10594,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "715", + "$id": "719", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$id": "716", + "$id": "720", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "717", + "$id": "721", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10593,7 +10627,7 @@ "isExactName": false }, { - "$id": "718", + "$id": "722", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10609,7 +10643,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "719", + "$id": "723", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10636,7 +10670,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10662,15 +10696,15 @@ }, "parameters": [ { - "$ref": "715" + "$ref": "719" }, { - "$ref": "719" + "$ref": "723" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10679,7 +10713,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "720", + "$id": "724", "kind": "basic", "name": "topAction2", "isExactName": false, @@ -10690,7 +10724,7 @@ ], "doc": "top level method2", "operation": { - "$id": "721", + "$id": "725", "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10698,7 +10732,7 @@ "accessibility": "public", "parameters": [ { - "$id": "722", + "$id": "726", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10714,7 +10748,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "723", + "$id": "727", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10741,7 +10775,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10767,12 +10801,12 @@ }, "parameters": [ { - "$ref": "723" + "$ref": "727" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10781,7 +10815,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "724", + "$id": "728", "kind": "basic", "name": "patchAction", "isExactName": false, @@ -10792,7 +10826,7 @@ ], "doc": "top level patch", "operation": { - "$id": "725", + "$id": "729", "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10800,7 +10834,7 @@ "accessibility": "public", "parameters": [ { - "$id": "726", + "$id": "730", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10817,7 +10851,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "727", + "$id": "731", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10839,7 +10873,7 @@ "isExactName": false }, { - "$id": "728", + "$id": "732", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10855,7 +10889,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "729", + "$id": "733", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10876,12 +10910,12 @@ "isExactName": false }, { - "$id": "730", + "$id": "734", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -10895,12 +10929,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "731", + "$id": "735", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -10927,7 +10961,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10956,18 +10990,18 @@ }, "parameters": [ { - "$ref": "731" + "$ref": "735" }, { - "$ref": "727" + "$ref": "731" }, { - "$ref": "729" + "$ref": "733" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -10976,7 +11010,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "732", + "$id": "736", "kind": "basic", "name": "anonymousBody", "isExactName": false, @@ -10987,7 +11021,7 @@ ], "doc": "body parameter without body decorator", "operation": { - "$id": "733", + "$id": "737", "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10995,7 +11029,7 @@ "accessibility": "public", "parameters": [ { - "$id": "734", + "$id": "738", "kind": "query", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11011,7 +11045,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "735", + "$id": "739", "kind": "method", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11032,7 +11066,7 @@ "isExactName": false }, { - "$id": "736", + "$id": "740", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", @@ -11048,7 +11082,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", "methodParameterSegments": [ { - "$id": "737", + "$id": "741", "kind": "method", "name": "requiredHeader", "serializedName": "required-header", @@ -11069,7 +11103,7 @@ "isExactName": false }, { - "$id": "738", + "$id": "742", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11086,7 +11120,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "739", + "$id": "743", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11108,7 +11142,7 @@ "isExactName": false }, { - "$id": "740", + "$id": "744", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11124,7 +11158,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "methodParameterSegments": [ { - "$id": "741", + "$id": "745", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11145,12 +11179,12 @@ "isExactName": false }, { - "$id": "742", + "$id": "746", "kind": "body", "name": "thing", "serializedName": "thing", "type": { - "$ref": "256" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -11164,13 +11198,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "743", + "$id": "747", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "744", + "$id": "748", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11201,7 +11235,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -11230,16 +11264,16 @@ }, "parameters": [ { - "$ref": "743" + "$ref": "747" }, { - "$id": "745", + "$id": "749", "kind": "method", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$ref": "260" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -11252,7 +11286,7 @@ "isExactName": false }, { - "$id": "746", + "$id": "750", "kind": "method", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", @@ -11271,13 +11305,13 @@ "isExactName": false }, { - "$id": "747", + "$id": "751", "kind": "method", "name": "requiredNullableString", "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$ref": "267" + "$ref": "271" }, "location": "Body", "isApiVersion": false, @@ -11290,13 +11324,13 @@ "isExactName": false }, { - "$id": "748", + "$id": "752", "kind": "method", "name": "optionalNullableString", "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$ref": "270" + "$ref": "274" }, "location": "Body", "isApiVersion": false, @@ -11309,7 +11343,7 @@ "isExactName": false }, { - "$id": "749", + "$id": "753", "kind": "method", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", @@ -11328,7 +11362,7 @@ "isExactName": false }, { - "$id": "750", + "$id": "754", "kind": "method", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", @@ -11347,7 +11381,7 @@ "isExactName": false }, { - "$id": "751", + "$id": "755", "kind": "method", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", @@ -11366,19 +11400,19 @@ "isExactName": false }, { - "$id": "752", + "$id": "756", "kind": "method", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "753", + "$id": "757", "kind": "enum", "name": "ThingOptionalLiteralString", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "754", + "$id": "758", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11386,12 +11420,12 @@ }, "values": [ { - "$id": "755", + "$id": "759", "kind": "enumvalue", "name": "reject", "value": "reject", "valueType": { - "$id": "756", + "$id": "760", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -11399,7 +11433,7 @@ "crossLanguageDefinitionId": "TypeSpec.string" }, "enumType": { - "$ref": "753" + "$ref": "757" }, "decorators": [], "isExactName": false @@ -11423,13 +11457,13 @@ "isExactName": false }, { - "$id": "757", + "$id": "761", "kind": "method", "name": "requiredNullableLiteralString", "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$ref": "277" + "$ref": "281" }, "location": "Body", "isApiVersion": false, @@ -11442,19 +11476,19 @@ "isExactName": false }, { - "$id": "758", + "$id": "762", "kind": "method", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "759", + "$id": "763", "kind": "enum", "name": "ThingOptionalLiteralInt", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "760", + "$id": "764", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -11462,12 +11496,12 @@ }, "values": [ { - "$id": "761", + "$id": "765", "kind": "enumvalue", "name": "456", "value": 456, "valueType": { - "$id": "762", + "$id": "766", "kind": "int32", "decorators": [], "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", @@ -11475,7 +11509,7 @@ "crossLanguageDefinitionId": "TypeSpec.int32" }, "enumType": { - "$ref": "759" + "$ref": "763" }, "decorators": [], "isExactName": false @@ -11499,19 +11533,19 @@ "isExactName": false }, { - "$id": "763", + "$id": "767", "kind": "method", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "764", + "$id": "768", "kind": "enum", "name": "ThingOptionalLiteralFloat", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "765", + "$id": "769", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -11519,12 +11553,12 @@ }, "values": [ { - "$id": "766", + "$id": "770", "kind": "enumvalue", "name": "4.56", "value": 4.56, "valueType": { - "$id": "767", + "$id": "771", "kind": "float32", "decorators": [], "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", @@ -11532,7 +11566,7 @@ "crossLanguageDefinitionId": "TypeSpec.float32" }, "enumType": { - "$ref": "764" + "$ref": "768" }, "decorators": [], "isExactName": false @@ -11556,7 +11590,7 @@ "isExactName": false }, { - "$id": "768", + "$id": "772", "kind": "method", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", @@ -11575,13 +11609,13 @@ "isExactName": false }, { - "$id": "769", + "$id": "773", "kind": "method", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "770", + "$id": "774", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11598,13 +11632,13 @@ "isExactName": false }, { - "$id": "771", + "$id": "775", "kind": "method", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$ref": "284" + "$ref": "288" }, "location": "Body", "isApiVersion": false, @@ -11617,13 +11651,13 @@ "isExactName": false }, { - "$id": "772", + "$id": "776", "kind": "method", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$ref": "288" + "$ref": "292" }, "location": "Body", "isApiVersion": false, @@ -11636,13 +11670,13 @@ "isExactName": false }, { - "$id": "773", + "$id": "777", "kind": "method", "name": "propertyWithSpecialDocs", "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "774", + "$id": "778", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11659,21 +11693,21 @@ "isExactName": false }, { - "$ref": "735" + "$ref": "739" }, { - "$ref": "737" + "$ref": "741" }, { - "$ref": "739" + "$ref": "743" }, { - "$ref": "741" + "$ref": "745" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -11682,7 +11716,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "775", + "$id": "779", "kind": "basic", "name": "friendlyModel", "isExactName": false, @@ -11693,7 +11727,7 @@ ], "doc": "Model can have its friendly name", "operation": { - "$id": "776", + "$id": "780", "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11701,7 +11735,7 @@ "accessibility": "public", "parameters": [ { - "$id": "777", + "$id": "781", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11718,7 +11752,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "778", + "$id": "782", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11740,7 +11774,7 @@ "isExactName": false }, { - "$id": "779", + "$id": "783", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11756,7 +11790,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "780", + "$id": "784", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11777,12 +11811,12 @@ "isExactName": false }, { - "$id": "781", + "$id": "785", "kind": "body", "name": "friend", "serializedName": "friend", "type": { - "$ref": "345" + "$ref": "349" }, "isApiVersion": false, "contentTypes": [ @@ -11796,13 +11830,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", "methodParameterSegments": [ { - "$id": "782", + "$id": "786", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "783", + "$id": "787", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11833,7 +11867,7 @@ 200 ], "bodyType": { - "$ref": "345" + "$ref": "349" }, "headers": [], "isErrorResponse": false, @@ -11862,18 +11896,18 @@ }, "parameters": [ { - "$ref": "782" + "$ref": "786" }, { - "$ref": "778" + "$ref": "782" }, { - "$ref": "780" + "$ref": "784" } ], "response": { "type": { - "$ref": "345" + "$ref": "349" } }, "isOverride": false, @@ -11882,7 +11916,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "784", + "$id": "788", "kind": "basic", "name": "addTimeHeader", "isExactName": false, @@ -11892,24 +11926,24 @@ "2024-08-16-preview" ], "operation": { - "$id": "785", + "$id": "789", "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "786", + "$id": "790", "kind": "header", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "787", + "$id": "791", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "788", + "$id": "792", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11927,17 +11961,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "789", + "$id": "793", "kind": "method", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "790", + "$id": "794", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "791", + "$id": "795", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11982,7 +12016,7 @@ }, "parameters": [ { - "$ref": "789" + "$ref": "793" } ], "response": {}, @@ -11992,7 +12026,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "792", + "$id": "796", "kind": "basic", "name": "projectedNameModel", "isExactName": false, @@ -12003,7 +12037,7 @@ ], "doc": "Model can have its projected name", "operation": { - "$id": "793", + "$id": "797", "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12011,7 +12045,7 @@ "accessibility": "public", "parameters": [ { - "$id": "794", + "$id": "798", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12028,7 +12062,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "795", + "$id": "799", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12050,7 +12084,7 @@ "isExactName": false }, { - "$id": "796", + "$id": "800", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12066,7 +12100,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "797", + "$id": "801", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12087,12 +12121,12 @@ "isExactName": false }, { - "$id": "798", + "$id": "802", "kind": "body", "name": "renamedModel", "serializedName": "renamedModel", "type": { - "$ref": "348" + "$ref": "352" }, "isApiVersion": false, "contentTypes": [ @@ -12106,13 +12140,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "799", + "$id": "803", "kind": "method", "name": "otherName", "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "800", + "$id": "804", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12143,7 +12177,7 @@ 200 ], "bodyType": { - "$ref": "348" + "$ref": "352" }, "headers": [], "isErrorResponse": false, @@ -12172,18 +12206,18 @@ }, "parameters": [ { - "$ref": "799" + "$ref": "803" }, { - "$ref": "795" + "$ref": "799" }, { - "$ref": "797" + "$ref": "801" } ], "response": { "type": { - "$ref": "348" + "$ref": "352" } }, "isOverride": false, @@ -12192,7 +12226,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "801", + "$id": "805", "kind": "basic", "name": "returnsAnonymousModel", "isExactName": false, @@ -12203,7 +12237,7 @@ ], "doc": "return anonymous model", "operation": { - "$id": "802", + "$id": "806", "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12211,7 +12245,7 @@ "accessibility": "public", "parameters": [ { - "$id": "803", + "$id": "807", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12227,7 +12261,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "804", + "$id": "808", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12254,7 +12288,7 @@ 200 ], "bodyType": { - "$ref": "351" + "$ref": "355" }, "headers": [], "isErrorResponse": false, @@ -12280,12 +12314,12 @@ }, "parameters": [ { - "$ref": "804" + "$ref": "808" } ], "response": { "type": { - "$ref": "351" + "$ref": "355" } }, "isOverride": false, @@ -12294,7 +12328,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$id": "805", + "$id": "809", "kind": "basic", "name": "getUnknownValue", "isExactName": false, @@ -12305,7 +12339,7 @@ ], "doc": "get extensible enum", "operation": { - "$id": "806", + "$id": "810", "name": "getUnknownValue", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12313,7 +12347,7 @@ "accessibility": "public", "parameters": [ { - "$id": "807", + "$id": "811", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12329,7 +12363,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "808", + "$id": "812", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12378,7 +12412,7 @@ }, "parameters": [ { - "$ref": "808" + "$ref": "812" } ], "response": { @@ -12392,7 +12426,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "809", + "$id": "813", "kind": "basic", "name": "internalProtocol", "isExactName": false, @@ -12403,7 +12437,7 @@ ], "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "810", + "$id": "814", "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12411,7 +12445,7 @@ "accessibility": "public", "parameters": [ { - "$id": "811", + "$id": "815", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12428,7 +12462,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "812", + "$id": "816", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12450,7 +12484,7 @@ "isExactName": false }, { - "$id": "813", + "$id": "817", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12466,7 +12500,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "814", + "$id": "818", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12487,12 +12521,12 @@ "isExactName": false }, { - "$id": "815", + "$id": "819", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -12506,12 +12540,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "816", + "$id": "820", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -12538,7 +12572,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -12567,18 +12601,18 @@ }, "parameters": [ { - "$ref": "816" + "$ref": "820" }, { - "$ref": "812" + "$ref": "816" }, { - "$ref": "814" + "$ref": "818" } ], "response": { "type": { - "$ref": "256" + "$ref": "260" } }, "isOverride": false, @@ -12587,7 +12621,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" }, { - "$id": "817", + "$id": "821", "kind": "basic", "name": "stillConvenient", "isExactName": false, @@ -12598,7 +12632,7 @@ ], "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "operation": { - "$id": "818", + "$id": "822", "name": "stillConvenient", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12633,7 +12667,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" }, { - "$id": "819", + "$id": "823", "kind": "basic", "name": "headAsBoolean", "isExactName": false, @@ -12644,7 +12678,7 @@ ], "doc": "head as boolean.", "operation": { - "$id": "820", + "$id": "824", "name": "headAsBoolean", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12652,12 +12686,12 @@ "accessibility": "public", "parameters": [ { - "$id": "821", + "$id": "825", "kind": "path", "name": "id", "serializedName": "id", "type": { - "$id": "822", + "$id": "826", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12675,12 +12709,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "823", + "$id": "827", "kind": "method", "name": "id", "serializedName": "id", "type": { - "$id": "824", + "$id": "828", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12722,7 +12756,7 @@ }, "parameters": [ { - "$ref": "823" + "$ref": "827" } ], "response": {}, @@ -12732,7 +12766,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "825", + "$id": "829", "kind": "basic", "name": "WithApiVersion", "isExactName": false, @@ -12743,7 +12777,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "826", + "$id": "830", "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12751,12 +12785,12 @@ "accessibility": "public", "parameters": [ { - "$id": "827", + "$id": "831", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "828", + "$id": "832", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12771,12 +12805,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "829", + "$id": "833", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "830", + "$id": "834", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12796,12 +12830,12 @@ "isExactName": false }, { - "$id": "831", + "$id": "835", "kind": "query", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "832", + "$id": "836", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12811,7 +12845,7 @@ "explode": false, "defaultValue": { "type": { - "$id": "833", + "$id": "837", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12825,12 +12859,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "834", + "$id": "838", "kind": "method", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "835", + "$id": "839", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12840,7 +12874,7 @@ "isApiVersion": true, "defaultValue": { "type": { - "$id": "836", + "$id": "840", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12881,7 +12915,7 @@ }, "parameters": [ { - "$ref": "829" + "$ref": "833" } ], "response": {}, @@ -12891,7 +12925,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" }, { - "$id": "837", + "$id": "841", "kind": "paging", "name": "ListWithNextLink", "isExactName": false, @@ -12902,7 +12936,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "838", + "$id": "842", "name": "ListWithNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12910,7 +12944,7 @@ "accessibility": "public", "parameters": [ { - "$id": "839", + "$id": "843", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12926,7 +12960,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "840", + "$id": "844", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12953,7 +12987,7 @@ 200 ], "bodyType": { - "$ref": "352" + "$ref": "356" }, "headers": [], "isErrorResponse": false, @@ -12979,12 +13013,12 @@ }, "parameters": [ { - "$ref": "840" + "$ref": "844" } ], "response": { "type": { - "$ref": "354" + "$ref": "358" }, "resultSegments": [ "things" @@ -13008,7 +13042,7 @@ } }, { - "$id": "841", + "$id": "845", "kind": "paging", "name": "ListWithStringNextLink", "isExactName": false, @@ -13019,7 +13053,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "842", + "$id": "846", "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13027,7 +13061,7 @@ "accessibility": "public", "parameters": [ { - "$id": "843", + "$id": "847", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13043,7 +13077,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "844", + "$id": "848", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13070,7 +13104,7 @@ 200 ], "bodyType": { - "$ref": "357" + "$ref": "361" }, "headers": [], "isErrorResponse": false, @@ -13096,12 +13130,12 @@ }, "parameters": [ { - "$ref": "844" + "$ref": "848" } ], "response": { "type": { - "$ref": "354" + "$ref": "358" }, "resultSegments": [ "things" @@ -13125,7 +13159,7 @@ } }, { - "$id": "845", + "$id": "849", "kind": "paging", "name": "ListWithContinuationToken", "isExactName": false, @@ -13136,7 +13170,7 @@ ], "doc": "List things with continuation token", "operation": { - "$id": "846", + "$id": "850", "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13144,12 +13178,12 @@ "accessibility": "public", "parameters": [ { - "$id": "847", + "$id": "851", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "848", + "$id": "852", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13164,12 +13198,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "849", + "$id": "853", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "850", + "$id": "854", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13189,7 +13223,7 @@ "isExactName": false }, { - "$id": "851", + "$id": "855", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13205,7 +13239,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "852", + "$id": "856", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13232,7 +13266,7 @@ 200 ], "bodyType": { - "$ref": "361" + "$ref": "365" }, "headers": [], "isErrorResponse": false, @@ -13258,15 +13292,15 @@ }, "parameters": [ { - "$ref": "849" + "$ref": "853" }, { - "$ref": "852" + "$ref": "856" } ], "response": { "type": { - "$ref": "354" + "$ref": "358" }, "resultSegments": [ "things" @@ -13282,7 +13316,7 @@ ], "continuationToken": { "parameter": { - "$ref": "847" + "$ref": "851" }, "responseSegments": [ "nextToken" @@ -13293,7 +13327,7 @@ } }, { - "$id": "853", + "$id": "857", "kind": "paging", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, @@ -13304,7 +13338,7 @@ ], "doc": "List things with continuation token header response", "operation": { - "$id": "854", + "$id": "858", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13312,12 +13346,12 @@ "accessibility": "public", "parameters": [ { - "$id": "855", + "$id": "859", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "856", + "$id": "860", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13332,12 +13366,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "857", + "$id": "861", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "858", + "$id": "862", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13357,7 +13391,7 @@ "isExactName": false }, { - "$id": "859", + "$id": "863", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13373,7 +13407,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "860", + "$id": "864", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13400,14 +13434,14 @@ 200 ], "bodyType": { - "$ref": "365" + "$ref": "369" }, "headers": [ { "name": "nextToken", "nameInResponse": "next-token", "type": { - "$id": "861", + "$id": "865", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13438,15 +13472,15 @@ }, "parameters": [ { - "$ref": "857" + "$ref": "861" }, { - "$ref": "860" + "$ref": "864" } ], "response": { "type": { - "$ref": "354" + "$ref": "358" }, "resultSegments": [ "things" @@ -13462,7 +13496,7 @@ ], "continuationToken": { "parameter": { - "$ref": "855" + "$ref": "859" }, "responseSegments": [ "next-token" @@ -13473,7 +13507,7 @@ } }, { - "$id": "862", + "$id": "866", "kind": "paging", "name": "ListWithPaging", "isExactName": false, @@ -13484,7 +13518,7 @@ ], "doc": "List things with paging", "operation": { - "$id": "863", + "$id": "867", "name": "ListWithPaging", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13492,7 +13526,7 @@ "accessibility": "public", "parameters": [ { - "$id": "864", + "$id": "868", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13508,7 +13542,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "865", + "$id": "869", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13535,7 +13569,7 @@ 200 ], "bodyType": { - "$ref": "367" + "$ref": "371" }, "headers": [], "isErrorResponse": false, @@ -13561,12 +13595,12 @@ }, "parameters": [ { - "$ref": "865" + "$ref": "869" } ], "response": { "type": { - "$ref": "354" + "$ref": "358" }, "resultSegments": [ "items" @@ -13584,7 +13618,7 @@ } }, { - "$id": "866", + "$id": "870", "kind": "basic", "name": "EmbeddedParameters", "isExactName": false, @@ -13595,7 +13629,7 @@ ], "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "867", + "$id": "871", "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13603,13 +13637,13 @@ "accessibility": "public", "parameters": [ { - "$id": "868", + "$id": "872", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", "doc": "required header parameter", "type": { - "$id": "869", + "$id": "873", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13624,12 +13658,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "870", + "$id": "874", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "369" + "$ref": "373" }, "location": "Body", "isApiVersion": false, @@ -13642,13 +13676,13 @@ "isExactName": false }, { - "$id": "871", + "$id": "875", "kind": "method", "name": "requiredHeader", "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$ref": "373" + "$ref": "377" }, "location": "", "isApiVersion": false, @@ -13664,13 +13698,13 @@ "isExactName": false }, { - "$id": "872", + "$id": "876", "kind": "header", "name": "optionalHeader", "serializedName": "optional-header", "doc": "optional header parameter", "type": { - "$id": "873", + "$id": "877", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13685,16 +13719,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$ref": "870" + "$ref": "874" }, { - "$id": "874", + "$id": "878", "kind": "method", "name": "optionalHeader", "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$ref": "375" + "$ref": "379" }, "location": "", "isApiVersion": false, @@ -13710,13 +13744,13 @@ "isExactName": false }, { - "$id": "875", + "$id": "879", "kind": "query", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "876", + "$id": "880", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13731,16 +13765,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "870" + "$ref": "874" }, { - "$id": "877", + "$id": "881", "kind": "method", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$ref": "377" + "$ref": "381" }, "location": "", "isApiVersion": false, @@ -13756,13 +13790,13 @@ "isExactName": false }, { - "$id": "878", + "$id": "882", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "879", + "$id": "883", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13777,16 +13811,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "870" + "$ref": "874" }, { - "$id": "880", + "$id": "884", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$ref": "379" + "$ref": "383" }, "location": "", "isApiVersion": false, @@ -13802,7 +13836,7 @@ "isExactName": false }, { - "$id": "881", + "$id": "885", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13819,7 +13853,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "882", + "$id": "886", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13841,12 +13875,12 @@ "isExactName": false }, { - "$id": "883", + "$id": "887", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "369" + "$ref": "373" }, "isApiVersion": false, "contentTypes": [ @@ -13860,7 +13894,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "methodParameterSegments": [ { - "$ref": "870" + "$ref": "874" } ], "isExactName": false, @@ -13896,10 +13930,10 @@ }, "parameters": [ { - "$ref": "870" + "$ref": "874" }, { - "$ref": "882" + "$ref": "886" } ], "response": {}, @@ -13909,7 +13943,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "884", + "$id": "888", "kind": "basic", "name": "DynamicModelOperation", "isExactName": false, @@ -13920,7 +13954,7 @@ ], "doc": "An operation with a dynamic model", "operation": { - "$id": "885", + "$id": "889", "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13928,7 +13962,7 @@ "accessibility": "public", "parameters": [ { - "$id": "886", + "$id": "890", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13945,7 +13979,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "887", + "$id": "891", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13967,12 +14001,12 @@ "isExactName": false }, { - "$id": "888", + "$id": "892", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "380" + "$ref": "384" }, "isApiVersion": false, "contentTypes": [ @@ -13986,12 +14020,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "889", + "$id": "893", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "380" + "$ref": "384" }, "location": "Body", "isApiVersion": false, @@ -14037,10 +14071,10 @@ }, "parameters": [ { - "$ref": "889" + "$ref": "893" }, { - "$ref": "887" + "$ref": "891" } ], "response": {}, @@ -14050,7 +14084,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "890", + "$id": "894", "kind": "basic", "name": "GetXmlAdvancedModel", "isExactName": false, @@ -14061,7 +14095,7 @@ ], "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "891", + "$id": "895", "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14069,7 +14103,7 @@ "accessibility": "public", "parameters": [ { - "$id": "892", + "$id": "896", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14085,7 +14119,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "893", + "$id": "897", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14112,7 +14146,7 @@ 200 ], "bodyType": { - "$ref": "418" + "$ref": "422" }, "headers": [ { @@ -14146,12 +14180,12 @@ }, "parameters": [ { - "$ref": "893" + "$ref": "897" } ], "response": { "type": { - "$ref": "418" + "$ref": "422" } }, "isOverride": false, @@ -14160,7 +14194,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "894", + "$id": "898", "kind": "basic", "name": "UpdateXmlAdvancedModel", "isExactName": false, @@ -14171,7 +14205,7 @@ ], "doc": "Update an advanced XML model with various property types", "operation": { - "$id": "895", + "$id": "899", "name": "UpdateXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14179,7 +14213,7 @@ "accessibility": "public", "parameters": [ { - "$id": "896", + "$id": "900", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14195,7 +14229,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "897", + "$id": "901", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14216,7 +14250,7 @@ "isExactName": false }, { - "$id": "898", + "$id": "902", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14232,7 +14266,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "899", + "$id": "903", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14253,12 +14287,12 @@ "isExactName": false }, { - "$id": "900", + "$id": "904", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "418" + "$ref": "422" }, "isApiVersion": false, "contentTypes": [ @@ -14272,12 +14306,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "901", + "$id": "905", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "418" + "$ref": "422" }, "location": "Body", "isApiVersion": false, @@ -14304,7 +14338,7 @@ 200 ], "bodyType": { - "$ref": "418" + "$ref": "422" }, "headers": [ { @@ -14341,18 +14375,18 @@ }, "parameters": [ { - "$ref": "901" + "$ref": "905" }, { - "$ref": "897" + "$ref": "901" }, { - "$ref": "899" + "$ref": "903" } ], "response": { "type": { - "$ref": "418" + "$ref": "422" } }, "isOverride": false, @@ -14361,7 +14395,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, { - "$id": "902", + "$id": "906", "kind": "basic", "name": "uploadCat", "isExactName": false, @@ -14371,14 +14405,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "903", + "$id": "907", "name": "uploadCat", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "904", + "$id": "908", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14394,7 +14428,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "methodParameterSegments": [ { - "$id": "905", + "$id": "909", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14415,12 +14449,12 @@ "isExactName": false }, { - "$id": "906", + "$id": "910", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "514" + "$ref": "518" }, "isApiVersion": false, "contentTypes": [ @@ -14434,12 +14468,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "methodParameterSegments": [ { - "$id": "907", + "$id": "911", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "514" + "$ref": "518" }, "location": "Body", "isApiVersion": false, @@ -14481,10 +14515,10 @@ }, "parameters": [ { - "$ref": "905" + "$ref": "909" }, { - "$ref": "907" + "$ref": "911" } ], "response": {}, @@ -14494,7 +14528,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" }, { - "$id": "908", + "$id": "912", "kind": "basic", "name": "sendJsonLines", "isExactName": false, @@ -14504,14 +14538,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "909", + "$id": "913", "name": "sendJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "910", + "$id": "914", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14527,16 +14561,16 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "methodParameterSegments": [ { - "$id": "911", + "$id": "915", "kind": "method", "name": "stream", "serializedName": "stream", "type": { - "$id": "912", + "$id": "916", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14555,7 +14589,7 @@ "isExactName": false }, { - "$id": "913", + "$id": "917", "kind": "method", "name": "contentType", "serializedName": "contentType", @@ -14576,16 +14610,16 @@ "isExactName": false }, { - "$id": "914", + "$id": "918", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$id": "915", + "$id": "919", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14605,15 +14639,15 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "methodParameterSegments": [ { - "$ref": "911" + "$ref": "915" }, { - "$id": "916", + "$id": "920", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "639" + "$ref": "643" }, "location": "", "isApiVersion": false, @@ -14659,7 +14693,7 @@ }, "parameters": [ { - "$ref": "911" + "$ref": "915" } ], "response": {}, @@ -14669,7 +14703,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "917", + "$id": "921", "kind": "basic", "name": "receiveJsonLines", "isExactName": false, @@ -14679,14 +14713,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "918", + "$id": "922", "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "919", + "$id": "923", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14702,7 +14736,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "920", + "$id": "924", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14729,11 +14763,11 @@ 200 ], "bodyType": { - "$id": "921", + "$id": "925", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14773,16 +14807,16 @@ }, "parameters": [ { - "$ref": "920" + "$ref": "924" } ], "response": { "type": { - "$id": "922", + "$id": "926", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14797,7 +14831,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "923", + "$id": "927", "kind": "basic", "name": "receiveSse", "isExactName": false, @@ -14807,14 +14841,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "924", + "$id": "928", "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "925", + "$id": "929", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14830,7 +14864,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "926", + "$id": "930", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14857,16 +14891,16 @@ 200 ], "bodyType": { - "$id": "927", + "$id": "931", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$id": "928", + "$id": "932", "kind": "union", "name": "SampleEvents", "variantTypes": [ { - "$ref": "559" + "$ref": "563" }, { "$ref": "204" @@ -14911,16 +14945,16 @@ }, "parameters": [ { - "$ref": "926" + "$ref": "930" } ], "response": { "type": { - "$id": "929", + "$id": "933", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$ref": "928" + "$ref": "932" }, "streamKind": "sse", "contentTypes": [ @@ -14934,16 +14968,130 @@ "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" + }, + { + "$id": "934", + "kind": "basic", + "name": "getJsonInt32", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "get JSON int32", + "operation": { + "$id": "935", + "name": "getJsonInt32", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "get JSON int32", + "accessibility": "public", + "parameters": [ + { + "$id": "936", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "208" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", + "methodParameterSegments": [ + { + "$id": "937", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "208" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "938", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "210" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/json-int32", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "937" + } + ], + "response": { + "type": { + "$ref": "938" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32" } ], "parameters": [ { - "$id": "930", + "$id": "939", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "931", + "$id": "940", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -14959,7 +15107,7 @@ "isExactName": false }, { - "$ref": "834" + "$ref": "838" } ], "initializedBy": 1, @@ -14971,14 +15119,14 @@ ], "children": [ { - "$id": "932", + "$id": "941", "kind": "client", "name": "AnimalOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "933", + "$id": "942", "kind": "basic", "name": "updatePetAsAnimal", "isExactName": false, @@ -14989,7 +15137,7 @@ ], "doc": "Update a pet as an animal", "operation": { - "$id": "934", + "$id": "943", "name": "updatePetAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -14997,13 +15145,13 @@ "accessibility": "public", "parameters": [ { - "$id": "935", + "$id": "944", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "208" + "$ref": "212" }, "isApiVersion": false, "optional": false, @@ -15014,13 +15162,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "936", + "$id": "945", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "208" + "$ref": "212" }, "location": "Header", "isApiVersion": false, @@ -15036,12 +15184,12 @@ "isExactName": false }, { - "$id": "937", + "$id": "946", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "210" + "$ref": "214" }, "isApiVersion": false, "optional": false, @@ -15052,12 +15200,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "938", + "$id": "947", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "210" + "$ref": "214" }, "location": "Header", "isApiVersion": false, @@ -15073,12 +15221,12 @@ "isExactName": false }, { - "$id": "939", + "$id": "948", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "566" }, "isApiVersion": false, "contentTypes": [ @@ -15092,12 +15240,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", "methodParameterSegments": [ { - "$id": "940", + "$id": "949", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "566" }, "location": "Body", "isApiVersion": false, @@ -15124,7 +15272,7 @@ 200 ], "bodyType": { - "$ref": "562" + "$ref": "566" }, "headers": [], "isErrorResponse": false, @@ -15153,18 +15301,18 @@ }, "parameters": [ { - "$ref": "940" + "$ref": "949" }, { - "$ref": "936" + "$ref": "945" }, { - "$ref": "938" + "$ref": "947" } ], "response": { "type": { - "$ref": "562" + "$ref": "566" } }, "isOverride": false, @@ -15173,7 +15321,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "941", + "$id": "950", "kind": "basic", "name": "updateDogAsAnimal", "isExactName": false, @@ -15184,7 +15332,7 @@ ], "doc": "Update a dog as an animal", "operation": { - "$id": "942", + "$id": "951", "name": "updateDogAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15192,13 +15340,13 @@ "accessibility": "public", "parameters": [ { - "$id": "943", + "$id": "952", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -15209,13 +15357,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "944", + "$id": "953", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "216" }, "location": "Header", "isApiVersion": false, @@ -15231,12 +15379,12 @@ "isExactName": false }, { - "$id": "945", + "$id": "954", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "218" }, "isApiVersion": false, "optional": false, @@ -15247,12 +15395,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "946", + "$id": "955", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "218" }, "location": "Header", "isApiVersion": false, @@ -15268,12 +15416,12 @@ "isExactName": false }, { - "$id": "947", + "$id": "956", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "566" }, "isApiVersion": false, "contentTypes": [ @@ -15287,12 +15435,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", "methodParameterSegments": [ { - "$id": "948", + "$id": "957", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "566" }, "location": "Body", "isApiVersion": false, @@ -15319,7 +15467,7 @@ 200 ], "bodyType": { - "$ref": "562" + "$ref": "566" }, "headers": [], "isErrorResponse": false, @@ -15348,18 +15496,18 @@ }, "parameters": [ { - "$ref": "948" + "$ref": "957" }, { - "$ref": "944" + "$ref": "953" }, { - "$ref": "946" + "$ref": "955" } ], "response": { "type": { - "$ref": "562" + "$ref": "566" } }, "isOverride": false, @@ -15370,12 +15518,12 @@ ], "parameters": [ { - "$id": "949", + "$id": "958", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "950", + "$id": "959", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15399,19 +15547,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "951", + "$id": "960", "kind": "client", "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "952", + "$id": "961", "kind": "basic", "name": "updatePetAsPet", "isExactName": false, @@ -15422,7 +15570,7 @@ ], "doc": "Update a pet as a pet", "operation": { - "$id": "953", + "$id": "962", "name": "updatePetAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15430,13 +15578,13 @@ "accessibility": "public", "parameters": [ { - "$id": "954", + "$id": "963", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "220" }, "isApiVersion": false, "optional": false, @@ -15447,13 +15595,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", "methodParameterSegments": [ { - "$id": "955", + "$id": "964", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "220" }, "location": "Header", "isApiVersion": false, @@ -15469,12 +15617,12 @@ "isExactName": false }, { - "$id": "956", + "$id": "965", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "222" }, "isApiVersion": false, "optional": false, @@ -15485,12 +15633,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "957", + "$id": "966", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "222" }, "location": "Header", "isApiVersion": false, @@ -15506,12 +15654,12 @@ "isExactName": false }, { - "$id": "958", + "$id": "967", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "571" }, "isApiVersion": false, "contentTypes": [ @@ -15525,12 +15673,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "959", + "$id": "968", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "571" }, "location": "Body", "isApiVersion": false, @@ -15557,7 +15705,7 @@ 200 ], "bodyType": { - "$ref": "567" + "$ref": "571" }, "headers": [], "isErrorResponse": false, @@ -15586,18 +15734,18 @@ }, "parameters": [ { - "$ref": "959" + "$ref": "968" }, { - "$ref": "955" + "$ref": "964" }, { - "$ref": "957" + "$ref": "966" } ], "response": { "type": { - "$ref": "567" + "$ref": "571" } }, "isOverride": false, @@ -15606,7 +15754,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "960", + "$id": "969", "kind": "basic", "name": "updateDogAsPet", "isExactName": false, @@ -15617,7 +15765,7 @@ ], "doc": "Update a dog as a pet", "operation": { - "$id": "961", + "$id": "970", "name": "updateDogAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15625,13 +15773,13 @@ "accessibility": "public", "parameters": [ { - "$id": "962", + "$id": "971", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "224" }, "isApiVersion": false, "optional": false, @@ -15642,13 +15790,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "963", + "$id": "972", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "224" }, "location": "Header", "isApiVersion": false, @@ -15664,12 +15812,12 @@ "isExactName": false }, { - "$id": "964", + "$id": "973", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "226" }, "isApiVersion": false, "optional": false, @@ -15680,12 +15828,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "methodParameterSegments": [ { - "$id": "965", + "$id": "974", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "226" }, "location": "Header", "isApiVersion": false, @@ -15701,12 +15849,12 @@ "isExactName": false }, { - "$id": "966", + "$id": "975", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "571" }, "isApiVersion": false, "contentTypes": [ @@ -15720,12 +15868,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "967", + "$id": "976", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "571" }, "location": "Body", "isApiVersion": false, @@ -15752,7 +15900,7 @@ 200 ], "bodyType": { - "$ref": "567" + "$ref": "571" }, "headers": [], "isErrorResponse": false, @@ -15781,18 +15929,18 @@ }, "parameters": [ { - "$ref": "967" + "$ref": "976" }, { - "$ref": "963" + "$ref": "972" }, { - "$ref": "965" + "$ref": "974" } ], "response": { "type": { - "$ref": "567" + "$ref": "571" } }, "isOverride": false, @@ -15803,12 +15951,12 @@ ], "parameters": [ { - "$id": "968", + "$id": "977", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "969", + "$id": "978", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15832,19 +15980,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "970", + "$id": "979", "kind": "client", "name": "DogOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "971", + "$id": "980", "kind": "basic", "name": "updateDogAsDog", "isExactName": false, @@ -15855,7 +16003,7 @@ ], "doc": "Update a dog as a dog", "operation": { - "$id": "972", + "$id": "981", "name": "updateDogAsDog", "isExactName": false, "resourceName": "DogOperations", @@ -15863,13 +16011,13 @@ "accessibility": "public", "parameters": [ { - "$id": "973", + "$id": "982", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -15880,13 +16028,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "974", + "$id": "983", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "228" }, "location": "Header", "isApiVersion": false, @@ -15902,12 +16050,12 @@ "isExactName": false }, { - "$id": "975", + "$id": "984", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "230" }, "isApiVersion": false, "optional": false, @@ -15918,12 +16066,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "976", + "$id": "985", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "230" }, "location": "Header", "isApiVersion": false, @@ -15939,12 +16087,12 @@ "isExactName": false }, { - "$id": "977", + "$id": "986", "kind": "body", "name": "dog", "serializedName": "dog", "type": { - "$ref": "571" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -15958,12 +16106,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", "methodParameterSegments": [ { - "$id": "978", + "$id": "987", "kind": "method", "name": "dog", "serializedName": "dog", "type": { - "$ref": "571" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -15990,7 +16138,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -16019,18 +16167,18 @@ }, "parameters": [ { - "$ref": "978" + "$ref": "987" }, { - "$ref": "974" + "$ref": "983" }, { - "$ref": "976" + "$ref": "985" } ], "response": { "type": { - "$ref": "571" + "$ref": "575" } }, "isOverride": false, @@ -16041,12 +16189,12 @@ ], "parameters": [ { - "$id": "979", + "$id": "988", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "980", + "$id": "989", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16070,19 +16218,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "981", + "$id": "990", "kind": "client", "name": "PlantOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "982", + "$id": "991", "kind": "basic", "name": "getTree", "isExactName": false, @@ -16093,7 +16241,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "983", + "$id": "992", "name": "getTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16101,12 +16249,12 @@ "accessibility": "public", "parameters": [ { - "$id": "984", + "$id": "993", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "228" + "$ref": "232" }, "isApiVersion": false, "optional": false, @@ -16117,12 +16265,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "985", + "$id": "994", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "228" + "$ref": "232" }, "location": "Header", "isApiVersion": false, @@ -16144,14 +16292,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "230" + "$ref": "234" } } ], @@ -16178,12 +16326,12 @@ }, "parameters": [ { - "$ref": "985" + "$ref": "994" } ], "response": { "type": { - "$ref": "575" + "$ref": "579" } }, "isOverride": false, @@ -16192,7 +16340,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "986", + "$id": "995", "kind": "basic", "name": "getTreeAsJson", "isExactName": false, @@ -16203,7 +16351,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "987", + "$id": "996", "name": "getTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16211,12 +16359,12 @@ "accessibility": "public", "parameters": [ { - "$id": "988", + "$id": "997", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "236" }, "isApiVersion": false, "optional": false, @@ -16227,12 +16375,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "989", + "$id": "998", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "236" }, "location": "Header", "isApiVersion": false, @@ -16254,14 +16402,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "234" + "$ref": "238" } } ], @@ -16288,12 +16436,12 @@ }, "parameters": [ { - "$ref": "989" + "$ref": "998" } ], "response": { "type": { - "$ref": "575" + "$ref": "579" } }, "isOverride": false, @@ -16302,7 +16450,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" }, { - "$id": "990", + "$id": "999", "kind": "basic", "name": "updateTree", "isExactName": false, @@ -16313,7 +16461,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "991", + "$id": "1000", "name": "updateTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16321,12 +16469,12 @@ "accessibility": "public", "parameters": [ { - "$id": "992", + "$id": "1001", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "236" + "$ref": "240" }, "isApiVersion": false, "optional": false, @@ -16337,12 +16485,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "993", + "$id": "1002", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "236" + "$ref": "240" }, "location": "Header", "isApiVersion": false, @@ -16358,12 +16506,12 @@ "isExactName": false }, { - "$id": "994", + "$id": "1003", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -16374,12 +16522,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "methodParameterSegments": [ { - "$id": "995", + "$id": "1004", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "244" }, "location": "Header", "isApiVersion": false, @@ -16395,12 +16543,12 @@ "isExactName": false }, { - "$id": "996", + "$id": "1005", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -16414,12 +16562,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "997", + "$id": "1006", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -16446,14 +16594,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "242" + "$ref": "246" } } ], @@ -16483,18 +16631,18 @@ }, "parameters": [ { - "$ref": "997" + "$ref": "1006" }, { - "$ref": "993" + "$ref": "1002" }, { - "$ref": "995" + "$ref": "1004" } ], "response": { "type": { - "$ref": "575" + "$ref": "579" } }, "isOverride": false, @@ -16503,7 +16651,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "998", + "$id": "1007", "kind": "basic", "name": "updateTreeAsJson", "isExactName": false, @@ -16514,7 +16662,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "999", + "$id": "1008", "name": "updateTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16522,12 +16670,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1000", + "$id": "1009", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -16538,12 +16686,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1001", + "$id": "1010", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "248" }, "location": "Header", "isApiVersion": false, @@ -16559,12 +16707,12 @@ "isExactName": false }, { - "$id": "1002", + "$id": "1011", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -16575,12 +16723,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1003", + "$id": "1012", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "252" }, "location": "Header", "isApiVersion": false, @@ -16596,12 +16744,12 @@ "isExactName": false }, { - "$id": "1004", + "$id": "1013", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -16615,12 +16763,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1005", + "$id": "1014", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -16647,14 +16795,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "250" + "$ref": "254" } } ], @@ -16684,18 +16832,18 @@ }, "parameters": [ { - "$ref": "1005" + "$ref": "1014" }, { - "$ref": "1001" + "$ref": "1010" }, { - "$ref": "1003" + "$ref": "1012" } ], "response": { "type": { - "$ref": "575" + "$ref": "579" } }, "isOverride": false, @@ -16706,12 +16854,12 @@ ], "parameters": [ { - "$id": "1006", + "$id": "1015", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1007", + "$id": "1016", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16735,19 +16883,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "1008", + "$id": "1017", "kind": "client", "name": "Metrics", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1009", + "$id": "1018", "kind": "basic", "name": "getWidgetMetrics", "isExactName": false, @@ -16758,7 +16906,7 @@ ], "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1010", + "$id": "1019", "name": "getWidgetMetrics", "isExactName": false, "resourceName": "Metrics", @@ -16766,12 +16914,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1011", + "$id": "1020", "kind": "path", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1012", + "$id": "1021", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16789,12 +16937,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", "methodParameterSegments": [ { - "$id": "1013", + "$id": "1022", "kind": "method", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1014", + "$id": "1023", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16814,7 +16962,7 @@ "isExactName": false }, { - "$id": "1015", + "$id": "1024", "kind": "path", "name": "day", "serializedName": "day", @@ -16833,7 +16981,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1016", + "$id": "1025", "kind": "method", "name": "day", "serializedName": "day", @@ -16854,12 +17002,12 @@ "isExactName": false }, { - "$id": "1017", + "$id": "1026", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "256" }, "isApiVersion": false, "optional": false, @@ -16870,12 +17018,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1018", + "$id": "1027", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "256" }, "location": "Header", "isApiVersion": false, @@ -16897,7 +17045,7 @@ 200 ], "bodyType": { - "$ref": "586" + "$ref": "590" }, "headers": [], "isErrorResponse": false, @@ -16923,15 +17071,15 @@ }, "parameters": [ { - "$ref": "1016" + "$ref": "1025" }, { - "$ref": "1018" + "$ref": "1027" } ], "response": { "type": { - "$ref": "586" + "$ref": "590" } }, "isOverride": false, @@ -16942,12 +17090,12 @@ ], "parameters": [ { - "$id": "1019", + "$id": "1028", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1020", + "$id": "1029", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16963,7 +17111,7 @@ "isExactName": false }, { - "$ref": "1013" + "$ref": "1022" } ], "initializedBy": 3, @@ -16974,19 +17122,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "1021", + "$id": "1030", "kind": "client", "name": "Notebooks", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1022", + "$id": "1031", "kind": "basic", "name": "getNotebook", "isExactName": false, @@ -16997,7 +17145,7 @@ ], "doc": "Get a notebook by name", "operation": { - "$id": "1023", + "$id": "1032", "name": "getNotebook", "isExactName": false, "resourceName": "Notebooks", @@ -17005,12 +17153,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1024", + "$id": "1033", "kind": "path", "name": "notebookName", "serializedName": "notebookName", "type": { - "$id": "1025", + "$id": "1034", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17028,12 +17176,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1026", + "$id": "1035", "kind": "method", "name": "notebook", "serializedName": "notebook", "type": { - "$id": "1027", + "$id": "1036", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17054,12 +17202,12 @@ "isExactName": false }, { - "$id": "1028", + "$id": "1037", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "254" + "$ref": "258" }, "isApiVersion": false, "optional": false, @@ -17070,12 +17218,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1029", + "$id": "1038", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "254" + "$ref": "258" }, "location": "Header", "isApiVersion": false, @@ -17097,7 +17245,7 @@ 200 ], "bodyType": { - "$ref": "591" + "$ref": "595" }, "headers": [], "isErrorResponse": false, @@ -17123,12 +17271,12 @@ }, "parameters": [ { - "$ref": "1029" + "$ref": "1038" } ], "response": { "type": { - "$ref": "591" + "$ref": "595" } }, "isOverride": false, @@ -17139,12 +17287,12 @@ ], "parameters": [ { - "$id": "1030", + "$id": "1039", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1031", + "$id": "1040", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17160,7 +17308,7 @@ "isExactName": false }, { - "$ref": "1026" + "$ref": "1035" } ], "initializedBy": 3, @@ -17171,7 +17319,7 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "644" }, "isMultiServiceClient": false } From 5415f390662e50808764ed07dd5505936234748a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:07:03 +0000 Subject: [PATCH 38/47] test(http-client-csharp): consolidate JSON BOM coverage Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 6 +- ...numReturnTypeMethods(False,False,False).cs | 4 +- ...EnumReturnTypeMethods(False,False,True).cs | 4 +- ...EnumReturnTypeMethods(False,True,False).cs | 4 +- .../EnumReturnTypeMethods(False,True,True).cs | 4 +- ...EnumReturnTypeMethods(True,False,False).cs | 4 +- .../EnumReturnTypeMethods(True,False,True).cs | 4 +- .../EnumReturnTypeMethods(True,True,False).cs | 4 +- .../EnumReturnTypeMethods(True,True,True).cs | 4 +- ...entTypeScalarResponseUsesJsonConversion.cs | 4 +- .../ScalarReturnTypeMethods(Boolean).cs | 4 +- ...calarReturnTypeMethods(BooleanNullable).cs | 4 +- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +- .../ScalarReturnTypeMethods(Decimal).cs | 4 +- .../ScalarReturnTypeMethods(Double).cs | 4 +- .../ScalarReturnTypeMethods(Int32).cs | 4 +- .../ScalarReturnTypeMethods(Int32Async).cs | 4 +- .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 +- ...arReturnTypeMethods(Int32NullableAsync).cs | 4 +- .../ScalarReturnTypeMethods(Int64).cs | 4 +- .../ScalarReturnTypeMethods(Single).cs | 4 +- .../ScalarReturnTypeMethods(String).cs | 4 +- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 +- .../Local.Tests/ExtensibleEnumTests.cs | 21 ------- .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 4 -- .../SampleTypeSpecClient.RestClient.cs | 12 ---- .../src/Generated/SampleTypeSpecClient.cs | 58 ------------------- 28 files changed, 49 insertions(+), 144 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 1728621c288..b88c7fc9a46 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -648,11 +648,11 @@ private IEnumerable GetStackVariablesForReturnValueConversi && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); - var content = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); + // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. var statements = new MethodBodyStatement[] { - Declare("content", typeof(string), content, out var contentValue), - UsingDeclare("document", JsonDocumentSnippets.Parse(contentValue), out var document) + UsingDeclare("stream", data.ToStream(), out var stream), + UsingDeclare("document", JsonDocumentSnippets.Parse(stream), out var document) }; declarations["data"] = data; declarations["document"] = document; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 852aebbba1e..0dd4072a034 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 436e4b9279f..9555f3050c6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 69683a932f8..5d6b1510df6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs index e004129df37..940c12a3f7d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index be09c28980b..c9592dd36ce 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs index 5ce2e23099b..0072803b03f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index 1cf3ed795da..e3a9e300663 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 057ea1ef413..4db817d4b6f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs index 31b82c8fc16..88d44fbf0e4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index e17daacdef4..dd042ee9fac 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); bool value = document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index bd688db8f2d..4c349955a9a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index 3e25c024fec..c662a01442e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index 9fe273cc03b..ec18a48717d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); decimal value = document.RootElement.GetDecimal(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 8ccb380fa30..01640da0a2c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); double value = document.RootElement.GetDouble(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 4f2ebeaa888..7daaac8eb0b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index c27126bbfa8..cbabcf7db21 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 22b846f5be7..d06a4e400b4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 50fc187fe0b..833c8a112f0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 124dd51dac5..85908b80a17 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); long value = document.RootElement.GetInt64(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index 732c97cb9a0..aed0acb79b7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); float value = document.RootElement.GetSingle(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index 8476e83978d..ce8389519d2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index be7599b073c..3ef165eb6ee 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index bf91854b34f..a28d0b0e0f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 99bbe190a16..6874e0fdbd4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -41,27 +41,6 @@ public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) Assert.AreSame(content, result.GetRawResponse().Content); } - [TestCase(false)] - [TestCase(true)] - public async Task JsonPrimitiveResponseDeserializationWithBom(bool isAsync) - { - var content = BinaryData.FromString(Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) + "42"); - var response = new Mock(); - response.SetupGet(r => r.Content).Returns(content); - var protocolResult = ClientResult.FromResponse(response.Object); - var client = new Mock { CallBase = true }; - client.Setup(c => c.GetInt32Value(It.IsAny())).Returns(protocolResult); - client.Setup(c => c.GetInt32ValueAsync(It.IsAny())).ReturnsAsync(protocolResult); - - var result = isAsync - ? await client.Object.GetInt32ValueAsync() - : client.Object.GetInt32Value(); - - Assert.AreEqual(42, result.Value); - Assert.AreSame(response.Object, result.GetRawResponse()); - Assert.AreSame(content, result.GetRawResponse().Content); - } - [TestCase("a", "A", true)] [TestCase("A", "A", true)] [TestCase("A", "B", false)] diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 3c51d594ab5..5082930e1ed 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -622,10 +622,6 @@ op returnsAnonymousModel(): { @doc("get extensible enum") op getUnknownValue(): DaysOfWeekExtensibleEnum; -@route("/int32-value") -@doc("get int32") -op getInt32Value(): int32; - @doc("When set protocol false and convenient true, then the protocol method should be internal") @route("internalProtocol") @post diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index eeab869dfe9..3b1bfa50e55 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -231,18 +231,6 @@ internal PipelineMessage CreateGetUnknownValueRequest(RequestOptions options) return message; } - internal PipelineMessage CreateGetInt32ValueRequest(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/int32-value", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } - internal PipelineMessage CreateInternalProtocolRequest(BinaryContent content, RequestOptions options) { ClientUriBuilder uri = new ClientUriBuilder(); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 16f6cb05633..b67986bee1e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -1104,64 +1104,6 @@ public virtual async Task> GetUnknownValu return ClientResult.FromValue(value, result.GetRawResponse()); } - /// - /// [Protocol Method] get int32 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetInt32Value(RequestOptions options) - { - using PipelineMessage message = CreateGetInt32ValueRequest(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] get int32 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetInt32ValueAsync(RequestOptions options) - { - using PipelineMessage message = CreateGetInt32ValueRequest(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// get int32. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult GetInt32Value(CancellationToken cancellationToken = default) - { - ClientResult result = GetInt32Value(cancellationToken.ToRequestOptions()); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); - int value = document.RootElement.GetInt32(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - - /// get int32. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task> GetInt32ValueAsync(CancellationToken cancellationToken = default) - { - ClientResult result = await GetInt32ValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); - int value = document.RootElement.GetInt32(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - /// /// [Protocol Method] When set protocol false and convenient true, then the protocol method should be internal /// From 89152f895ec33996854c46af7f0cd6356b0fd833 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:24:17 +0000 Subject: [PATCH 39/47] fix(http-client-csharp): restore BOM-safe JSON parse and stop throwing on unsupported duration encodings Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 34 +++++++++++++++---- ...ity_BothMethodsParamOrderChanged(Async).cs | 4 +-- ...lity_BothMethodsParamOrderChanged(Sync).cs | 4 +-- ...nvenienceMethodParamOrderChanged(Async).cs | 4 +-- ...onvenienceMethodParamOrderChanged(Sync).cs | 4 +-- ...ltipleNewOptionalNonBodyParametersAdded.cs | 9 +++-- ...dyParameterDoesNotAddBackCompatOverload.cs | 9 +++-- ...bility_NewOptionalNonBodyParameterAdded.cs | 9 +++-- ...ionalNonBodyParameterAddedWithModelBody.cs | 9 +++-- ...rameterAddedWithPathAndHeaderParameters.cs | 9 +++-- ...ty_NewOptionalParameterWithReservedName.cs | 9 +++-- ...edParameterDoesNotAddBackCompatOverload.cs | 9 +++-- .../ScmMethodProviderCollectionTests.cs | 13 ++++--- ...numReturnTypeMethods(False,False,False).cs | 4 +-- ...EnumReturnTypeMethods(False,False,True).cs | 4 +-- ...EnumReturnTypeMethods(False,True,False).cs | 4 +-- .../EnumReturnTypeMethods(False,True,True).cs | 4 +-- ...EnumReturnTypeMethods(True,False,False).cs | 4 +-- .../EnumReturnTypeMethods(True,False,True).cs | 4 +-- .../EnumReturnTypeMethods(True,True,False).cs | 4 +-- .../EnumReturnTypeMethods(True,True,True).cs | 4 +-- ...entTypeScalarResponseUsesJsonConversion.cs | 4 +-- .../ScalarReturnTypeMethods(Boolean).cs | 4 +-- ...calarReturnTypeMethods(BooleanNullable).cs | 4 +-- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +-- .../ScalarReturnTypeMethods(Decimal).cs | 4 +-- .../ScalarReturnTypeMethods(Double).cs | 4 +-- .../ScalarReturnTypeMethods(Int32).cs | 4 +-- .../ScalarReturnTypeMethods(Int32Async).cs | 4 +-- .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 +-- ...arReturnTypeMethods(Int32NullableAsync).cs | 4 +-- .../ScalarReturnTypeMethods(Int64).cs | 4 +-- .../ScalarReturnTypeMethods(Single).cs | 4 +-- .../ScalarReturnTypeMethods(String).cs | 4 +-- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 +-- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 +-- .../src/Generated/SampleTypeSpecClient.cs | 9 +++-- 37 files changed, 122 insertions(+), 105 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index b88c7fc9a46..b95334fe22c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -648,11 +648,13 @@ private IEnumerable GetStackVariablesForReturnValueConversi && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); - // The stream overload preserves UTF-8 BOM handling from ToObjectFromJson. + // JsonDocument.Parse(Stream) does not strip a leading UTF-8 BOM, so trim it from the + // content string before parsing to preserve ToObjectFromJson's BOM handling. + var content = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var statements = new MethodBodyStatement[] { - UsingDeclare("stream", data.ToStream(), out var stream), - UsingDeclare("document", JsonDocumentSnippets.Parse(stream), out var document) + Declare("content", typeof(string), content, out var contentValue), + UsingDeclare("document", JsonDocumentSnippets.Parse(contentValue), out var document) }; declarations["data"] = data; declarations["document"] = document; @@ -982,13 +984,31 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly; - // any other format (e.g. a custom/unrecognized duration encoding, which maps to - // SerializationFormat.Default and has no format specifier) is unsupported and throws. - _ => content.As().ParseTimeSpan(Literal(format.ToFormatSpecifier() ?? throw new InvalidOperationException($"Unsupported duration serialization format: {format}"))) + // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. + _ => content.As().ParseTimeSpan(Literal(GetDurationFormatSpecifierOrFallback(format))) }; } + /// + /// Resolves the format specifier for a duration encoding, reporting an + /// diagnostic and falling back to the constant + /// ("c") format instead of throwing when the encoding (e.g. a custom/unrecognized duration encoding, + /// which maps to ) has no known format specifier. + /// + private static string GetDurationFormatSpecifierOrFallback(SerializationFormat format) + { + var formatSpecifier = format.ToFormatSpecifier(); + if (formatSpecifier is not null) + { + return formatSpecifier; + } + + ScmCodeModelGenerator.Instance.Emitter.ReportDiagnostic( + DiagnosticCodes.UnsupportedSerialization, + $"Unsupported duration serialization format: {format}. Falling back to the constant (\"c\") format."); + return "c"; + } + /// /// Builds a T.Parse(content, invariantCulture) invocation for the given numeric . /// diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index 4f4f9c88a54..9de15e41fea 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index 9647d755f34..d1964fb2048 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index 98e5b272a4c..d455517fc1d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index 70c3d6840d5..a91fdb1c1af 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index 9f5ac587a7a..ae7f36dfb77 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -6,7 +6,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -37,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -49,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index b2b7509ea97..fa152612afa 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -5,7 +5,6 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -30,8 +29,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -40,8 +39,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index faa71292be9..a58531079f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -6,7 +6,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -37,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -49,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index 06887b83305..c33794b22b7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -5,7 +5,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +35,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -47,8 +46,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index 0186a8403aa..c57f279adbc 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -5,7 +5,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -38,8 +37,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -50,8 +49,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index 88c49fd8973..ffcb38cebba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -6,7 +6,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -37,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content1 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content1); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -49,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content1 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content1); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index 01908bd29d0..c3a8a4f07e2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -5,7 +5,6 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; -using System.IO; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,8 +35,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +47,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 471f274de10..cd9bf69c7eb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1772,7 +1772,7 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy } [Test] - public void PlainTextDurationReturnTypeMethodsThrowsForUnsupportedEncoding() + public void PlainTextDurationReturnTypeMethodsFallsBackForUnsupportedEncoding() { InputType inputType = new InputDurationType(new DurationKnownEncoding("Custom"), "duration", "TypeSpec.duration", InputPrimitiveType.Int32, null); @@ -1783,9 +1783,14 @@ public void PlainTextDurationReturnTypeMethodsThrowsForUnsupportedEncoding() MockHelpers.LoadMockGenerator(); var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); - var methods = new ScmMethodProviderCollection(serviceMethod, client!); - Assert.Throws(() => - methods.Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration")); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + // An unsupported/custom duration encoding has no known format specifier, so generation reports a + // diagnostic and falls back to the constant ("c") format instead of throwing. + Assert.AreEqual(Helpers.GetExpectedFromFile("Constant", method: "PlainTextDurationReturnTypeMethods"), writer.ToString(false)); } [TestCase(true, true, false)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 0dd4072a034..852aebbba1e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 9555f3050c6..436e4b9279f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 5d6b1510df6..69683a932f8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs index 940c12a3f7d..e004129df37 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index c9592dd36ce..be09c28980b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs index 0072803b03f..5ce2e23099b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index e3a9e300663..1cf3ed795da 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 4db817d4b6f..057ea1ef413 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs index 88d44fbf0e4..31b82c8fc16 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index dd042ee9fac..e17daacdef4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); bool value = document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index 4c349955a9a..bd688db8f2d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index c662a01442e..3e25c024fec 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index ec18a48717d..9fe273cc03b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); decimal value = document.RootElement.GetDecimal(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 01640da0a2c..8ccb380fa30 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); double value = document.RootElement.GetDouble(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 7daaac8eb0b..4f2ebeaa888 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index cbabcf7db21..c27126bbfa8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index d06a4e400b4..22b846f5be7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 833c8a112f0..50fc187fe0b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 85908b80a17..124dd51dac5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); long value = document.RootElement.GetInt64(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index aed0acb79b7..732c97cb9a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); float value = document.RootElement.GetSingle(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index ce8389519d2..8476e83978d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 3ef165eb6ee..be7599b073c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index a28d0b0e0f8..bf91854b34f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - using global::System.IO.Stream stream = result.GetRawResponse().Content.ToStream(); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index b67986bee1e..34591f52710 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -10,7 +10,6 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; using System.Net.ServerSentEvents; using System.Text.Json; @@ -2105,8 +2104,8 @@ public virtual async Task GetJsonInt32Async(RequestOptions options public virtual ClientResult GetJsonInt32(CancellationToken cancellationToken = default) { ClientResult result = GetJsonInt32(cancellationToken.ToRequestOptions()); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using JsonDocument document = JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return ClientResult.FromValue(value, result.GetRawResponse()); } @@ -2117,8 +2116,8 @@ public virtual ClientResult GetJsonInt32(CancellationToken cancellationToke public virtual async Task> GetJsonInt32Async(CancellationToken cancellationToken = default) { ClientResult result = await GetJsonInt32Async(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - using Stream stream = result.GetRawResponse().Content.ToStream(); - using JsonDocument document = JsonDocument.Parse(stream); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using JsonDocument document = JsonDocument.Parse(content); int value = document.RootElement.GetInt32(); return ClientResult.FromValue(value, result.GetRawResponse()); } From 5119b68f72cfa51500b5e237a17c164102405744 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:40:16 +0000 Subject: [PATCH 40/47] fix(http-client-csharp): strip BOM in JSON fallback conversion for non-BinaryData-convertible types Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 5 ++++- .../ScalarReturnTypeMethods(Uri).cs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index b95334fe22c..1f509aa1c16 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -308,7 +308,10 @@ .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, new[] { Declare("data", result.GetRawResponse().Content(), out var data), - UsingDeclare("document", data.Parse(), out var jsonDocument), + // JsonDocument.Parse(BinaryData) does not strip a leading UTF-8 BOM, so trim it + // from the content string before parsing (mirroring the primitive/enum path above). + Declare("content", typeof(string), data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(), out var content), + UsingDeclare("document", JsonDocumentSnippets.Parse(content), out var jsonDocument), Declare("element", jsonDocument.RootElement(), out var jsonElement), Return(result.FromValue( ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs index c6a19f33fe1..d132faecfea 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs @@ -2,7 +2,8 @@ { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); global::System.BinaryData data = result.GetRawResponse().Content; - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(data); + string content = data.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); global::System.Text.Json.JsonElement element = document.RootElement; return global::System.ClientModel.ClientResult.FromValue(new global::System.Uri(element.GetString(), global::System.UriKind.RelativeOrAbsolute), result.GetRawResponse()); } From 6a987a4cadeabb1437c80f2d8fda1587c83e25ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:46:23 +0000 Subject: [PATCH 41/47] fix(http-client-csharp): make primitive response fallbacks safe Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 50 +- .../ScmMethodProviderCollectionTests.cs | 26 +- ...thodsReportsUnsupportedEncoding(Custom).cs | 7 + .../ScalarReturnTypeMethods(Byte).cs | 8 + .../ScalarReturnTypeMethods(SByte).cs | 8 + .../ScalarReturnTypeMethods(Uri).cs | 7 +- .../Local.Tests/PrimitiveResponseTests.cs | 22 + .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 8 + .../SampleTypeSpecClient.RestClient.cs | 12 + .../src/Generated/SampleTypeSpecClient.cs | 58 + .../Local/Sample-TypeSpec/tspCodeModel.json | 2434 +++++++++-------- 11 files changed, 1454 insertions(+), 1186 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 1f509aa1c16..da22c91db54 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -297,12 +297,10 @@ .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out va .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out var paramDeclarations), Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result), .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations), - // Text/plain primitive and enum responses are parsed directly from the response content, bypassing the - // BinaryData/JsonDocument conversion path entirely. Route them through GetResultConversionStatements even - // when the response body type isn't in the IsConvertibleFromBinaryData allow-list (e.g. Guid, Uri, or the - // byte/short/unsigned integer types), otherwise they would incorrectly fall back to JSON parsing. + // Route primitive and enum responses through GetResultConversionStatements even when the response body type + // isn't in the IsConvertibleFromBinaryData allow-list (e.g. Uri or the byte/short/unsigned integer types). IsConvertibleFromBinaryData(responseBodyType) - || (IsPlainTextParsableType(responseBodyType) && HasOnlyPlainTextContentType()) + || IsPlainTextParsableType(responseBodyType) ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] @@ -645,19 +643,17 @@ private IEnumerable GetStackVariablesForReturnValueConversi out declarations); } - if (IsConvertibleFromBinaryData(responseBodyType) + if ((IsConvertibleFromBinaryData(responseBodyType) || IsPlainTextParsableType(responseBodyType)) && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && !responseBodyType.Equals(typeof(BinaryData)) && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); - // JsonDocument.Parse(Stream) does not strip a leading UTF-8 BOM, so trim it from the - // content string before parsing to preserve ToObjectFromJson's BOM handling. - var content = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); + var contentExpression = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var statements = new MethodBodyStatement[] { - Declare("content", typeof(string), content, out var contentValue), - UsingDeclare("document", JsonDocumentSnippets.Parse(contentValue), out var document) + Declare("content", typeof(string), contentExpression, out var content), + UsingDeclare("document", JsonDocumentSnippets.Parse(content), out var document) }; declarations["data"] = data; declarations["document"] = document; @@ -970,6 +966,16 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, ValueExpression invariantCulture) { var format = GetResponseSerializationFormat(); + var formatSpecifier = format.ToFormatSpecifier(); + if (formatSpecifier is null) + { + ScmCodeModelGenerator.Instance.Emitter.ReportDiagnostic( + DiagnosticCodes.UnsupportedSerialization, + $"Unsupported duration serialization format: {format}. Falling back to constant duration format.", + ServiceMethod.Operation.CrossLanguageDefinitionId); + formatSpecifier = SerializationFormat.Duration_Constant.ToFormatSpecifier(); + } + return format switch { SerializationFormat.Duration_Seconds => @@ -988,30 +994,10 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, // See the Duration_Seconds_Float/Double comment above. TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. - _ => content.As().ParseTimeSpan(Literal(GetDurationFormatSpecifierOrFallback(format))) + _ => content.As().ParseTimeSpan(Literal(formatSpecifier)) }; } - /// - /// Resolves the format specifier for a duration encoding, reporting an - /// diagnostic and falling back to the constant - /// ("c") format instead of throwing when the encoding (e.g. a custom/unrecognized duration encoding, - /// which maps to ) has no known format specifier. - /// - private static string GetDurationFormatSpecifierOrFallback(SerializationFormat format) - { - var formatSpecifier = format.ToFormatSpecifier(); - if (formatSpecifier is not null) - { - return formatSpecifier; - } - - ScmCodeModelGenerator.Instance.Emitter.ReportDiagnostic( - DiagnosticCodes.UnsupportedSerialization, - $"Unsupported duration serialization format: {format}. Falling back to the constant (\"c\") format."); - return "c"; - } - /// /// Builds a T.Parse(content, invariantCulture) invocation for the given numeric . /// diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index cd9bf69c7eb..52400cd9774 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -5,12 +5,15 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net.ServerSentEvents; +using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.EmitterRpc; using Microsoft.TypeSpec.Generator.Input; using Microsoft.TypeSpec.Generator.Input.Extensions; using Microsoft.TypeSpec.Generator.Primitives; @@ -1570,6 +1573,8 @@ public void ListMethodIsRenamedToGet() [TestCase(typeof(bool?))] [TestCase(typeof(string))] [TestCase(typeof(Uri))] + [TestCase(typeof(byte))] + [TestCase(typeof(sbyte))] [TestCase(typeof(BinaryData))] [TestCase(typeof(DateTimeOffset))] [TestCase(typeof(TimeSpan))] @@ -1589,6 +1594,8 @@ public void ScalarReturnTypeMethods(Type type, bool isAsync = false) { } t when t == typeof(int) => InputPrimitiveType.Int32, { } t when t == typeof(long) => InputPrimitiveType.Int64, { } t when t == typeof(Uri) => InputPrimitiveType.Url, + { } t when t == typeof(byte) => new InputPrimitiveType(InputPrimitiveTypeKind.UInt8, "uint8", "TypeSpec.uint8"), + { } t when t == typeof(sbyte) => new InputPrimitiveType(InputPrimitiveTypeKind.Int8, "int8", "TypeSpec.int8"), { } t when t == typeof(BinaryData) => InputPrimitiveType.Base64, _ => null }; @@ -1772,7 +1779,7 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy } [Test] - public void PlainTextDurationReturnTypeMethodsFallsBackForUnsupportedEncoding() + public void PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding() { InputType inputType = new InputDurationType(new DurationKnownEncoding("Custom"), "duration", "TypeSpec.duration", InputPrimitiveType.Int32, null); @@ -1781,16 +1788,21 @@ public void PlainTextDurationReturnTypeMethodsFallsBackForUnsupportedEncoding() var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextDuration", operation); var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); - MockHelpers.LoadMockGenerator(); + using var output = new MemoryStream(); + using var emitter = new Emitter(output); + var mockGenerator = MockHelpers.LoadMockGenerator(); + mockGenerator.SetupGet(p => p.Emitter).Returns(emitter); var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); - var method = new ScmMethodProviderCollection(serviceMethod, client!) - .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration"); + var methods = new ScmMethodProviderCollection(serviceMethod, client!); + var method = methods.Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration"); using var writer = new CodeWriter(); writer.WriteMethod(method); - // An unsupported/custom duration encoding has no known format specifier, so generation reports a - // diagnostic and falls back to the constant ("c") format instead of throwing. - Assert.AreEqual(Helpers.GetExpectedFromFile("Constant", method: "PlainTextDurationReturnTypeMethods"), writer.ToString(false)); + Assert.AreEqual(Helpers.GetExpectedFromFile("Custom"), writer.ToString(false)); + + output.Position = 0; + using var reader = new StreamReader(output, Encoding.UTF8); + StringAssert.Contains(@"""code"":""unsupported-serialization""", reader.ReadToEnd()); } [TestCase(true, true, false)] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs new file mode 100644 index 00000000000..b67c8f1613f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs @@ -0,0 +1,7 @@ +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs new file mode 100644 index 00000000000..501270a5126 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs @@ -0,0 +1,8 @@ +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + byte value = document.RootElement.GetByte(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs new file mode 100644 index 00000000000..fc016db7c98 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs @@ -0,0 +1,8 @@ +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +{ + global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + sbyte value = document.RootElement.GetSByte(); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs index d132faecfea..67fc6983cda 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs @@ -1,9 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - global::System.BinaryData data = result.GetRawResponse().Content; - string content = data.ToString().TrimStart(''); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); - global::System.Text.Json.JsonElement element = document.RootElement; - return global::System.ClientModel.ClientResult.FromValue(new global::System.Uri(element.GetString(), global::System.UriKind.RelativeOrAbsolute), result.GetRawResponse()); + global::System.Uri value = new global::System.Uri(document.RootElement.GetString(), global::System.UriKind.RelativeOrAbsolute); + return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs index c9d6fbc23ab..a18c819431c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs @@ -39,5 +39,27 @@ public async Task JsonInt32ResponseDeserialization(bool hasBom, bool isAsync) Assert.AreSame(response.Object, result.GetRawResponse()); Assert.AreSame(content, result.GetRawResponse().Content); } + + [TestCase(false)] + [TestCase(true)] + public async Task JsonUint8ResponseDeserialization(bool isAsync) + { + var payload = Encoding.UTF8.GetBytes("42"); + var content = BinaryData.FromBytes([.. Encoding.UTF8.GetPreamble(), .. payload]); + var response = new Mock(); + response.SetupGet(r => r.Content).Returns(content); + var protocolResult = ClientResult.FromResponse(response.Object); + var client = new Mock { CallBase = true }; + client.Setup(c => c.GetJsonUint8(It.IsAny())).Returns(protocolResult); + client.Setup(c => c.GetJsonUint8Async(It.IsAny())).ReturnsAsync(protocolResult); + + var result = isAsync + ? await client.Object.GetJsonUint8Async() + : client.Object.GetJsonUint8(); + + Assert.AreEqual(42, result.Value); + Assert.AreSame(response.Object, result.GetRawResponse()); + Assert.AreSame(content, result.GetRawResponse().Content); + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 5082930e1ed..3884111de59 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -955,3 +955,11 @@ op getJsonInt32(): { @body body: int32; @header contentType: "application/json"; }; + +@get +@route("/json-uint8") +@doc("get JSON uint8") +op getJsonUint8(): { + @body body: uint8; + @header contentType: "application/json"; +}; diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index 3b1bfa50e55..9497f27782f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -511,5 +511,17 @@ internal PipelineMessage CreateGetJsonInt32Request(RequestOptions options) message.Apply(options); return message; } + + internal PipelineMessage CreateGetJsonUint8Request(RequestOptions options) + { + ClientUriBuilder uri = new ClientUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/json-uint8", false); + PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); + PipelineRequest request = message.Request; + request.Headers.Set("Accept", "application/json"); + message.Apply(options); + return message; + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 34591f52710..36180bc32c5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -2122,6 +2122,64 @@ public virtual async Task> GetJsonInt32Async(CancellationToken return ClientResult.FromValue(value, result.GetRawResponse()); } + /// + /// [Protocol Method] get JSON uint8 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual ClientResult GetJsonUint8(RequestOptions options) + { + using PipelineMessage message = CreateGetJsonUint8Request(options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + /// + /// [Protocol Method] get JSON uint8 + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + public virtual async Task GetJsonUint8Async(RequestOptions options) + { + using PipelineMessage message = CreateGetJsonUint8Request(options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + /// get JSON uint8. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual ClientResult GetJsonUint8(CancellationToken cancellationToken = default) + { + ClientResult result = GetJsonUint8(cancellationToken.ToRequestOptions()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using JsonDocument document = JsonDocument.Parse(content); + byte value = document.RootElement.GetByte(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + + /// get JSON uint8. + /// The cancellation token that can be used to cancel the operation. + /// Service returned a non-success status code. + public virtual async Task> GetJsonUint8Async(CancellationToken cancellationToken = default) + { + ClientResult result = await GetJsonUint8Async(cancellationToken.ToRequestOptions()).ConfigureAwait(false); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using JsonDocument document = JsonDocument.Parse(content); + byte value = document.RootElement.GetByte(); + return ClientResult.FromValue(value, result.GetRawResponse()); + } + /// Initializes a new instance of AnimalOperations. public virtual AnimalOperations GetAnimalOperationsClient() { diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 623f6c30b1a..8ffb1293fe5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -2271,7 +2271,7 @@ { "$id": "232", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType6", + "name": "GetJsonInt32ResponseContentType40", "namespace": "", "usage": "None", "valueType": { @@ -2281,14 +2281,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "234", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType7", + "name": "GetJsonInt32ResponseContentType41", "namespace": "", "usage": "None", "valueType": { @@ -2298,14 +2298,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "236", "kind": "constant", - "name": "GetJsonInt32ResponseContentType40", + "name": "GetXmlAdvancedModelResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -2315,14 +2315,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "238", "kind": "constant", - "name": "GetJsonInt32ResponseContentType41", + "name": "GetXmlAdvancedModelResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -2332,14 +2332,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "240", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType8", + "name": "GetJsonInt32ResponseContentType42", "namespace": "", "usage": "None", "valueType": { @@ -2349,14 +2349,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "242", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType9", + "name": "GetJsonInt32ResponseContentType43", "namespace": "", "usage": "None", "valueType": { @@ -2366,14 +2366,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "244", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType10", + "name": "GetXmlAdvancedModelResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -2390,7 +2390,7 @@ { "$id": "246", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType11", + "name": "GetXmlAdvancedModelResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -2407,7 +2407,7 @@ { "$id": "248", "kind": "constant", - "name": "GetJsonInt32ResponseContentType42", + "name": "GetXmlAdvancedModelResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -2417,14 +2417,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "250", "kind": "constant", - "name": "GetJsonInt32ResponseContentType43", + "name": "GetXmlAdvancedModelResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -2434,7 +2434,7 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, @@ -2505,11 +2505,45 @@ "value": "application/json", "decorators": [], "isExactName": false + }, + { + "$id": "260", + "kind": "constant", + "name": "GetJsonInt32ResponseContentType48", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "262", + "kind": "constant", + "name": "GetJsonInt32ResponseContentType49", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false } ], "models": [ { - "$id": "260", + "$id": "264", "kind": "model", "name": "Thing", "apiVersions": [ @@ -2529,7 +2563,7 @@ "isExactName": false, "properties": [ { - "$id": "261", + "$id": "265", "kind": "property", "name": "name", "apiVersions": [ @@ -2539,7 +2573,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "262", + "$id": "266", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2560,7 +2594,7 @@ "isExactName": false }, { - "$id": "263", + "$id": "267", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -2570,23 +2604,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "264", + "$id": "268", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "265", + "$id": "269", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "266", + "$id": "270", "kind": "array", "name": "Array", "valueType": { - "$id": "267", + "$id": "271", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2596,7 +2630,7 @@ "decorators": [] }, { - "$id": "268", + "$id": "272", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2622,7 +2656,7 @@ "isExactName": false }, { - "$id": "269", + "$id": "273", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -2649,7 +2683,7 @@ "isExactName": false }, { - "$id": "270", + "$id": "274", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -2659,10 +2693,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "271", + "$id": "275", "kind": "nullable", "type": { - "$id": "272", + "$id": "276", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2685,7 +2719,7 @@ "isExactName": false }, { - "$id": "273", + "$id": "277", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -2695,10 +2729,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "274", + "$id": "278", "kind": "nullable", "type": { - "$id": "275", + "$id": "279", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2721,7 +2755,7 @@ "isExactName": false }, { - "$id": "276", + "$id": "280", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -2748,7 +2782,7 @@ "isExactName": false }, { - "$id": "277", + "$id": "281", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -2775,7 +2809,7 @@ "isExactName": false }, { - "$id": "278", + "$id": "282", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -2802,7 +2836,7 @@ "isExactName": false }, { - "$id": "279", + "$id": "283", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -2829,7 +2863,7 @@ "isExactName": false }, { - "$id": "280", + "$id": "284", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -2839,7 +2873,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "281", + "$id": "285", "kind": "nullable", "type": { "$ref": "5" @@ -2861,7 +2895,7 @@ "isExactName": false }, { - "$id": "282", + "$id": "286", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -2888,7 +2922,7 @@ "isExactName": false }, { - "$id": "283", + "$id": "287", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -2915,7 +2949,7 @@ "isExactName": false }, { - "$id": "284", + "$id": "288", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -2942,7 +2976,7 @@ "isExactName": false }, { - "$id": "285", + "$id": "289", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -2952,7 +2986,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "286", + "$id": "290", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2973,7 +3007,7 @@ "isExactName": false }, { - "$id": "287", + "$id": "291", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -2983,14 +3017,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "288", + "$id": "292", "kind": "nullable", "type": { - "$id": "289", + "$id": "293", "kind": "array", "name": "Array1", "valueType": { - "$id": "290", + "$id": "294", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3016,7 +3050,7 @@ "isExactName": false }, { - "$id": "291", + "$id": "295", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -3026,10 +3060,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "292", + "$id": "296", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -3048,7 +3082,7 @@ "isExactName": false }, { - "$id": "293", + "$id": "297", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3058,7 +3092,7 @@ "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "294", + "$id": "298", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3081,7 +3115,7 @@ ] }, { - "$id": "295", + "$id": "299", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3101,7 +3135,7 @@ "isExactName": false, "properties": [ { - "$id": "296", + "$id": "300", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3111,7 +3145,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "297", + "$id": "301", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3132,7 +3166,7 @@ "isExactName": false }, { - "$id": "298", + "$id": "302", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -3142,7 +3176,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "299", + "$id": "303", "kind": "int32", "name": "int32", "encode": "string", @@ -3164,7 +3198,7 @@ "isExactName": false }, { - "$id": "300", + "$id": "304", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -3174,7 +3208,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "301", + "$id": "305", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -3198,7 +3232,7 @@ "isExactName": false }, { - "$id": "302", + "$id": "306", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -3208,10 +3242,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "303", + "$id": "307", "kind": "dict", "keyType": { - "$id": "304", + "$id": "308", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3237,7 +3271,7 @@ "isExactName": false }, { - "$id": "305", + "$id": "309", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -3247,7 +3281,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "260" + "$ref": "264" }, "optional": false, "readOnly": false, @@ -3264,7 +3298,7 @@ "isExactName": false }, { - "$id": "306", + "$id": "310", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -3291,7 +3325,7 @@ "isExactName": false }, { - "$id": "307", + "$id": "311", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -3301,7 +3335,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "308", + "$id": "312", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -3325,7 +3359,7 @@ "isExactName": false }, { - "$id": "309", + "$id": "313", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -3352,7 +3386,7 @@ "isExactName": false }, { - "$id": "310", + "$id": "314", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -3379,7 +3413,7 @@ "isExactName": false }, { - "$id": "311", + "$id": "315", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -3389,7 +3423,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "312", + "$id": "316", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -3413,7 +3447,7 @@ "isExactName": false }, { - "$id": "313", + "$id": "317", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -3440,7 +3474,7 @@ "isExactName": false }, { - "$id": "314", + "$id": "318", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -3467,7 +3501,7 @@ "isExactName": false }, { - "$id": "315", + "$id": "319", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -3477,7 +3511,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "316", + "$id": "320", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -3501,7 +3535,7 @@ "isExactName": false }, { - "$id": "317", + "$id": "321", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -3528,7 +3562,7 @@ "isExactName": false }, { - "$id": "318", + "$id": "322", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -3538,7 +3572,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "319", + "$id": "323", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -3562,7 +3596,7 @@ "isExactName": false }, { - "$id": "320", + "$id": "324", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -3589,7 +3623,7 @@ "isExactName": false }, { - "$id": "321", + "$id": "325", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -3599,7 +3633,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "322", + "$id": "326", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3620,7 +3654,7 @@ "isExactName": false }, { - "$id": "323", + "$id": "327", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -3630,7 +3664,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "324", + "$id": "328", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3651,7 +3685,7 @@ "isExactName": false }, { - "$id": "325", + "$id": "329", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -3661,17 +3695,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "326", + "$id": "330", "kind": "dict", "keyType": { - "$id": "327", + "$id": "331", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "328", + "$id": "332", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3694,7 +3728,7 @@ "isExactName": false }, { - "$id": "329", + "$id": "333", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -3704,7 +3738,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "326" + "$ref": "330" }, "optional": true, "readOnly": false, @@ -3721,7 +3755,7 @@ "isExactName": false }, { - "$id": "330", + "$id": "334", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -3731,7 +3765,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "326" + "$ref": "330" }, "optional": false, "readOnly": true, @@ -3748,7 +3782,7 @@ "isExactName": false }, { - "$id": "331", + "$id": "335", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -3758,7 +3792,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "326" + "$ref": "330" }, "optional": true, "readOnly": true, @@ -3775,7 +3809,7 @@ "isExactName": false }, { - "$id": "332", + "$id": "336", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -3785,7 +3819,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "333", + "$id": "337", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -3805,7 +3839,7 @@ "isExactName": false, "properties": [ { - "$id": "334", + "$id": "338", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -3815,10 +3849,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "335", + "$id": "339", "kind": "nullable", "type": { - "$id": "336", + "$id": "340", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3841,7 +3875,7 @@ "isExactName": false }, { - "$id": "337", + "$id": "341", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -3851,7 +3885,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "338", + "$id": "342", "kind": "nullable", "type": { "$ref": "22" @@ -3873,7 +3907,7 @@ "isExactName": false }, { - "$id": "339", + "$id": "343", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -3883,7 +3917,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "340", + "$id": "344", "kind": "nullable", "type": { "$ref": "17" @@ -3921,7 +3955,7 @@ "isExactName": false }, { - "$id": "341", + "$id": "345", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -3931,7 +3965,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "342", + "$id": "346", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -3955,10 +3989,10 @@ ] }, { - "$ref": "333" + "$ref": "337" }, { - "$id": "343", + "$id": "347", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -3973,7 +4007,7 @@ "isExactName": false, "properties": [ { - "$id": "344", + "$id": "348", "kind": "property", "name": "p1", "apiVersions": [ @@ -3982,7 +4016,7 @@ ], "doc": "header parameter", "type": { - "$id": "345", + "$id": "349", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3999,7 +4033,7 @@ "isExactName": false }, { - "$id": "346", + "$id": "350", "kind": "property", "name": "action", "apiVersions": [ @@ -4008,7 +4042,7 @@ ], "doc": "body parameter", "type": { - "$ref": "295" + "$ref": "299" }, "optional": false, "readOnly": false, @@ -4021,7 +4055,7 @@ "isExactName": false }, { - "$id": "347", + "$id": "351", "kind": "property", "name": "p2", "apiVersions": [ @@ -4030,7 +4064,7 @@ ], "doc": "path parameter", "type": { - "$id": "348", + "$id": "352", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4049,7 +4083,7 @@ ] }, { - "$id": "349", + "$id": "353", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4069,7 +4103,7 @@ "isExactName": false, "properties": [ { - "$id": "350", + "$id": "354", "kind": "property", "name": "name", "apiVersions": [ @@ -4079,7 +4113,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "351", + "$id": "355", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4102,7 +4136,7 @@ ] }, { - "$id": "352", + "$id": "356", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -4122,7 +4156,7 @@ "isExactName": false, "properties": [ { - "$id": "353", + "$id": "357", "kind": "property", "name": "otherName", "apiVersions": [ @@ -4132,7 +4166,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "354", + "$id": "358", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4155,7 +4189,7 @@ ] }, { - "$id": "355", + "$id": "359", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -4175,7 +4209,7 @@ "properties": [] }, { - "$id": "356", + "$id": "360", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -4194,7 +4228,7 @@ "isExactName": false, "properties": [ { - "$id": "357", + "$id": "361", "kind": "property", "name": "things", "apiVersions": [ @@ -4203,11 +4237,11 @@ ], "serializedName": "things", "type": { - "$id": "358", + "$id": "362", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "260" + "$ref": "264" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -4227,7 +4261,7 @@ "isExactName": false }, { - "$id": "359", + "$id": "363", "kind": "property", "name": "next", "apiVersions": [ @@ -4236,7 +4270,7 @@ ], "serializedName": "next", "type": { - "$id": "360", + "$id": "364", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -4259,7 +4293,7 @@ ] }, { - "$id": "361", + "$id": "365", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -4278,7 +4312,7 @@ "isExactName": false, "properties": [ { - "$id": "362", + "$id": "366", "kind": "property", "name": "things", "apiVersions": [ @@ -4287,7 +4321,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4304,7 +4338,7 @@ "isExactName": false }, { - "$id": "363", + "$id": "367", "kind": "property", "name": "next", "apiVersions": [ @@ -4313,7 +4347,7 @@ ], "serializedName": "next", "type": { - "$id": "364", + "$id": "368", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4336,7 +4370,7 @@ ] }, { - "$id": "365", + "$id": "369", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -4355,7 +4389,7 @@ "isExactName": false, "properties": [ { - "$id": "366", + "$id": "370", "kind": "property", "name": "things", "apiVersions": [ @@ -4364,7 +4398,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4381,7 +4415,7 @@ "isExactName": false }, { - "$id": "367", + "$id": "371", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -4390,7 +4424,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "368", + "$id": "372", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4413,7 +4447,7 @@ ] }, { - "$id": "369", + "$id": "373", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -4429,7 +4463,7 @@ "isExactName": false, "properties": [ { - "$id": "370", + "$id": "374", "kind": "property", "name": "things", "apiVersions": [ @@ -4438,7 +4472,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4457,7 +4491,7 @@ ] }, { - "$id": "371", + "$id": "375", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -4476,7 +4510,7 @@ "isExactName": false, "properties": [ { - "$id": "372", + "$id": "376", "kind": "property", "name": "items", "apiVersions": [ @@ -4485,7 +4519,7 @@ ], "serializedName": "items", "type": { - "$ref": "358" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4504,7 +4538,7 @@ ] }, { - "$id": "373", + "$id": "377", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -4523,7 +4557,7 @@ "isExactName": false, "properties": [ { - "$id": "374", + "$id": "378", "kind": "property", "name": "name", "apiVersions": [ @@ -4533,7 +4567,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "375", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4554,7 +4588,7 @@ "isExactName": false }, { - "$id": "376", + "$id": "380", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -4564,7 +4598,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "377", + "$id": "381", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4585,7 +4619,7 @@ "isExactName": false }, { - "$id": "378", + "$id": "382", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -4595,7 +4629,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "379", + "$id": "383", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4616,7 +4650,7 @@ "isExactName": false }, { - "$id": "380", + "$id": "384", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -4626,7 +4660,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "381", + "$id": "385", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4647,7 +4681,7 @@ "isExactName": false }, { - "$id": "382", + "$id": "386", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -4657,7 +4691,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "383", + "$id": "387", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4680,7 +4714,7 @@ ] }, { - "$id": "384", + "$id": "388", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -4705,7 +4739,7 @@ "isExactName": false, "properties": [ { - "$id": "385", + "$id": "389", "kind": "property", "name": "name", "apiVersions": [ @@ -4714,7 +4748,7 @@ ], "serializedName": "name", "type": { - "$id": "386", + "$id": "390", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4735,7 +4769,7 @@ "isExactName": false }, { - "$id": "387", + "$id": "391", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4744,7 +4778,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "388", + "$id": "392", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4765,7 +4799,7 @@ "isExactName": false }, { - "$id": "389", + "$id": "393", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -4774,7 +4808,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "390", + "$id": "394", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4795,7 +4829,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "395", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -4804,10 +4838,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "392", + "$id": "396", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -4826,7 +4860,7 @@ "isExactName": false }, { - "$id": "393", + "$id": "397", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -4835,10 +4869,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "394", + "$id": "398", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -4857,7 +4891,7 @@ "isExactName": false }, { - "$id": "395", + "$id": "399", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -4866,20 +4900,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "396", + "$id": "400", "kind": "nullable", "type": { - "$id": "397", + "$id": "401", "kind": "dict", "keyType": { - "$id": "398", + "$id": "402", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "399", + "$id": "403", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4904,7 +4938,7 @@ "isExactName": false }, { - "$id": "400", + "$id": "404", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -4913,10 +4947,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "401", + "$id": "405", "kind": "nullable", "type": { - "$ref": "397" + "$ref": "401" }, "namespace": "SampleTypeSpec" }, @@ -4935,7 +4969,7 @@ "isExactName": false }, { - "$id": "402", + "$id": "406", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -4944,7 +4978,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "397" + "$ref": "401" }, "optional": false, "readOnly": false, @@ -4961,7 +4995,7 @@ "isExactName": false }, { - "$id": "403", + "$id": "407", "kind": "property", "name": "foo", "apiVersions": [ @@ -4970,7 +5004,7 @@ ], "serializedName": "foo", "type": { - "$id": "404", + "$id": "408", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -4995,7 +5029,7 @@ "isExactName": false, "properties": [ { - "$id": "405", + "$id": "409", "kind": "property", "name": "bar", "apiVersions": [ @@ -5004,7 +5038,7 @@ ], "serializedName": "bar", "type": { - "$id": "406", + "$id": "410", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5041,7 +5075,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "411", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5050,11 +5084,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "408", + "$id": "412", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "404" + "$ref": "408" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5074,7 +5108,7 @@ "isExactName": false }, { - "$id": "409", + "$id": "413", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -5083,11 +5117,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "410", + "$id": "414", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "408" + "$ref": "412" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5107,7 +5141,7 @@ "isExactName": false }, { - "$id": "411", + "$id": "415", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -5116,17 +5150,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "412", + "$id": "416", "kind": "dict", "keyType": { - "$id": "413", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "404" + "$ref": "408" }, "decorators": [] }, @@ -5145,7 +5179,7 @@ "isExactName": false }, { - "$id": "414", + "$id": "418", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -5154,17 +5188,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "415", + "$id": "419", "kind": "dict", "keyType": { - "$id": "416", + "$id": "420", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "412" + "$ref": "416" }, "decorators": [] }, @@ -5183,7 +5217,7 @@ "isExactName": false }, { - "$id": "417", + "$id": "421", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -5192,17 +5226,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "418", + "$id": "422", "kind": "dict", "keyType": { - "$id": "419", + "$id": "423", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "408" + "$ref": "412" }, "decorators": [] }, @@ -5221,7 +5255,7 @@ "isExactName": false }, { - "$id": "420", + "$id": "424", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -5230,11 +5264,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "421", + "$id": "425", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "412" + "$ref": "416" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5256,10 +5290,10 @@ ] }, { - "$ref": "404" + "$ref": "408" }, { - "$id": "422", + "$id": "426", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -5288,7 +5322,7 @@ "isExactName": false, "properties": [ { - "$id": "423", + "$id": "427", "kind": "property", "name": "name", "apiVersions": [ @@ -5298,7 +5332,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "424", + "$id": "428", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5321,7 +5355,7 @@ "isExactName": false }, { - "$id": "425", + "$id": "429", "kind": "property", "name": "age", "apiVersions": [ @@ -5331,7 +5365,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "426", + "$id": "430", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5354,7 +5388,7 @@ "isExactName": false }, { - "$id": "427", + "$id": "431", "kind": "property", "name": "enabled", "apiVersions": [ @@ -5364,7 +5398,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "428", + "$id": "432", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5387,7 +5421,7 @@ "isExactName": false }, { - "$id": "429", + "$id": "433", "kind": "property", "name": "score", "apiVersions": [ @@ -5397,7 +5431,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "430", + "$id": "434", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -5420,7 +5454,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "435", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -5430,7 +5464,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "432", + "$id": "436", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5453,7 +5487,7 @@ "isExactName": false }, { - "$id": "433", + "$id": "437", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5463,7 +5497,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "434", + "$id": "438", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5486,7 +5520,7 @@ "isExactName": false }, { - "$id": "435", + "$id": "439", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -5496,10 +5530,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "436", + "$id": "440", "kind": "nullable", "type": { - "$id": "437", + "$id": "441", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5524,7 +5558,7 @@ "isExactName": false }, { - "$id": "438", + "$id": "442", "kind": "property", "name": "id", "apiVersions": [ @@ -5534,7 +5568,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "439", + "$id": "443", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5562,7 +5596,7 @@ "isExactName": false }, { - "$id": "440", + "$id": "444", "kind": "property", "name": "version", "apiVersions": [ @@ -5572,7 +5606,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "441", + "$id": "445", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5600,7 +5634,7 @@ "isExactName": false }, { - "$id": "442", + "$id": "446", "kind": "property", "name": "isActive", "apiVersions": [ @@ -5610,7 +5644,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "443", + "$id": "447", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5638,7 +5672,7 @@ "isExactName": false }, { - "$id": "444", + "$id": "448", "kind": "property", "name": "originalName", "apiVersions": [ @@ -5648,7 +5682,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "445", + "$id": "449", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5678,7 +5712,7 @@ "isExactName": false }, { - "$id": "446", + "$id": "450", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -5688,7 +5722,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "447", + "$id": "451", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5722,7 +5756,7 @@ "isExactName": false }, { - "$id": "448", + "$id": "452", "kind": "property", "name": "content", "apiVersions": [ @@ -5732,7 +5766,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "449", + "$id": "453", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5760,7 +5794,7 @@ "isExactName": false }, { - "$id": "450", + "$id": "454", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -5770,7 +5804,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "266" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -5795,7 +5829,7 @@ "isExactName": false }, { - "$id": "451", + "$id": "455", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -5805,7 +5839,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "289" + "$ref": "293" }, "optional": false, "readOnly": false, @@ -5830,7 +5864,7 @@ "isExactName": false }, { - "$id": "452", + "$id": "456", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -5840,11 +5874,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "453", + "$id": "457", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "454", + "$id": "458", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -5873,7 +5907,7 @@ "isExactName": false, "properties": [ { - "$id": "455", + "$id": "459", "kind": "property", "name": "itemName", "apiVersions": [ @@ -5883,7 +5917,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "456", + "$id": "460", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5906,7 +5940,7 @@ "isExactName": false }, { - "$id": "457", + "$id": "461", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -5916,7 +5950,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "458", + "$id": "462", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5939,7 +5973,7 @@ "isExactName": false }, { - "$id": "459", + "$id": "463", "kind": "property", "name": "itemId", "apiVersions": [ @@ -5949,7 +5983,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "460", + "$id": "464", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6004,7 +6038,7 @@ "isExactName": false }, { - "$id": "461", + "$id": "465", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -6014,7 +6048,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "266" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -6034,7 +6068,7 @@ "isExactName": false }, { - "$id": "462", + "$id": "466", "kind": "property", "name": "items", "apiVersions": [ @@ -6044,7 +6078,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "453" + "$ref": "457" }, "optional": false, "readOnly": false, @@ -6071,7 +6105,7 @@ "isExactName": false }, { - "$id": "463", + "$id": "467", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -6081,7 +6115,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "464", + "$id": "468", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -6103,7 +6137,7 @@ "isExactName": false, "properties": [ { - "$id": "465", + "$id": "469", "kind": "property", "name": "value", "apiVersions": [ @@ -6113,7 +6147,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "466", + "$id": "470", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6136,7 +6170,7 @@ "isExactName": false }, { - "$id": "467", + "$id": "471", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -6146,7 +6180,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "468", + "$id": "472", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6192,7 +6226,7 @@ "isExactName": false }, { - "$id": "469", + "$id": "473", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -6202,7 +6236,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "464" + "$ref": "468" }, "optional": true, "readOnly": false, @@ -6221,7 +6255,7 @@ "isExactName": false }, { - "$id": "470", + "$id": "474", "kind": "property", "name": "metadata", "apiVersions": [ @@ -6231,17 +6265,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "471", + "$id": "475", "kind": "dict", "keyType": { - "$id": "472", + "$id": "476", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "473", + "$id": "477", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6266,7 +6300,7 @@ "isExactName": false }, { - "$id": "474", + "$id": "478", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -6276,12 +6310,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "475", + "$id": "479", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "476", + "$id": "480", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6307,7 +6341,7 @@ "isExactName": false }, { - "$id": "477", + "$id": "481", "kind": "property", "name": "duration", "apiVersions": [ @@ -6317,12 +6351,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "478", + "$id": "482", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "479", + "$id": "483", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6348,7 +6382,7 @@ "isExactName": false }, { - "$id": "480", + "$id": "484", "kind": "property", "name": "data", "apiVersions": [ @@ -6358,7 +6392,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "481", + "$id": "485", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -6382,7 +6416,7 @@ "isExactName": false }, { - "$id": "482", + "$id": "486", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -6392,7 +6426,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "326" + "$ref": "330" }, "optional": true, "readOnly": false, @@ -6411,7 +6445,7 @@ "isExactName": false }, { - "$id": "483", + "$id": "487", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -6440,7 +6474,7 @@ "isExactName": false }, { - "$id": "484", + "$id": "488", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -6469,7 +6503,7 @@ "isExactName": false }, { - "$id": "485", + "$id": "489", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -6498,7 +6532,7 @@ "isExactName": false }, { - "$id": "486", + "$id": "490", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -6527,7 +6561,7 @@ "isExactName": false }, { - "$id": "487", + "$id": "491", "kind": "property", "name": "label", "apiVersions": [ @@ -6536,7 +6570,7 @@ ], "serializedName": "label", "type": { - "$id": "488", + "$id": "492", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6551,14 +6585,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "489", + "$id": "493", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "490", + "$id": "494", "kind": "enum", "decorators": [ { @@ -6571,7 +6605,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "491", + "$id": "495", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -6580,32 +6614,32 @@ }, "values": [ { - "$id": "492", + "$id": "496", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "490" + "$ref": "494" }, "valueType": { - "$ref": "491" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "493", + "$id": "497", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "490" + "$ref": "494" }, "valueType": { - "$ref": "491" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6623,7 +6657,7 @@ "__accessSet": true }, "valueType": { - "$ref": "491" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -6650,7 +6684,7 @@ "isExactName": false }, { - "$id": "494", + "$id": "498", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -6659,7 +6693,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "495", + "$id": "499", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6674,17 +6708,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "496", + "$id": "500", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "490" + "$ref": "494" }, "valueType": { - "$ref": "491" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6707,7 +6741,7 @@ "isExactName": false }, { - "$id": "497", + "$id": "501", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -6716,7 +6750,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "266" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -6748,7 +6782,7 @@ "isExactName": false }, { - "$id": "498", + "$id": "502", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -6757,7 +6791,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "464" + "$ref": "468" }, "optional": false, "readOnly": false, @@ -6788,7 +6822,7 @@ "isExactName": false }, { - "$id": "499", + "$id": "503", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -6797,11 +6831,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "500", + "$id": "504", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "501", + "$id": "505", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -6834,7 +6868,7 @@ "isExactName": false, "properties": [ { - "$id": "502", + "$id": "506", "kind": "property", "name": "foo", "apiVersions": [ @@ -6843,7 +6877,7 @@ ], "serializedName": "foo", "type": { - "$id": "503", + "$id": "507", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6892,7 +6926,7 @@ "isExactName": false }, { - "$id": "504", + "$id": "508", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -6901,7 +6935,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "500" + "$ref": "504" }, "optional": false, "readOnly": false, @@ -6926,7 +6960,7 @@ "isExactName": false }, { - "$id": "505", + "$id": "509", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6935,11 +6969,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "506", + "$id": "510", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "453" + "$ref": "457" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6962,7 +6996,7 @@ "isExactName": false }, { - "$id": "507", + "$id": "511", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -6971,17 +7005,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "508", + "$id": "512", "kind": "dict", "keyType": { - "$id": "509", + "$id": "513", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "454" + "$ref": "458" }, "decorators": [] }, @@ -7002,7 +7036,7 @@ "isExactName": false }, { - "$id": "510", + "$id": "514", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -7011,17 +7045,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "511", + "$id": "515", "kind": "dict", "keyType": { - "$id": "512", + "$id": "516", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "508" + "$ref": "512" }, "decorators": [] }, @@ -7042,7 +7076,7 @@ "isExactName": false }, { - "$id": "513", + "$id": "517", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7051,17 +7085,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "514", + "$id": "518", "kind": "dict", "keyType": { - "$id": "515", + "$id": "519", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "453" + "$ref": "457" }, "decorators": [] }, @@ -7082,7 +7116,7 @@ "isExactName": false }, { - "$id": "516", + "$id": "520", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -7091,11 +7125,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "517", + "$id": "521", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "508" + "$ref": "512" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7120,16 +7154,16 @@ ] }, { - "$ref": "454" + "$ref": "458" }, { - "$ref": "464" + "$ref": "468" }, { - "$ref": "501" + "$ref": "505" }, { - "$id": "518", + "$id": "522", "kind": "model", "name": "Cat", "apiVersions": [ @@ -7144,7 +7178,7 @@ "isExactName": false, "properties": [ { - "$id": "519", + "$id": "523", "kind": "property", "name": "id", "apiVersions": [ @@ -7153,7 +7187,7 @@ ], "serializedName": "id", "type": { - "$id": "520", + "$id": "524", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7180,7 +7214,7 @@ "isExactName": false }, { - "$id": "521", + "$id": "525", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -7189,7 +7223,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "522", + "$id": "526", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -7216,7 +7250,7 @@ "isExactName": false }, { - "$id": "523", + "$id": "527", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -7225,7 +7259,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "524", + "$id": "528", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7252,7 +7286,7 @@ "isExactName": false }, { - "$id": "525", + "$id": "529", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -7261,7 +7295,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "526", + "$id": "530", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -7288,7 +7322,7 @@ "isExactName": false }, { - "$id": "527", + "$id": "531", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -7297,7 +7331,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "528", + "$id": "532", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -7324,7 +7358,7 @@ "isExactName": false }, { - "$id": "529", + "$id": "533", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -7333,7 +7367,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "530", + "$id": "534", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -7360,7 +7394,7 @@ "isExactName": false }, { - "$id": "531", + "$id": "535", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -7369,7 +7403,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "532", + "$id": "536", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -7396,7 +7430,7 @@ "isExactName": false }, { - "$id": "533", + "$id": "537", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -7405,7 +7439,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "534", + "$id": "538", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -7432,7 +7466,7 @@ "isExactName": false }, { - "$id": "535", + "$id": "539", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -7441,7 +7475,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "536", + "$id": "540", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -7468,7 +7502,7 @@ "isExactName": false }, { - "$id": "537", + "$id": "541", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -7477,7 +7511,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "471" + "$ref": "475" }, "optional": false, "readOnly": false, @@ -7500,7 +7534,7 @@ "isExactName": false }, { - "$id": "538", + "$id": "542", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -7509,17 +7543,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "539", + "$id": "543", "kind": "dict", "keyType": { - "$id": "540", + "$id": "544", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "260" + "$ref": "264" }, "decorators": [] }, @@ -7544,7 +7578,7 @@ "isExactName": false }, { - "$id": "541", + "$id": "545", "kind": "property", "name": "listPart", "apiVersions": [ @@ -7553,7 +7587,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "266" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -7576,7 +7610,7 @@ "isExactName": false }, { - "$id": "542", + "$id": "546", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -7585,7 +7619,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "358" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -7608,7 +7642,7 @@ "isExactName": false }, { - "$id": "543", + "$id": "547", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -7617,11 +7651,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "544", + "$id": "548", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "545", + "$id": "549", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7651,7 +7685,7 @@ "isExactName": false }, { - "$id": "546", + "$id": "550", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -7660,7 +7694,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "547", + "$id": "551", "kind": "model", "name": "File", "apiVersions": [], @@ -7675,14 +7709,14 @@ "isFileType": true, "properties": [ { - "$id": "548", + "$id": "552", "kind": "property", "name": "contentType", "apiVersions": [], "summary": "The allowed media (MIME) types of the file contents.", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "type": { - "$id": "549", + "$id": "553", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7699,14 +7733,14 @@ "isExactName": false }, { - "$id": "550", + "$id": "554", "kind": "property", "name": "filename", "apiVersions": [], "summary": "The name of the file, if any.", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "type": { - "$id": "551", + "$id": "555", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7723,14 +7757,14 @@ "isExactName": false }, { - "$id": "552", + "$id": "556", "kind": "property", "name": "contents", "apiVersions": [], "summary": "The contents of the file.", "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", "type": { - "$id": "553", + "$id": "557", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7760,12 +7794,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "554", + "$id": "558", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "summary": "The name of the file, if any.", "apiVersions": [], "type": { - "$id": "555", + "$id": "559", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7796,12 +7830,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "556", + "$id": "560", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "summary": "The allowed media (MIME) types of the file contents.", "apiVersions": [], "type": { - "$id": "557", + "$id": "561", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7842,7 +7876,7 @@ "isExactName": false }, { - "$id": "558", + "$id": "562", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -7874,7 +7908,7 @@ "isExactName": false }, { - "$id": "559", + "$id": "563", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -7906,7 +7940,7 @@ "isExactName": false }, { - "$id": "560", + "$id": "564", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -7938,7 +7972,7 @@ "isExactName": false }, { - "$id": "561", + "$id": "565", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -7972,7 +8006,7 @@ ] }, { - "$id": "562", + "$id": "566", "kind": "model", "name": "File", "apiVersions": [], @@ -7987,18 +8021,18 @@ "isFileType": true, "properties": [ { - "$ref": "548" + "$ref": "552" }, { - "$ref": "550" + "$ref": "554" }, { - "$ref": "552" + "$ref": "556" } ] }, { - "$id": "563", + "$id": "567", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -8017,7 +8051,7 @@ "isExactName": false, "properties": [ { - "$id": "564", + "$id": "568", "kind": "property", "name": "message", "apiVersions": [ @@ -8026,7 +8060,7 @@ ], "serializedName": "message", "type": { - "$id": "565", + "$id": "569", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8049,7 +8083,7 @@ ] }, { - "$id": "566", + "$id": "570", "kind": "model", "name": "Animal", "apiVersions": [ @@ -8068,7 +8102,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "567", + "$id": "571", "kind": "property", "name": "kind", "apiVersions": [ @@ -8078,7 +8112,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "568", + "$id": "572", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8100,10 +8134,10 @@ }, "properties": [ { - "$ref": "567" + "$ref": "571" }, { - "$id": "569", + "$id": "573", "kind": "property", "name": "name", "apiVersions": [ @@ -8113,7 +8147,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "570", + "$id": "574", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8136,7 +8170,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "571", + "$id": "575", "kind": "model", "name": "Pet", "apiVersions": [ @@ -8156,7 +8190,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "572", + "$id": "576", "kind": "property", "name": "kind", "apiVersions": [ @@ -8182,14 +8216,14 @@ "isExactName": false }, "baseModel": { - "$ref": "566" + "$ref": "570" }, "properties": [ { - "$ref": "572" + "$ref": "576" }, { - "$id": "573", + "$id": "577", "kind": "property", "name": "trained", "apiVersions": [ @@ -8199,7 +8233,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "574", + "$id": "578", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8222,7 +8256,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "575", + "$id": "579", "kind": "model", "name": "Dog", "apiVersions": [ @@ -8242,11 +8276,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "571" + "$ref": "575" }, "properties": [ { - "$id": "576", + "$id": "580", "kind": "property", "name": "kind", "apiVersions": [ @@ -8272,7 +8306,7 @@ "isExactName": false }, { - "$id": "577", + "$id": "581", "kind": "property", "name": "breed", "apiVersions": [ @@ -8282,7 +8316,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "578", + "$id": "582", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8307,18 +8341,18 @@ } }, "dog": { - "$ref": "575" + "$ref": "579" } } }, { - "$ref": "571" + "$ref": "575" }, { - "$ref": "575" + "$ref": "579" }, { - "$id": "579", + "$id": "583", "kind": "model", "name": "Tree", "apiVersions": [ @@ -8343,7 +8377,7 @@ }, "isExactName": false, "baseModel": { - "$id": "580", + "$id": "584", "kind": "model", "name": "Plant", "apiVersions": [ @@ -8367,7 +8401,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "581", + "$id": "585", "kind": "property", "name": "species", "apiVersions": [ @@ -8377,7 +8411,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "582", + "$id": "586", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8404,10 +8438,10 @@ }, "properties": [ { - "$ref": "581" + "$ref": "585" }, { - "$id": "583", + "$id": "587", "kind": "property", "name": "id", "apiVersions": [ @@ -8417,7 +8451,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "584", + "$id": "588", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8443,7 +8477,7 @@ "isExactName": false }, { - "$id": "585", + "$id": "589", "kind": "property", "name": "height", "apiVersions": [ @@ -8453,7 +8487,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "586", + "$id": "590", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8481,13 +8515,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "579" + "$ref": "583" } } }, "properties": [ { - "$id": "587", + "$id": "591", "kind": "property", "name": "species", "apiVersions": [ @@ -8518,7 +8552,7 @@ "isExactName": false }, { - "$id": "588", + "$id": "592", "kind": "property", "name": "age", "apiVersions": [ @@ -8528,7 +8562,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "589", + "$id": "593", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8556,10 +8590,10 @@ ] }, { - "$ref": "580" + "$ref": "584" }, { - "$id": "590", + "$id": "594", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -8578,7 +8612,7 @@ "isExactName": false, "properties": [ { - "$id": "591", + "$id": "595", "kind": "property", "name": "numSold", "apiVersions": [ @@ -8587,7 +8621,7 @@ ], "serializedName": "numSold", "type": { - "$id": "592", + "$id": "596", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8608,7 +8642,7 @@ "isExactName": false }, { - "$id": "593", + "$id": "597", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -8617,7 +8651,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "594", + "$id": "598", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8640,7 +8674,7 @@ ] }, { - "$id": "595", + "$id": "599", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -8659,7 +8693,7 @@ "isExactName": false, "properties": [ { - "$id": "596", + "$id": "600", "kind": "property", "name": "name", "apiVersions": [ @@ -8668,7 +8702,7 @@ ], "serializedName": "name", "type": { - "$id": "597", + "$id": "601", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8689,7 +8723,7 @@ "isExactName": false }, { - "$id": "598", + "$id": "602", "kind": "property", "name": "content", "apiVersions": [ @@ -8698,7 +8732,7 @@ ], "serializedName": "content", "type": { - "$id": "599", + "$id": "603", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8721,7 +8755,7 @@ ] }, { - "$id": "600", + "$id": "604", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -8746,7 +8780,7 @@ "isExactName": false, "properties": [ { - "$id": "601", + "$id": "605", "kind": "property", "name": "modelValue", "apiVersions": [ @@ -8755,10 +8789,10 @@ ], "serializedName": "modelValue", "type": { - "$id": "602", + "$id": "606", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8777,7 +8811,7 @@ "isExactName": false }, { - "$id": "603", + "$id": "607", "kind": "property", "name": "children", "apiVersions": [ @@ -8786,17 +8820,17 @@ ], "serializedName": "children", "type": { - "$id": "604", + "$id": "608", "kind": "nullable", "type": { - "$id": "605", + "$id": "609", "kind": "array", "name": "Array2", "valueType": { - "$id": "606", + "$id": "610", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8820,7 +8854,7 @@ "isExactName": false }, { - "$id": "607", + "$id": "611", "kind": "property", "name": "childDictionary", "apiVersions": [ @@ -8829,23 +8863,23 @@ ], "serializedName": "childDictionary", "type": { - "$id": "608", + "$id": "612", "kind": "nullable", "type": { - "$id": "609", + "$id": "613", "kind": "dict", "keyType": { - "$id": "610", + "$id": "614", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "611", + "$id": "615", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8868,7 +8902,7 @@ "isExactName": false }, { - "$id": "612", + "$id": "616", "kind": "property", "name": "nestedChildren", "apiVersions": [ @@ -8877,24 +8911,24 @@ ], "serializedName": "nestedChildren", "type": { - "$id": "613", + "$id": "617", "kind": "nullable", "type": { - "$id": "614", + "$id": "618", "kind": "array", "name": "Array3", "valueType": { - "$id": "615", + "$id": "619", "kind": "nullable", "type": { - "$id": "616", + "$id": "620", "kind": "array", "name": "Array4", "valueType": { - "$id": "617", + "$id": "621", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8923,7 +8957,7 @@ "isExactName": false }, { - "$id": "618", + "$id": "622", "kind": "property", "name": "nestedChildDictionary", "apiVersions": [ @@ -8932,36 +8966,36 @@ ], "serializedName": "nestedChildDictionary", "type": { - "$id": "619", + "$id": "623", "kind": "nullable", "type": { - "$id": "620", + "$id": "624", "kind": "dict", "keyType": { - "$id": "621", + "$id": "625", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "622", + "$id": "626", "kind": "nullable", "type": { - "$id": "623", + "$id": "627", "kind": "dict", "keyType": { - "$id": "624", + "$id": "628", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "625", + "$id": "629", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8988,7 +9022,7 @@ "isExactName": false }, { - "$id": "626", + "$id": "630", "kind": "property", "name": "dictionaryChildren", "apiVersions": [ @@ -8997,30 +9031,30 @@ ], "serializedName": "dictionaryChildren", "type": { - "$id": "627", + "$id": "631", "kind": "nullable", "type": { - "$id": "628", + "$id": "632", "kind": "dict", "keyType": { - "$id": "629", + "$id": "633", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "630", + "$id": "634", "kind": "nullable", "type": { - "$id": "631", + "$id": "635", "kind": "array", "name": "Array5", "valueType": { - "$id": "632", + "$id": "636", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -9048,7 +9082,7 @@ "isExactName": false }, { - "$id": "633", + "$id": "637", "kind": "property", "name": "listOfDictionaries", "apiVersions": [ @@ -9057,30 +9091,30 @@ ], "serializedName": "listOfDictionaries", "type": { - "$id": "634", + "$id": "638", "kind": "nullable", "type": { - "$id": "635", + "$id": "639", "kind": "array", "name": "Array6", "valueType": { - "$id": "636", + "$id": "640", "kind": "nullable", "type": { - "$id": "637", + "$id": "641", "kind": "dict", "keyType": { - "$id": "638", + "$id": "642", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "639", + "$id": "643", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -9110,7 +9144,7 @@ ] }, { - "$id": "640", + "$id": "644", "kind": "model", "name": "JsonlStreamStreamingItem", "apiVersions": [], @@ -9123,7 +9157,7 @@ "isExactName": false, "properties": [ { - "$id": "641", + "$id": "645", "kind": "property", "name": "contentType", "apiVersions": [ @@ -9144,7 +9178,7 @@ "isExactName": false }, { - "$id": "642", + "$id": "646", "kind": "property", "name": "body", "apiVersions": [ @@ -9152,7 +9186,7 @@ "2024-08-16-preview" ], "type": { - "$id": "643", + "$id": "647", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "", @@ -9173,7 +9207,7 @@ ], "clients": [ { - "$id": "644", + "$id": "648", "kind": "client", "name": "SampleTypeSpecClient", "isExactName": false, @@ -9181,7 +9215,7 @@ "doc": "This is a sample typespec project.", "methods": [ { - "$id": "645", + "$id": "649", "kind": "basic", "name": "sayHi", "isExactName": false, @@ -9192,7 +9226,7 @@ ], "doc": "Return hi", "operation": { - "$id": "646", + "$id": "650", "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9200,12 +9234,12 @@ "accessibility": "public", "parameters": [ { - "$id": "647", + "$id": "651", "kind": "header", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "648", + "$id": "652", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9220,12 +9254,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "649", + "$id": "653", "kind": "method", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "650", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9245,12 +9279,12 @@ "isExactName": false }, { - "$id": "651", + "$id": "655", "kind": "query", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "652", + "$id": "656", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9265,12 +9299,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "653", + "$id": "657", "kind": "method", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "654", + "$id": "658", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9290,12 +9324,12 @@ "isExactName": false }, { - "$id": "655", + "$id": "659", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "656", + "$id": "660", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9310,12 +9344,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "657", + "$id": "661", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "658", + "$id": "662", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9335,7 +9369,7 @@ "isExactName": false }, { - "$id": "659", + "$id": "663", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9351,7 +9385,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "methodParameterSegments": [ { - "$id": "660", + "$id": "664", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9378,7 +9412,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -9403,9 +9437,6 @@ "namespace": "SampleTypeSpec" }, "parameters": [ - { - "$ref": "649" - }, { "$ref": "653" }, @@ -9413,12 +9444,15 @@ "$ref": "657" }, { - "$ref": "660" + "$ref": "661" + }, + { + "$ref": "664" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -9427,7 +9461,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "661", + "$id": "665", "kind": "basic", "name": "helloAgain", "isExactName": false, @@ -9438,7 +9472,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "662", + "$id": "666", "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9446,12 +9480,12 @@ "accessibility": "public", "parameters": [ { - "$id": "663", + "$id": "667", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "664", + "$id": "668", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9466,12 +9500,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "665", + "$id": "669", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "666", + "$id": "670", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9491,7 +9525,7 @@ "isExactName": false }, { - "$id": "667", + "$id": "671", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9507,7 +9541,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", "methodParameterSegments": [ { - "$id": "668", + "$id": "672", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9528,12 +9562,12 @@ "isExactName": false }, { - "$id": "669", + "$id": "673", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "670", + "$id": "674", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9551,12 +9585,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "671", + "$id": "675", "kind": "method", "name": "p2", "serializedName": "p2", "type": { - "$id": "672", + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9576,7 +9610,7 @@ "isExactName": false }, { - "$id": "673", + "$id": "677", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9592,7 +9626,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "674", + "$id": "678", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9613,12 +9647,12 @@ "isExactName": false }, { - "$id": "675", + "$id": "679", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "299" }, "isApiVersion": false, "contentTypes": [ @@ -9632,12 +9666,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", "methodParameterSegments": [ { - "$id": "676", + "$id": "680", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "299" }, "location": "Body", "isApiVersion": false, @@ -9660,7 +9694,7 @@ 200 ], "bodyType": { - "$ref": "295" + "$ref": "299" }, "headers": [], "isErrorResponse": false, @@ -9689,24 +9723,24 @@ }, "parameters": [ { - "$ref": "665" + "$ref": "669" }, { - "$ref": "676" + "$ref": "680" }, { - "$ref": "668" + "$ref": "672" }, { - "$ref": "671" + "$ref": "675" }, { - "$ref": "674" + "$ref": "678" } ], "response": { "type": { - "$ref": "295" + "$ref": "299" } }, "isOverride": false, @@ -9715,7 +9749,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "677", + "$id": "681", "kind": "basic", "name": "noContentType", "isExactName": false, @@ -9726,7 +9760,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "678", + "$id": "682", "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9734,12 +9768,12 @@ "accessibility": "public", "parameters": [ { - "$id": "679", + "$id": "683", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "680", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9754,12 +9788,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "681", + "$id": "685", "kind": "method", "name": "info", "serializedName": "info", "type": { - "$ref": "343" + "$ref": "347" }, "location": "", "isApiVersion": false, @@ -9772,13 +9806,13 @@ "isExactName": false }, { - "$id": "682", + "$id": "686", "kind": "method", "name": "p1", "serializedName": "p1", "doc": "header parameter", "type": { - "$ref": "345" + "$ref": "349" }, "location": "", "isApiVersion": false, @@ -9794,12 +9828,12 @@ "isExactName": false }, { - "$id": "683", + "$id": "687", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "684", + "$id": "688", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9817,16 +9851,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "681" + "$ref": "685" }, { - "$id": "685", + "$id": "689", "kind": "method", "name": "p2", "serializedName": "p2", "doc": "path parameter", "type": { - "$ref": "348" + "$ref": "352" }, "location": "", "isApiVersion": false, @@ -9842,7 +9876,7 @@ "isExactName": false }, { - "$id": "686", + "$id": "690", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9859,7 +9893,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "687", + "$id": "691", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9881,7 +9915,7 @@ "isExactName": false }, { - "$id": "688", + "$id": "692", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9897,7 +9931,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "689", + "$id": "693", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9918,12 +9952,12 @@ "isExactName": false }, { - "$id": "690", + "$id": "694", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "299" }, "isApiVersion": false, "contentTypes": [ @@ -9937,16 +9971,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", "methodParameterSegments": [ { - "$ref": "681" + "$ref": "685" }, { - "$id": "691", + "$id": "695", "kind": "method", "name": "action", "serializedName": "action", "doc": "body parameter", "type": { - "$ref": "295" + "$ref": "299" }, "location": "", "isApiVersion": false, @@ -9973,7 +10007,7 @@ 200 ], "bodyType": { - "$ref": "295" + "$ref": "299" }, "headers": [], "isErrorResponse": false, @@ -10002,18 +10036,18 @@ }, "parameters": [ { - "$ref": "681" + "$ref": "685" }, { - "$ref": "687" + "$ref": "691" }, { - "$ref": "689" + "$ref": "693" } ], "response": { "type": { - "$ref": "295" + "$ref": "299" } }, "isOverride": true, @@ -10022,7 +10056,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "692", + "$id": "696", "kind": "basic", "name": "helloDemo2", "isExactName": false, @@ -10033,7 +10067,7 @@ ], "doc": "Return hi in demo2", "operation": { - "$id": "693", + "$id": "697", "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10041,7 +10075,7 @@ "accessibility": "public", "parameters": [ { - "$id": "694", + "$id": "698", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10057,7 +10091,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "695", + "$id": "699", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10084,7 +10118,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10110,12 +10144,12 @@ }, "parameters": [ { - "$ref": "695" + "$ref": "699" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -10124,7 +10158,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "696", + "$id": "700", "kind": "basic", "name": "createLiteral", "isExactName": false, @@ -10135,7 +10169,7 @@ ], "doc": "Create with literal value", "operation": { - "$id": "697", + "$id": "701", "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10143,7 +10177,7 @@ "accessibility": "public", "parameters": [ { - "$id": "698", + "$id": "702", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10160,7 +10194,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", "methodParameterSegments": [ { - "$id": "699", + "$id": "703", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10182,7 +10216,7 @@ "isExactName": false }, { - "$id": "700", + "$id": "704", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10198,7 +10232,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "701", + "$id": "705", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10219,12 +10253,12 @@ "isExactName": false }, { - "$id": "702", + "$id": "706", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -10238,12 +10272,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", "methodParameterSegments": [ { - "$id": "703", + "$id": "707", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -10270,7 +10304,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10299,18 +10333,18 @@ }, "parameters": [ { - "$ref": "703" + "$ref": "707" }, { - "$ref": "699" + "$ref": "703" }, { - "$ref": "701" + "$ref": "705" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -10319,7 +10353,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "704", + "$id": "708", "kind": "basic", "name": "helloLiteral", "isExactName": false, @@ -10330,7 +10364,7 @@ ], "doc": "Send literal parameters", "operation": { - "$id": "705", + "$id": "709", "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10338,7 +10372,7 @@ "accessibility": "public", "parameters": [ { - "$id": "706", + "$id": "710", "kind": "header", "name": "p1", "serializedName": "p1", @@ -10354,7 +10388,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "707", + "$id": "711", "kind": "method", "name": "p1", "serializedName": "p1", @@ -10375,7 +10409,7 @@ "isExactName": false }, { - "$id": "708", + "$id": "712", "kind": "path", "name": "p2", "serializedName": "p2", @@ -10394,7 +10428,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$id": "709", + "$id": "713", "kind": "method", "name": "p2", "serializedName": "p2", @@ -10415,7 +10449,7 @@ "isExactName": false }, { - "$id": "710", + "$id": "714", "kind": "query", "name": "p3", "serializedName": "p3", @@ -10431,7 +10465,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "711", + "$id": "715", "kind": "method", "name": "p3", "serializedName": "p3", @@ -10452,7 +10486,7 @@ "isExactName": false }, { - "$id": "712", + "$id": "716", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10468,7 +10502,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "713", + "$id": "717", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10495,7 +10529,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10521,21 +10555,21 @@ }, "parameters": [ { - "$ref": "707" + "$ref": "711" }, { - "$ref": "709" + "$ref": "713" }, { - "$ref": "711" + "$ref": "715" }, { - "$ref": "713" + "$ref": "717" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -10544,7 +10578,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "714", + "$id": "718", "kind": "basic", "name": "topAction", "isExactName": false, @@ -10555,7 +10589,7 @@ ], "doc": "top level method", "operation": { - "$id": "715", + "$id": "719", "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10563,17 +10597,17 @@ "accessibility": "public", "parameters": [ { - "$id": "716", + "$id": "720", "kind": "path", "name": "action", "serializedName": "action", "type": { - "$id": "717", + "$id": "721", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "718", + "$id": "722", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10594,17 +10628,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "719", + "$id": "723", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$id": "720", + "$id": "724", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "721", + "$id": "725", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10627,7 +10661,7 @@ "isExactName": false }, { - "$id": "722", + "$id": "726", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10643,7 +10677,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "723", + "$id": "727", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10670,7 +10704,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10696,15 +10730,15 @@ }, "parameters": [ { - "$ref": "719" + "$ref": "723" }, { - "$ref": "723" + "$ref": "727" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -10713,7 +10747,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "724", + "$id": "728", "kind": "basic", "name": "topAction2", "isExactName": false, @@ -10724,7 +10758,7 @@ ], "doc": "top level method2", "operation": { - "$id": "725", + "$id": "729", "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10732,7 +10766,7 @@ "accessibility": "public", "parameters": [ { - "$id": "726", + "$id": "730", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10748,7 +10782,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "727", + "$id": "731", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10775,7 +10809,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10801,12 +10835,12 @@ }, "parameters": [ { - "$ref": "727" + "$ref": "731" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -10815,7 +10849,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "728", + "$id": "732", "kind": "basic", "name": "patchAction", "isExactName": false, @@ -10826,7 +10860,7 @@ ], "doc": "top level patch", "operation": { - "$id": "729", + "$id": "733", "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10834,7 +10868,7 @@ "accessibility": "public", "parameters": [ { - "$id": "730", + "$id": "734", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10851,7 +10885,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "731", + "$id": "735", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10873,7 +10907,7 @@ "isExactName": false }, { - "$id": "732", + "$id": "736", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10889,7 +10923,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "733", + "$id": "737", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10910,12 +10944,12 @@ "isExactName": false }, { - "$id": "734", + "$id": "738", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -10929,12 +10963,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "735", + "$id": "739", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -10961,7 +10995,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10990,18 +11024,18 @@ }, "parameters": [ { - "$ref": "735" + "$ref": "739" }, { - "$ref": "731" + "$ref": "735" }, { - "$ref": "733" + "$ref": "737" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -11010,7 +11044,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "736", + "$id": "740", "kind": "basic", "name": "anonymousBody", "isExactName": false, @@ -11021,7 +11055,7 @@ ], "doc": "body parameter without body decorator", "operation": { - "$id": "737", + "$id": "741", "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11029,7 +11063,7 @@ "accessibility": "public", "parameters": [ { - "$id": "738", + "$id": "742", "kind": "query", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11045,7 +11079,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "739", + "$id": "743", "kind": "method", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11066,7 +11100,7 @@ "isExactName": false }, { - "$id": "740", + "$id": "744", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", @@ -11082,7 +11116,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", "methodParameterSegments": [ { - "$id": "741", + "$id": "745", "kind": "method", "name": "requiredHeader", "serializedName": "required-header", @@ -11103,7 +11137,7 @@ "isExactName": false }, { - "$id": "742", + "$id": "746", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11120,7 +11154,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "743", + "$id": "747", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11142,7 +11176,7 @@ "isExactName": false }, { - "$id": "744", + "$id": "748", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11158,7 +11192,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "methodParameterSegments": [ { - "$id": "745", + "$id": "749", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11179,12 +11213,12 @@ "isExactName": false }, { - "$id": "746", + "$id": "750", "kind": "body", "name": "thing", "serializedName": "thing", "type": { - "$ref": "260" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -11198,13 +11232,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "747", + "$id": "751", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "748", + "$id": "752", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11235,7 +11269,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -11264,16 +11298,16 @@ }, "parameters": [ { - "$ref": "747" + "$ref": "751" }, { - "$id": "749", + "$id": "753", "kind": "method", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$ref": "264" + "$ref": "268" }, "location": "Body", "isApiVersion": false, @@ -11286,7 +11320,7 @@ "isExactName": false }, { - "$id": "750", + "$id": "754", "kind": "method", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", @@ -11305,13 +11339,13 @@ "isExactName": false }, { - "$id": "751", + "$id": "755", "kind": "method", "name": "requiredNullableString", "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$ref": "271" + "$ref": "275" }, "location": "Body", "isApiVersion": false, @@ -11324,13 +11358,13 @@ "isExactName": false }, { - "$id": "752", + "$id": "756", "kind": "method", "name": "optionalNullableString", "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$ref": "274" + "$ref": "278" }, "location": "Body", "isApiVersion": false, @@ -11343,7 +11377,7 @@ "isExactName": false }, { - "$id": "753", + "$id": "757", "kind": "method", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", @@ -11362,7 +11396,7 @@ "isExactName": false }, { - "$id": "754", + "$id": "758", "kind": "method", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", @@ -11381,7 +11415,7 @@ "isExactName": false }, { - "$id": "755", + "$id": "759", "kind": "method", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", @@ -11400,19 +11434,19 @@ "isExactName": false }, { - "$id": "756", + "$id": "760", "kind": "method", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "757", + "$id": "761", "kind": "enum", "name": "ThingOptionalLiteralString", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "758", + "$id": "762", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11420,12 +11454,12 @@ }, "values": [ { - "$id": "759", + "$id": "763", "kind": "enumvalue", "name": "reject", "value": "reject", "valueType": { - "$id": "760", + "$id": "764", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -11433,7 +11467,7 @@ "crossLanguageDefinitionId": "TypeSpec.string" }, "enumType": { - "$ref": "757" + "$ref": "761" }, "decorators": [], "isExactName": false @@ -11457,13 +11491,13 @@ "isExactName": false }, { - "$id": "761", + "$id": "765", "kind": "method", "name": "requiredNullableLiteralString", "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$ref": "281" + "$ref": "285" }, "location": "Body", "isApiVersion": false, @@ -11476,19 +11510,19 @@ "isExactName": false }, { - "$id": "762", + "$id": "766", "kind": "method", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "763", + "$id": "767", "kind": "enum", "name": "ThingOptionalLiteralInt", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "764", + "$id": "768", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -11496,12 +11530,12 @@ }, "values": [ { - "$id": "765", + "$id": "769", "kind": "enumvalue", "name": "456", "value": 456, "valueType": { - "$id": "766", + "$id": "770", "kind": "int32", "decorators": [], "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", @@ -11509,7 +11543,7 @@ "crossLanguageDefinitionId": "TypeSpec.int32" }, "enumType": { - "$ref": "763" + "$ref": "767" }, "decorators": [], "isExactName": false @@ -11533,19 +11567,19 @@ "isExactName": false }, { - "$id": "767", + "$id": "771", "kind": "method", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "768", + "$id": "772", "kind": "enum", "name": "ThingOptionalLiteralFloat", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "769", + "$id": "773", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -11553,12 +11587,12 @@ }, "values": [ { - "$id": "770", + "$id": "774", "kind": "enumvalue", "name": "4.56", "value": 4.56, "valueType": { - "$id": "771", + "$id": "775", "kind": "float32", "decorators": [], "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", @@ -11566,7 +11600,7 @@ "crossLanguageDefinitionId": "TypeSpec.float32" }, "enumType": { - "$ref": "768" + "$ref": "772" }, "decorators": [], "isExactName": false @@ -11590,7 +11624,7 @@ "isExactName": false }, { - "$id": "772", + "$id": "776", "kind": "method", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", @@ -11609,13 +11643,13 @@ "isExactName": false }, { - "$id": "773", + "$id": "777", "kind": "method", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "774", + "$id": "778", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11632,13 +11666,13 @@ "isExactName": false }, { - "$id": "775", + "$id": "779", "kind": "method", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$ref": "288" + "$ref": "292" }, "location": "Body", "isApiVersion": false, @@ -11651,13 +11685,13 @@ "isExactName": false }, { - "$id": "776", + "$id": "780", "kind": "method", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$ref": "292" + "$ref": "296" }, "location": "Body", "isApiVersion": false, @@ -11670,13 +11704,13 @@ "isExactName": false }, { - "$id": "777", + "$id": "781", "kind": "method", "name": "propertyWithSpecialDocs", "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "778", + "$id": "782", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11693,21 +11727,21 @@ "isExactName": false }, { - "$ref": "739" + "$ref": "743" }, { - "$ref": "741" + "$ref": "745" }, { - "$ref": "743" + "$ref": "747" }, { - "$ref": "745" + "$ref": "749" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -11716,7 +11750,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "779", + "$id": "783", "kind": "basic", "name": "friendlyModel", "isExactName": false, @@ -11727,7 +11761,7 @@ ], "doc": "Model can have its friendly name", "operation": { - "$id": "780", + "$id": "784", "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11735,7 +11769,7 @@ "accessibility": "public", "parameters": [ { - "$id": "781", + "$id": "785", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11752,7 +11786,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "782", + "$id": "786", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11774,7 +11808,7 @@ "isExactName": false }, { - "$id": "783", + "$id": "787", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11790,7 +11824,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "784", + "$id": "788", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11811,12 +11845,12 @@ "isExactName": false }, { - "$id": "785", + "$id": "789", "kind": "body", "name": "friend", "serializedName": "friend", "type": { - "$ref": "349" + "$ref": "353" }, "isApiVersion": false, "contentTypes": [ @@ -11830,13 +11864,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", "methodParameterSegments": [ { - "$id": "786", + "$id": "790", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "787", + "$id": "791", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11867,7 +11901,7 @@ 200 ], "bodyType": { - "$ref": "349" + "$ref": "353" }, "headers": [], "isErrorResponse": false, @@ -11896,18 +11930,18 @@ }, "parameters": [ { - "$ref": "786" + "$ref": "790" }, { - "$ref": "782" + "$ref": "786" }, { - "$ref": "784" + "$ref": "788" } ], "response": { "type": { - "$ref": "349" + "$ref": "353" } }, "isOverride": false, @@ -11916,7 +11950,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "788", + "$id": "792", "kind": "basic", "name": "addTimeHeader", "isExactName": false, @@ -11926,24 +11960,24 @@ "2024-08-16-preview" ], "operation": { - "$id": "789", + "$id": "793", "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "790", + "$id": "794", "kind": "header", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "791", + "$id": "795", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "792", + "$id": "796", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11961,17 +11995,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "793", + "$id": "797", "kind": "method", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "794", + "$id": "798", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "795", + "$id": "799", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12016,7 +12050,7 @@ }, "parameters": [ { - "$ref": "793" + "$ref": "797" } ], "response": {}, @@ -12026,7 +12060,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "796", + "$id": "800", "kind": "basic", "name": "projectedNameModel", "isExactName": false, @@ -12037,7 +12071,7 @@ ], "doc": "Model can have its projected name", "operation": { - "$id": "797", + "$id": "801", "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12045,7 +12079,7 @@ "accessibility": "public", "parameters": [ { - "$id": "798", + "$id": "802", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12062,7 +12096,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "799", + "$id": "803", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12084,7 +12118,7 @@ "isExactName": false }, { - "$id": "800", + "$id": "804", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12100,7 +12134,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "801", + "$id": "805", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12121,12 +12155,12 @@ "isExactName": false }, { - "$id": "802", + "$id": "806", "kind": "body", "name": "renamedModel", "serializedName": "renamedModel", "type": { - "$ref": "352" + "$ref": "356" }, "isApiVersion": false, "contentTypes": [ @@ -12140,13 +12174,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "803", + "$id": "807", "kind": "method", "name": "otherName", "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "804", + "$id": "808", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12177,7 +12211,7 @@ 200 ], "bodyType": { - "$ref": "352" + "$ref": "356" }, "headers": [], "isErrorResponse": false, @@ -12206,18 +12240,18 @@ }, "parameters": [ { - "$ref": "803" + "$ref": "807" }, { - "$ref": "799" + "$ref": "803" }, { - "$ref": "801" + "$ref": "805" } ], "response": { "type": { - "$ref": "352" + "$ref": "356" } }, "isOverride": false, @@ -12226,7 +12260,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "805", + "$id": "809", "kind": "basic", "name": "returnsAnonymousModel", "isExactName": false, @@ -12237,7 +12271,7 @@ ], "doc": "return anonymous model", "operation": { - "$id": "806", + "$id": "810", "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12245,7 +12279,7 @@ "accessibility": "public", "parameters": [ { - "$id": "807", + "$id": "811", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12261,7 +12295,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "808", + "$id": "812", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12288,7 +12322,7 @@ 200 ], "bodyType": { - "$ref": "355" + "$ref": "359" }, "headers": [], "isErrorResponse": false, @@ -12314,12 +12348,12 @@ }, "parameters": [ { - "$ref": "808" + "$ref": "812" } ], "response": { "type": { - "$ref": "355" + "$ref": "359" } }, "isOverride": false, @@ -12328,7 +12362,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$id": "809", + "$id": "813", "kind": "basic", "name": "getUnknownValue", "isExactName": false, @@ -12339,7 +12373,7 @@ ], "doc": "get extensible enum", "operation": { - "$id": "810", + "$id": "814", "name": "getUnknownValue", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12347,7 +12381,7 @@ "accessibility": "public", "parameters": [ { - "$id": "811", + "$id": "815", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12363,7 +12397,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "812", + "$id": "816", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12412,7 +12446,7 @@ }, "parameters": [ { - "$ref": "812" + "$ref": "816" } ], "response": { @@ -12426,7 +12460,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "813", + "$id": "817", "kind": "basic", "name": "internalProtocol", "isExactName": false, @@ -12437,7 +12471,7 @@ ], "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "814", + "$id": "818", "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12445,7 +12479,7 @@ "accessibility": "public", "parameters": [ { - "$id": "815", + "$id": "819", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12462,7 +12496,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "816", + "$id": "820", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12484,7 +12518,7 @@ "isExactName": false }, { - "$id": "817", + "$id": "821", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12500,7 +12534,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "818", + "$id": "822", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12521,12 +12555,12 @@ "isExactName": false }, { - "$id": "819", + "$id": "823", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -12540,12 +12574,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "820", + "$id": "824", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -12572,7 +12606,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -12601,18 +12635,18 @@ }, "parameters": [ { - "$ref": "820" + "$ref": "824" }, { - "$ref": "816" + "$ref": "820" }, { - "$ref": "818" + "$ref": "822" } ], "response": { "type": { - "$ref": "260" + "$ref": "264" } }, "isOverride": false, @@ -12621,7 +12655,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" }, { - "$id": "821", + "$id": "825", "kind": "basic", "name": "stillConvenient", "isExactName": false, @@ -12632,7 +12666,7 @@ ], "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "operation": { - "$id": "822", + "$id": "826", "name": "stillConvenient", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12667,7 +12701,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" }, { - "$id": "823", + "$id": "827", "kind": "basic", "name": "headAsBoolean", "isExactName": false, @@ -12678,7 +12712,7 @@ ], "doc": "head as boolean.", "operation": { - "$id": "824", + "$id": "828", "name": "headAsBoolean", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12686,12 +12720,12 @@ "accessibility": "public", "parameters": [ { - "$id": "825", + "$id": "829", "kind": "path", "name": "id", "serializedName": "id", "type": { - "$id": "826", + "$id": "830", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12709,12 +12743,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "827", + "$id": "831", "kind": "method", "name": "id", "serializedName": "id", "type": { - "$id": "828", + "$id": "832", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12756,7 +12790,7 @@ }, "parameters": [ { - "$ref": "827" + "$ref": "831" } ], "response": {}, @@ -12766,7 +12800,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "829", + "$id": "833", "kind": "basic", "name": "WithApiVersion", "isExactName": false, @@ -12777,7 +12811,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "830", + "$id": "834", "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12785,12 +12819,12 @@ "accessibility": "public", "parameters": [ { - "$id": "831", + "$id": "835", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "832", + "$id": "836", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12805,12 +12839,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "833", + "$id": "837", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "834", + "$id": "838", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12830,12 +12864,12 @@ "isExactName": false }, { - "$id": "835", + "$id": "839", "kind": "query", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "836", + "$id": "840", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12845,7 +12879,7 @@ "explode": false, "defaultValue": { "type": { - "$id": "837", + "$id": "841", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12859,12 +12893,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "838", + "$id": "842", "kind": "method", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "839", + "$id": "843", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12874,7 +12908,7 @@ "isApiVersion": true, "defaultValue": { "type": { - "$id": "840", + "$id": "844", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12915,7 +12949,7 @@ }, "parameters": [ { - "$ref": "833" + "$ref": "837" } ], "response": {}, @@ -12925,7 +12959,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" }, { - "$id": "841", + "$id": "845", "kind": "paging", "name": "ListWithNextLink", "isExactName": false, @@ -12936,7 +12970,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "842", + "$id": "846", "name": "ListWithNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12944,7 +12978,7 @@ "accessibility": "public", "parameters": [ { - "$id": "843", + "$id": "847", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12960,7 +12994,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "844", + "$id": "848", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12987,7 +13021,7 @@ 200 ], "bodyType": { - "$ref": "356" + "$ref": "360" }, "headers": [], "isErrorResponse": false, @@ -13013,12 +13047,12 @@ }, "parameters": [ { - "$ref": "844" + "$ref": "848" } ], "response": { "type": { - "$ref": "358" + "$ref": "362" }, "resultSegments": [ "things" @@ -13042,7 +13076,7 @@ } }, { - "$id": "845", + "$id": "849", "kind": "paging", "name": "ListWithStringNextLink", "isExactName": false, @@ -13053,7 +13087,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "846", + "$id": "850", "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13061,7 +13095,7 @@ "accessibility": "public", "parameters": [ { - "$id": "847", + "$id": "851", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13077,7 +13111,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "848", + "$id": "852", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13104,7 +13138,7 @@ 200 ], "bodyType": { - "$ref": "361" + "$ref": "365" }, "headers": [], "isErrorResponse": false, @@ -13130,12 +13164,12 @@ }, "parameters": [ { - "$ref": "848" + "$ref": "852" } ], "response": { "type": { - "$ref": "358" + "$ref": "362" }, "resultSegments": [ "things" @@ -13159,7 +13193,7 @@ } }, { - "$id": "849", + "$id": "853", "kind": "paging", "name": "ListWithContinuationToken", "isExactName": false, @@ -13170,7 +13204,7 @@ ], "doc": "List things with continuation token", "operation": { - "$id": "850", + "$id": "854", "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13178,12 +13212,12 @@ "accessibility": "public", "parameters": [ { - "$id": "851", + "$id": "855", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "852", + "$id": "856", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13198,12 +13232,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "853", + "$id": "857", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "854", + "$id": "858", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13223,7 +13257,7 @@ "isExactName": false }, { - "$id": "855", + "$id": "859", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13239,7 +13273,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "856", + "$id": "860", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13266,7 +13300,7 @@ 200 ], "bodyType": { - "$ref": "365" + "$ref": "369" }, "headers": [], "isErrorResponse": false, @@ -13292,15 +13326,15 @@ }, "parameters": [ { - "$ref": "853" + "$ref": "857" }, { - "$ref": "856" + "$ref": "860" } ], "response": { "type": { - "$ref": "358" + "$ref": "362" }, "resultSegments": [ "things" @@ -13316,7 +13350,7 @@ ], "continuationToken": { "parameter": { - "$ref": "851" + "$ref": "855" }, "responseSegments": [ "nextToken" @@ -13327,7 +13361,7 @@ } }, { - "$id": "857", + "$id": "861", "kind": "paging", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, @@ -13338,7 +13372,7 @@ ], "doc": "List things with continuation token header response", "operation": { - "$id": "858", + "$id": "862", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13346,12 +13380,12 @@ "accessibility": "public", "parameters": [ { - "$id": "859", + "$id": "863", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "860", + "$id": "864", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13366,12 +13400,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "861", + "$id": "865", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "862", + "$id": "866", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13391,7 +13425,7 @@ "isExactName": false }, { - "$id": "863", + "$id": "867", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13407,7 +13441,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "864", + "$id": "868", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13434,14 +13468,14 @@ 200 ], "bodyType": { - "$ref": "369" + "$ref": "373" }, "headers": [ { "name": "nextToken", "nameInResponse": "next-token", "type": { - "$id": "865", + "$id": "869", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13472,15 +13506,15 @@ }, "parameters": [ { - "$ref": "861" + "$ref": "865" }, { - "$ref": "864" + "$ref": "868" } ], "response": { "type": { - "$ref": "358" + "$ref": "362" }, "resultSegments": [ "things" @@ -13496,7 +13530,7 @@ ], "continuationToken": { "parameter": { - "$ref": "859" + "$ref": "863" }, "responseSegments": [ "next-token" @@ -13507,7 +13541,7 @@ } }, { - "$id": "866", + "$id": "870", "kind": "paging", "name": "ListWithPaging", "isExactName": false, @@ -13518,7 +13552,7 @@ ], "doc": "List things with paging", "operation": { - "$id": "867", + "$id": "871", "name": "ListWithPaging", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13526,7 +13560,7 @@ "accessibility": "public", "parameters": [ { - "$id": "868", + "$id": "872", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13542,7 +13576,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "869", + "$id": "873", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13569,7 +13603,7 @@ 200 ], "bodyType": { - "$ref": "371" + "$ref": "375" }, "headers": [], "isErrorResponse": false, @@ -13595,12 +13629,12 @@ }, "parameters": [ { - "$ref": "869" + "$ref": "873" } ], "response": { "type": { - "$ref": "358" + "$ref": "362" }, "resultSegments": [ "items" @@ -13618,7 +13652,7 @@ } }, { - "$id": "870", + "$id": "874", "kind": "basic", "name": "EmbeddedParameters", "isExactName": false, @@ -13629,7 +13663,7 @@ ], "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "871", + "$id": "875", "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13637,13 +13671,13 @@ "accessibility": "public", "parameters": [ { - "$id": "872", + "$id": "876", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", "doc": "required header parameter", "type": { - "$id": "873", + "$id": "877", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13658,12 +13692,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "874", + "$id": "878", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "373" + "$ref": "377" }, "location": "Body", "isApiVersion": false, @@ -13676,13 +13710,13 @@ "isExactName": false }, { - "$id": "875", + "$id": "879", "kind": "method", "name": "requiredHeader", "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$ref": "377" + "$ref": "381" }, "location": "", "isApiVersion": false, @@ -13698,13 +13732,13 @@ "isExactName": false }, { - "$id": "876", + "$id": "880", "kind": "header", "name": "optionalHeader", "serializedName": "optional-header", "doc": "optional header parameter", "type": { - "$id": "877", + "$id": "881", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13719,16 +13753,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$ref": "874" + "$ref": "878" }, { - "$id": "878", + "$id": "882", "kind": "method", "name": "optionalHeader", "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$ref": "379" + "$ref": "383" }, "location": "", "isApiVersion": false, @@ -13744,13 +13778,13 @@ "isExactName": false }, { - "$id": "879", + "$id": "883", "kind": "query", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "880", + "$id": "884", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13765,16 +13799,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "874" + "$ref": "878" }, { - "$id": "881", + "$id": "885", "kind": "method", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$ref": "381" + "$ref": "385" }, "location": "", "isApiVersion": false, @@ -13790,13 +13824,13 @@ "isExactName": false }, { - "$id": "882", + "$id": "886", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "883", + "$id": "887", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13811,16 +13845,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "874" + "$ref": "878" }, { - "$id": "884", + "$id": "888", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$ref": "383" + "$ref": "387" }, "location": "", "isApiVersion": false, @@ -13836,7 +13870,7 @@ "isExactName": false }, { - "$id": "885", + "$id": "889", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13853,7 +13887,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "886", + "$id": "890", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13875,12 +13909,12 @@ "isExactName": false }, { - "$id": "887", + "$id": "891", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "373" + "$ref": "377" }, "isApiVersion": false, "contentTypes": [ @@ -13894,7 +13928,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "methodParameterSegments": [ { - "$ref": "874" + "$ref": "878" } ], "isExactName": false, @@ -13930,10 +13964,10 @@ }, "parameters": [ { - "$ref": "874" + "$ref": "878" }, { - "$ref": "886" + "$ref": "890" } ], "response": {}, @@ -13943,7 +13977,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "888", + "$id": "892", "kind": "basic", "name": "DynamicModelOperation", "isExactName": false, @@ -13954,7 +13988,7 @@ ], "doc": "An operation with a dynamic model", "operation": { - "$id": "889", + "$id": "893", "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13962,7 +13996,7 @@ "accessibility": "public", "parameters": [ { - "$id": "890", + "$id": "894", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13979,7 +14013,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "891", + "$id": "895", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14001,12 +14035,12 @@ "isExactName": false }, { - "$id": "892", + "$id": "896", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "384" + "$ref": "388" }, "isApiVersion": false, "contentTypes": [ @@ -14020,12 +14054,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "893", + "$id": "897", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "384" + "$ref": "388" }, "location": "Body", "isApiVersion": false, @@ -14071,10 +14105,10 @@ }, "parameters": [ { - "$ref": "893" + "$ref": "897" }, { - "$ref": "891" + "$ref": "895" } ], "response": {}, @@ -14084,7 +14118,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "894", + "$id": "898", "kind": "basic", "name": "GetXmlAdvancedModel", "isExactName": false, @@ -14095,7 +14129,7 @@ ], "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "895", + "$id": "899", "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14103,7 +14137,7 @@ "accessibility": "public", "parameters": [ { - "$id": "896", + "$id": "900", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14119,7 +14153,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "897", + "$id": "901", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14146,7 +14180,7 @@ 200 ], "bodyType": { - "$ref": "422" + "$ref": "426" }, "headers": [ { @@ -14180,12 +14214,12 @@ }, "parameters": [ { - "$ref": "897" + "$ref": "901" } ], "response": { "type": { - "$ref": "422" + "$ref": "426" } }, "isOverride": false, @@ -14194,7 +14228,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "898", + "$id": "902", "kind": "basic", "name": "UpdateXmlAdvancedModel", "isExactName": false, @@ -14205,7 +14239,7 @@ ], "doc": "Update an advanced XML model with various property types", "operation": { - "$id": "899", + "$id": "903", "name": "UpdateXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14213,7 +14247,7 @@ "accessibility": "public", "parameters": [ { - "$id": "900", + "$id": "904", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14229,7 +14263,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "901", + "$id": "905", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14250,7 +14284,7 @@ "isExactName": false }, { - "$id": "902", + "$id": "906", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14266,7 +14300,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "903", + "$id": "907", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14287,12 +14321,12 @@ "isExactName": false }, { - "$id": "904", + "$id": "908", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "422" + "$ref": "426" }, "isApiVersion": false, "contentTypes": [ @@ -14306,12 +14340,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "905", + "$id": "909", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "422" + "$ref": "426" }, "location": "Body", "isApiVersion": false, @@ -14338,7 +14372,7 @@ 200 ], "bodyType": { - "$ref": "422" + "$ref": "426" }, "headers": [ { @@ -14375,18 +14409,18 @@ }, "parameters": [ { - "$ref": "905" + "$ref": "909" }, { - "$ref": "901" + "$ref": "905" }, { - "$ref": "903" + "$ref": "907" } ], "response": { "type": { - "$ref": "422" + "$ref": "426" } }, "isOverride": false, @@ -14395,7 +14429,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, { - "$id": "906", + "$id": "910", "kind": "basic", "name": "uploadCat", "isExactName": false, @@ -14405,14 +14439,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "907", + "$id": "911", "name": "uploadCat", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "908", + "$id": "912", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14428,7 +14462,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "methodParameterSegments": [ { - "$id": "909", + "$id": "913", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14449,12 +14483,12 @@ "isExactName": false }, { - "$id": "910", + "$id": "914", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "518" + "$ref": "522" }, "isApiVersion": false, "contentTypes": [ @@ -14468,12 +14502,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "methodParameterSegments": [ { - "$id": "911", + "$id": "915", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "518" + "$ref": "522" }, "location": "Body", "isApiVersion": false, @@ -14515,10 +14549,10 @@ }, "parameters": [ { - "$ref": "909" + "$ref": "913" }, { - "$ref": "911" + "$ref": "915" } ], "response": {}, @@ -14528,7 +14562,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" }, { - "$id": "912", + "$id": "916", "kind": "basic", "name": "sendJsonLines", "isExactName": false, @@ -14538,14 +14572,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "913", + "$id": "917", "name": "sendJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "914", + "$id": "918", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14561,16 +14595,16 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "methodParameterSegments": [ { - "$id": "915", + "$id": "919", "kind": "method", "name": "stream", "serializedName": "stream", "type": { - "$id": "916", + "$id": "920", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14589,7 +14623,7 @@ "isExactName": false }, { - "$id": "917", + "$id": "921", "kind": "method", "name": "contentType", "serializedName": "contentType", @@ -14610,16 +14644,16 @@ "isExactName": false }, { - "$id": "918", + "$id": "922", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$id": "919", + "$id": "923", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14639,15 +14673,15 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "methodParameterSegments": [ { - "$ref": "915" + "$ref": "919" }, { - "$id": "920", + "$id": "924", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "643" + "$ref": "647" }, "location": "", "isApiVersion": false, @@ -14693,7 +14727,7 @@ }, "parameters": [ { - "$ref": "915" + "$ref": "919" } ], "response": {}, @@ -14703,7 +14737,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "921", + "$id": "925", "kind": "basic", "name": "receiveJsonLines", "isExactName": false, @@ -14713,14 +14747,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "922", + "$id": "926", "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "923", + "$id": "927", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14736,7 +14770,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "924", + "$id": "928", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14763,11 +14797,11 @@ 200 ], "bodyType": { - "$id": "925", + "$id": "929", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14807,16 +14841,16 @@ }, "parameters": [ { - "$ref": "924" + "$ref": "928" } ], "response": { "type": { - "$id": "926", + "$id": "930", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14831,7 +14865,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "927", + "$id": "931", "kind": "basic", "name": "receiveSse", "isExactName": false, @@ -14841,14 +14875,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "928", + "$id": "932", "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "929", + "$id": "933", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14864,7 +14898,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "930", + "$id": "934", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14891,16 +14925,16 @@ 200 ], "bodyType": { - "$id": "931", + "$id": "935", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$id": "932", + "$id": "936", "kind": "union", "name": "SampleEvents", "variantTypes": [ { - "$ref": "563" + "$ref": "567" }, { "$ref": "204" @@ -14945,16 +14979,16 @@ }, "parameters": [ { - "$ref": "930" + "$ref": "934" } ], "response": { "type": { - "$id": "933", + "$id": "937", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$ref": "932" + "$ref": "936" }, "streamKind": "sse", "contentTypes": [ @@ -14970,7 +15004,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" }, { - "$id": "934", + "$id": "938", "kind": "basic", "name": "getJsonInt32", "isExactName": false, @@ -14981,7 +15015,7 @@ ], "doc": "get JSON int32", "operation": { - "$id": "935", + "$id": "939", "name": "getJsonInt32", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14989,7 +15023,7 @@ "accessibility": "public", "parameters": [ { - "$id": "936", + "$id": "940", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -15005,7 +15039,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", "methodParameterSegments": [ { - "$id": "937", + "$id": "941", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -15032,7 +15066,7 @@ 200 ], "bodyType": { - "$id": "938", + "$id": "942", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -15070,28 +15104,142 @@ }, "parameters": [ { - "$ref": "937" + "$ref": "941" } ], "response": { "type": { - "$ref": "938" + "$ref": "942" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32" + }, + { + "$id": "943", + "kind": "basic", + "name": "getJsonUint8", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "get JSON uint8", + "operation": { + "$id": "944", + "name": "getJsonUint8", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "get JSON uint8", + "accessibility": "public", + "parameters": [ + { + "$id": "945", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "212" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8.accept", + "methodParameterSegments": [ + { + "$id": "946", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "212" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$id": "947", + "kind": "uint8", + "name": "uint8", + "crossLanguageDefinitionId": "TypeSpec.uint8", + "decorators": [] + }, + "headers": [ + { + "name": "contentType", + "nameInResponse": "content-type", + "type": { + "$ref": "214" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "GET", + "uri": "{sampleTypeSpecUrl}", + "path": "/json-uint8", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8", + "decorators": [], + "namespace": "SampleTypeSpec" + }, + "parameters": [ + { + "$ref": "946" + } + ], + "response": { + "type": { + "$ref": "947" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8" } ], "parameters": [ { - "$id": "939", + "$id": "948", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "940", + "$id": "949", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15107,7 +15255,7 @@ "isExactName": false }, { - "$ref": "838" + "$ref": "842" } ], "initializedBy": 1, @@ -15119,14 +15267,14 @@ ], "children": [ { - "$id": "941", + "$id": "950", "kind": "client", "name": "AnimalOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "942", + "$id": "951", "kind": "basic", "name": "updatePetAsAnimal", "isExactName": false, @@ -15137,7 +15285,7 @@ ], "doc": "Update a pet as an animal", "operation": { - "$id": "943", + "$id": "952", "name": "updatePetAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15145,13 +15293,13 @@ "accessibility": "public", "parameters": [ { - "$id": "944", + "$id": "953", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -15162,13 +15310,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "945", + "$id": "954", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "216" }, "location": "Header", "isApiVersion": false, @@ -15184,12 +15332,12 @@ "isExactName": false }, { - "$id": "946", + "$id": "955", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "218" }, "isApiVersion": false, "optional": false, @@ -15200,12 +15348,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "947", + "$id": "956", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "218" }, "location": "Header", "isApiVersion": false, @@ -15221,12 +15369,12 @@ "isExactName": false }, { - "$id": "948", + "$id": "957", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "570" }, "isApiVersion": false, "contentTypes": [ @@ -15240,12 +15388,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", "methodParameterSegments": [ { - "$id": "949", + "$id": "958", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "570" }, "location": "Body", "isApiVersion": false, @@ -15272,7 +15420,7 @@ 200 ], "bodyType": { - "$ref": "566" + "$ref": "570" }, "headers": [], "isErrorResponse": false, @@ -15301,18 +15449,18 @@ }, "parameters": [ { - "$ref": "949" + "$ref": "958" }, { - "$ref": "945" + "$ref": "954" }, { - "$ref": "947" + "$ref": "956" } ], "response": { "type": { - "$ref": "566" + "$ref": "570" } }, "isOverride": false, @@ -15321,7 +15469,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "950", + "$id": "959", "kind": "basic", "name": "updateDogAsAnimal", "isExactName": false, @@ -15332,7 +15480,7 @@ ], "doc": "Update a dog as an animal", "operation": { - "$id": "951", + "$id": "960", "name": "updateDogAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15340,13 +15488,13 @@ "accessibility": "public", "parameters": [ { - "$id": "952", + "$id": "961", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "220" }, "isApiVersion": false, "optional": false, @@ -15357,13 +15505,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "953", + "$id": "962", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "220" }, "location": "Header", "isApiVersion": false, @@ -15379,12 +15527,12 @@ "isExactName": false }, { - "$id": "954", + "$id": "963", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "222" }, "isApiVersion": false, "optional": false, @@ -15395,12 +15543,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "955", + "$id": "964", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "222" }, "location": "Header", "isApiVersion": false, @@ -15416,12 +15564,12 @@ "isExactName": false }, { - "$id": "956", + "$id": "965", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "570" }, "isApiVersion": false, "contentTypes": [ @@ -15435,12 +15583,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", "methodParameterSegments": [ { - "$id": "957", + "$id": "966", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "570" }, "location": "Body", "isApiVersion": false, @@ -15467,7 +15615,7 @@ 200 ], "bodyType": { - "$ref": "566" + "$ref": "570" }, "headers": [], "isErrorResponse": false, @@ -15496,18 +15644,18 @@ }, "parameters": [ { - "$ref": "957" + "$ref": "966" }, { - "$ref": "953" + "$ref": "962" }, { - "$ref": "955" + "$ref": "964" } ], "response": { "type": { - "$ref": "566" + "$ref": "570" } }, "isOverride": false, @@ -15518,12 +15666,12 @@ ], "parameters": [ { - "$id": "958", + "$id": "967", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "959", + "$id": "968", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15547,19 +15695,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "960", + "$id": "969", "kind": "client", "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "961", + "$id": "970", "kind": "basic", "name": "updatePetAsPet", "isExactName": false, @@ -15570,7 +15718,7 @@ ], "doc": "Update a pet as a pet", "operation": { - "$id": "962", + "$id": "971", "name": "updatePetAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15578,13 +15726,13 @@ "accessibility": "public", "parameters": [ { - "$id": "963", + "$id": "972", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "224" }, "isApiVersion": false, "optional": false, @@ -15595,13 +15743,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", "methodParameterSegments": [ { - "$id": "964", + "$id": "973", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "224" }, "location": "Header", "isApiVersion": false, @@ -15617,12 +15765,12 @@ "isExactName": false }, { - "$id": "965", + "$id": "974", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "226" }, "isApiVersion": false, "optional": false, @@ -15633,12 +15781,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "966", + "$id": "975", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "226" }, "location": "Header", "isApiVersion": false, @@ -15654,12 +15802,12 @@ "isExactName": false }, { - "$id": "967", + "$id": "976", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -15673,12 +15821,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "968", + "$id": "977", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -15705,7 +15853,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -15734,18 +15882,18 @@ }, "parameters": [ { - "$ref": "968" + "$ref": "977" }, { - "$ref": "964" + "$ref": "973" }, { - "$ref": "966" + "$ref": "975" } ], "response": { "type": { - "$ref": "571" + "$ref": "575" } }, "isOverride": false, @@ -15754,7 +15902,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "969", + "$id": "978", "kind": "basic", "name": "updateDogAsPet", "isExactName": false, @@ -15765,7 +15913,7 @@ ], "doc": "Update a dog as a pet", "operation": { - "$id": "970", + "$id": "979", "name": "updateDogAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15773,13 +15921,13 @@ "accessibility": "public", "parameters": [ { - "$id": "971", + "$id": "980", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -15790,13 +15938,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "972", + "$id": "981", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "228" }, "location": "Header", "isApiVersion": false, @@ -15812,12 +15960,12 @@ "isExactName": false }, { - "$id": "973", + "$id": "982", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "230" }, "isApiVersion": false, "optional": false, @@ -15828,12 +15976,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "methodParameterSegments": [ { - "$id": "974", + "$id": "983", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "230" }, "location": "Header", "isApiVersion": false, @@ -15849,12 +15997,12 @@ "isExactName": false }, { - "$id": "975", + "$id": "984", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -15868,12 +16016,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "976", + "$id": "985", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -15900,7 +16048,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -15929,18 +16077,18 @@ }, "parameters": [ { - "$ref": "976" + "$ref": "985" }, { - "$ref": "972" + "$ref": "981" }, { - "$ref": "974" + "$ref": "983" } ], "response": { "type": { - "$ref": "571" + "$ref": "575" } }, "isOverride": false, @@ -15951,12 +16099,12 @@ ], "parameters": [ { - "$id": "977", + "$id": "986", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "978", + "$id": "987", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15980,19 +16128,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "979", + "$id": "988", "kind": "client", "name": "DogOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "980", + "$id": "989", "kind": "basic", "name": "updateDogAsDog", "isExactName": false, @@ -16003,7 +16151,7 @@ ], "doc": "Update a dog as a dog", "operation": { - "$id": "981", + "$id": "990", "name": "updateDogAsDog", "isExactName": false, "resourceName": "DogOperations", @@ -16011,13 +16159,13 @@ "accessibility": "public", "parameters": [ { - "$id": "982", + "$id": "991", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "232" }, "isApiVersion": false, "optional": false, @@ -16028,13 +16176,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "983", + "$id": "992", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "232" }, "location": "Header", "isApiVersion": false, @@ -16050,12 +16198,12 @@ "isExactName": false }, { - "$id": "984", + "$id": "993", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "234" }, "isApiVersion": false, "optional": false, @@ -16066,12 +16214,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "985", + "$id": "994", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "234" }, "location": "Header", "isApiVersion": false, @@ -16087,12 +16235,12 @@ "isExactName": false }, { - "$id": "986", + "$id": "995", "kind": "body", "name": "dog", "serializedName": "dog", "type": { - "$ref": "575" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -16106,12 +16254,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", "methodParameterSegments": [ { - "$id": "987", + "$id": "996", "kind": "method", "name": "dog", "serializedName": "dog", "type": { - "$ref": "575" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -16138,7 +16286,7 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "579" }, "headers": [], "isErrorResponse": false, @@ -16167,18 +16315,18 @@ }, "parameters": [ { - "$ref": "987" + "$ref": "996" }, { - "$ref": "983" + "$ref": "992" }, { - "$ref": "985" + "$ref": "994" } ], "response": { "type": { - "$ref": "575" + "$ref": "579" } }, "isOverride": false, @@ -16189,12 +16337,12 @@ ], "parameters": [ { - "$id": "988", + "$id": "997", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "989", + "$id": "998", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16218,19 +16366,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "990", + "$id": "999", "kind": "client", "name": "PlantOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "991", + "$id": "1000", "kind": "basic", "name": "getTree", "isExactName": false, @@ -16241,7 +16389,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "992", + "$id": "1001", "name": "getTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16249,12 +16397,12 @@ "accessibility": "public", "parameters": [ { - "$id": "993", + "$id": "1002", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "236" }, "isApiVersion": false, "optional": false, @@ -16265,12 +16413,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "994", + "$id": "1003", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "236" }, "location": "Header", "isApiVersion": false, @@ -16292,14 +16440,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "234" + "$ref": "238" } } ], @@ -16326,12 +16474,12 @@ }, "parameters": [ { - "$ref": "994" + "$ref": "1003" } ], "response": { "type": { - "$ref": "579" + "$ref": "583" } }, "isOverride": false, @@ -16340,7 +16488,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "995", + "$id": "1004", "kind": "basic", "name": "getTreeAsJson", "isExactName": false, @@ -16351,7 +16499,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "996", + "$id": "1005", "name": "getTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16359,12 +16507,12 @@ "accessibility": "public", "parameters": [ { - "$id": "997", + "$id": "1006", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "240" }, "isApiVersion": false, "optional": false, @@ -16375,12 +16523,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "998", + "$id": "1007", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "240" }, "location": "Header", "isApiVersion": false, @@ -16402,14 +16550,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "238" + "$ref": "242" } } ], @@ -16436,12 +16584,12 @@ }, "parameters": [ { - "$ref": "998" + "$ref": "1007" } ], "response": { "type": { - "$ref": "579" + "$ref": "583" } }, "isOverride": false, @@ -16450,7 +16598,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" }, { - "$id": "999", + "$id": "1008", "kind": "basic", "name": "updateTree", "isExactName": false, @@ -16461,7 +16609,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1000", + "$id": "1009", "name": "updateTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16469,12 +16617,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1001", + "$id": "1010", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "240" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -16485,12 +16633,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "1002", + "$id": "1011", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "240" + "$ref": "244" }, "location": "Header", "isApiVersion": false, @@ -16506,12 +16654,12 @@ "isExactName": false }, { - "$id": "1003", + "$id": "1012", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -16522,12 +16670,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "methodParameterSegments": [ { - "$id": "1004", + "$id": "1013", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "248" }, "location": "Header", "isApiVersion": false, @@ -16543,12 +16691,12 @@ "isExactName": false }, { - "$id": "1005", + "$id": "1014", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "583" }, "isApiVersion": false, "contentTypes": [ @@ -16562,12 +16710,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "1006", + "$id": "1015", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "583" }, "location": "Body", "isApiVersion": false, @@ -16594,14 +16742,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "246" + "$ref": "250" } } ], @@ -16631,18 +16779,18 @@ }, "parameters": [ { - "$ref": "1006" + "$ref": "1015" }, { - "$ref": "1002" + "$ref": "1011" }, { - "$ref": "1004" + "$ref": "1013" } ], "response": { "type": { - "$ref": "579" + "$ref": "583" } }, "isOverride": false, @@ -16651,7 +16799,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "1007", + "$id": "1016", "kind": "basic", "name": "updateTreeAsJson", "isExactName": false, @@ -16662,7 +16810,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1008", + "$id": "1017", "name": "updateTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16670,12 +16818,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1009", + "$id": "1018", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "248" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -16686,12 +16834,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1010", + "$id": "1019", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "248" + "$ref": "252" }, "location": "Header", "isApiVersion": false, @@ -16707,12 +16855,12 @@ "isExactName": false }, { - "$id": "1011", + "$id": "1020", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "256" }, "isApiVersion": false, "optional": false, @@ -16723,12 +16871,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1012", + "$id": "1021", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "256" }, "location": "Header", "isApiVersion": false, @@ -16744,12 +16892,12 @@ "isExactName": false }, { - "$id": "1013", + "$id": "1022", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "583" }, "isApiVersion": false, "contentTypes": [ @@ -16763,12 +16911,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1014", + "$id": "1023", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "583" }, "location": "Body", "isApiVersion": false, @@ -16795,14 +16943,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "254" + "$ref": "258" } } ], @@ -16832,18 +16980,18 @@ }, "parameters": [ { - "$ref": "1014" + "$ref": "1023" }, { - "$ref": "1010" + "$ref": "1019" }, { - "$ref": "1012" + "$ref": "1021" } ], "response": { "type": { - "$ref": "579" + "$ref": "583" } }, "isOverride": false, @@ -16854,12 +17002,12 @@ ], "parameters": [ { - "$id": "1015", + "$id": "1024", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1016", + "$id": "1025", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16883,19 +17031,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "1017", + "$id": "1026", "kind": "client", "name": "Metrics", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1018", + "$id": "1027", "kind": "basic", "name": "getWidgetMetrics", "isExactName": false, @@ -16906,7 +17054,7 @@ ], "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1019", + "$id": "1028", "name": "getWidgetMetrics", "isExactName": false, "resourceName": "Metrics", @@ -16914,12 +17062,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1020", + "$id": "1029", "kind": "path", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1021", + "$id": "1030", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16937,12 +17085,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", "methodParameterSegments": [ { - "$id": "1022", + "$id": "1031", "kind": "method", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1023", + "$id": "1032", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16962,7 +17110,7 @@ "isExactName": false }, { - "$id": "1024", + "$id": "1033", "kind": "path", "name": "day", "serializedName": "day", @@ -16981,7 +17129,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1025", + "$id": "1034", "kind": "method", "name": "day", "serializedName": "day", @@ -17002,12 +17150,12 @@ "isExactName": false }, { - "$id": "1026", + "$id": "1035", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "260" }, "isApiVersion": false, "optional": false, @@ -17018,12 +17166,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1027", + "$id": "1036", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "260" }, "location": "Header", "isApiVersion": false, @@ -17045,7 +17193,7 @@ 200 ], "bodyType": { - "$ref": "590" + "$ref": "594" }, "headers": [], "isErrorResponse": false, @@ -17071,15 +17219,15 @@ }, "parameters": [ { - "$ref": "1025" + "$ref": "1034" }, { - "$ref": "1027" + "$ref": "1036" } ], "response": { "type": { - "$ref": "590" + "$ref": "594" } }, "isOverride": false, @@ -17090,12 +17238,12 @@ ], "parameters": [ { - "$id": "1028", + "$id": "1037", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1029", + "$id": "1038", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17111,7 +17259,7 @@ "isExactName": false }, { - "$ref": "1022" + "$ref": "1031" } ], "initializedBy": 3, @@ -17122,19 +17270,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "1030", + "$id": "1039", "kind": "client", "name": "Notebooks", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1031", + "$id": "1040", "kind": "basic", "name": "getNotebook", "isExactName": false, @@ -17145,7 +17293,7 @@ ], "doc": "Get a notebook by name", "operation": { - "$id": "1032", + "$id": "1041", "name": "getNotebook", "isExactName": false, "resourceName": "Notebooks", @@ -17153,12 +17301,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1033", + "$id": "1042", "kind": "path", "name": "notebookName", "serializedName": "notebookName", "type": { - "$id": "1034", + "$id": "1043", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17176,12 +17324,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1035", + "$id": "1044", "kind": "method", "name": "notebook", "serializedName": "notebook", "type": { - "$id": "1036", + "$id": "1045", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17202,12 +17350,12 @@ "isExactName": false }, { - "$id": "1037", + "$id": "1046", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "258" + "$ref": "262" }, "isApiVersion": false, "optional": false, @@ -17218,12 +17366,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1038", + "$id": "1047", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "258" + "$ref": "262" }, "location": "Header", "isApiVersion": false, @@ -17245,7 +17393,7 @@ 200 ], "bodyType": { - "$ref": "595" + "$ref": "599" }, "headers": [], "isErrorResponse": false, @@ -17271,12 +17419,12 @@ }, "parameters": [ { - "$ref": "1038" + "$ref": "1047" } ], "response": { "type": { - "$ref": "595" + "$ref": "599" } }, "isOverride": false, @@ -17287,12 +17435,12 @@ ], "parameters": [ { - "$id": "1039", + "$id": "1048", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1040", + "$id": "1049", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17308,7 +17456,7 @@ "isExactName": false }, { - "$ref": "1035" + "$ref": "1044" } ], "initializedBy": 3, @@ -17319,7 +17467,7 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "648" }, "isMultiServiceClient": false } From 0955d59ca740b0d89c6d831386c92ed61bfe90fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 17:20:40 +0000 Subject: [PATCH 42/47] fix(http-client-csharp): simplify response parse generation Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 21 +- ...ity_BothMethodsParamOrderChanged(Async).cs | 4 +- ...lity_BothMethodsParamOrderChanged(Sync).cs | 4 +- ...nvenienceMethodParamOrderChanged(Async).cs | 4 +- ...onvenienceMethodParamOrderChanged(Sync).cs | 4 +- ...ltipleNewOptionalNonBodyParametersAdded.cs | 8 +- ...dyParameterDoesNotAddBackCompatOverload.cs | 8 +- ...bility_NewOptionalNonBodyParameterAdded.cs | 8 +- ...ionalNonBodyParameterAddedWithModelBody.cs | 8 +- ...rameterAddedWithPathAndHeaderParameters.cs | 8 +- ...ty_NewOptionalParameterWithReservedName.cs | 8 +- ...edParameterDoesNotAddBackCompatOverload.cs | 8 +- ...numReturnTypeMethods(False,False,False).cs | 4 +- ...EnumReturnTypeMethods(False,False,True).cs | 4 +- ...EnumReturnTypeMethods(False,True,False).cs | 4 +- .../EnumReturnTypeMethods(False,True,True).cs | 4 +- ...EnumReturnTypeMethods(True,False,False).cs | 4 +- .../EnumReturnTypeMethods(True,False,True).cs | 4 +- .../EnumReturnTypeMethods(True,True,False).cs | 4 +- .../EnumReturnTypeMethods(True,True,True).cs | 4 +- ...entTypeScalarResponseUsesJsonConversion.cs | 4 +- ...TextDurationReturnTypeMethods(Constant).cs | 4 +- ...tionReturnTypeMethods(ConstantNullable).cs | 4 +- ...nTextDurationReturnTypeMethods(Iso8601).cs | 4 +- ...ationReturnTypeMethods(Iso8601Nullable).cs | 4 +- ...nReturnTypeMethods(MillisecondsFloat32).cs | 4 +- ...ypeMethods(MillisecondsFloat32Nullable).cs | 4 +- ...nReturnTypeMethods(MillisecondsFloat64).cs | 4 +- ...ypeMethods(MillisecondsFloat64Nullable).cs | 4 +- ...ionReturnTypeMethods(MillisecondsInt32).cs | 4 +- ...nTypeMethods(MillisecondsInt32Nullable).cs | 4 +- ...ionReturnTypeMethods(MillisecondsInt64).cs | 4 +- ...nTypeMethods(MillisecondsInt64Nullable).cs | 4 +- ...rationReturnTypeMethods(SecondsFloat32).cs | 4 +- ...turnTypeMethods(SecondsFloat32Nullable).cs | 4 +- ...rationReturnTypeMethods(SecondsFloat64).cs | 4 +- ...turnTypeMethods(SecondsFloat64Nullable).cs | 4 +- ...DurationReturnTypeMethods(SecondsInt32).cs | 4 +- ...ReturnTypeMethods(SecondsInt32Nullable).cs | 4 +- ...DurationReturnTypeMethods(SecondsInt64).cs | 4 +- ...ReturnTypeMethods(SecondsInt64Nullable).cs | 4 +- ...thodsReportsUnsupportedEncoding(Custom).cs | 4 +- ...numReturnTypeMethods(False,False,False).cs | 4 +- ...EnumReturnTypeMethods(False,False,True).cs | 4 +- ...EnumReturnTypeMethods(False,True,False).cs | 4 +- ...tEnumReturnTypeMethods(False,True,True).cs | 4 +- ...EnumReturnTypeMethods(True,False,False).cs | 4 +- ...tEnumReturnTypeMethods(True,False,True).cs | 4 +- ...tEnumReturnTypeMethods(True,True,False).cs | 4 +- ...xtEnumReturnTypeMethods(True,True,True).cs | 4 +- ...ainTextScalarReturnTypeMethods(Boolean).cs | 4 +- ...calarReturnTypeMethods(BooleanNullable).cs | 4 +- .../PlainTextScalarReturnTypeMethods(Byte).cs | 4 +- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +- ...PlainTextScalarReturnTypeMethods(Int32).cs | 4 +- ...tScalarReturnTypeMethods(Int32Nullable).cs | 4 +- ...PlainTextScalarReturnTypeMethods(SByte).cs | 4 +- ...inTextScalarReturnTypeMethods(TimeSpan).cs | 4 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 +- .../PlainTextScalarReturnTypeMethods(Uri).cs | 4 +- .../ScalarReturnTypeMethods(Boolean).cs | 4 +- ...calarReturnTypeMethods(BooleanNullable).cs | 4 +- .../ScalarReturnTypeMethods(Byte).cs | 4 +- ...ScalarReturnTypeMethods(DateTimeOffset).cs | 4 +- .../ScalarReturnTypeMethods(Decimal).cs | 4 +- .../ScalarReturnTypeMethods(Double).cs | 4 +- .../ScalarReturnTypeMethods(Int32).cs | 4 +- .../ScalarReturnTypeMethods(Int32Async).cs | 4 +- .../ScalarReturnTypeMethods(Int32Nullable).cs | 4 +- ...arReturnTypeMethods(Int32NullableAsync).cs | 4 +- .../ScalarReturnTypeMethods(Int64).cs | 4 +- .../ScalarReturnTypeMethods(SByte).cs | 4 +- .../ScalarReturnTypeMethods(Single).cs | 4 +- .../ScalarReturnTypeMethods(String).cs | 4 +- .../ScalarReturnTypeMethods(TimeSpan).cs | 4 +- ...alarReturnTypeMethods(TimeSpanNullable).cs | 4 +- .../ScalarReturnTypeMethods(Uri).cs | 4 +- .../Local.Tests/PrimitiveResponseTests.cs | 22 - .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 8 - .../SampleTypeSpecClient.RestClient.cs | 12 - .../src/Generated/SampleTypeSpecClient.cs | 58 - .../Local/Sample-TypeSpec/tspCodeModel.json | 2434 ++++++++--------- 82 files changed, 1317 insertions(+), 1570 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index da22c91db54..ebfe39c85d2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -297,10 +297,8 @@ .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out va .. GetStackVariablesForProtocolParamConversion(convenienceBodyParameters, out var paramDeclarations), Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result), .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations), - // Route primitive and enum responses through GetResultConversionStatements even when the response body type - // isn't in the IsConvertibleFromBinaryData allow-list (e.g. Uri or the byte/short/unsigned integer types). IsConvertibleFromBinaryData(responseBodyType) - || IsPlainTextParsableType(responseBodyType) + || GetPlainTextParseType(responseBodyType, out _) is not null ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : new[] @@ -308,8 +306,8 @@ .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, Declare("data", result.GetRawResponse().Content(), out var data), // JsonDocument.Parse(BinaryData) does not strip a leading UTF-8 BOM, so trim it // from the content string before parsing (mirroring the primitive/enum path above). - Declare("content", typeof(string), data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(), out var content), - UsingDeclare("document", JsonDocumentSnippets.Parse(content), out var jsonDocument), + Declare("responseContent", typeof(string), data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(), out var responseContent), + UsingDeclare("document", JsonDocumentSnippets.Parse(responseContent), out var jsonDocument), Declare("element", jsonDocument.RootElement(), out var jsonElement), Return(result.FromValue( ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( @@ -643,7 +641,7 @@ private IEnumerable GetStackVariablesForReturnValueConversi out declarations); } - if ((IsConvertibleFromBinaryData(responseBodyType) || IsPlainTextParsableType(responseBodyType)) + if ((IsConvertibleFromBinaryData(responseBodyType) || GetPlainTextParseType(responseBodyType, out _) is not null) && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) && !responseBodyType.Equals(typeof(BinaryData)) && !HasOnlyPlainTextContentType()) @@ -652,8 +650,8 @@ private IEnumerable GetStackVariablesForReturnValueConversi var contentExpression = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var statements = new MethodBodyStatement[] { - Declare("content", typeof(string), contentExpression, out var content), - UsingDeclare("document", JsonDocumentSnippets.Parse(content), out var document) + Declare("responseContent", typeof(string), contentExpression, out var responseContent), + UsingDeclare("document", JsonDocumentSnippets.Parse(responseContent), out var document) }; declarations["data"] = data; declarations["document"] = document; @@ -871,8 +869,8 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); return [ - Declare("content", typeof(string), contentExpression, out var content), - Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, plainTextParseType, enumType, content), out var value), + Declare("responseContent", typeof(string), contentExpression, out var responseContent), + Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, plainTextParseType, enumType, responseContent), out var value), Return(result.FromValue(value, response)) ]; } @@ -1008,9 +1006,6 @@ private static ScopedApi ParseNumeric(ValueExpression content, ValueExpres return Static().Invoke("Parse", [content, invariantCulture]).As(); } - private static bool IsPlainTextParsableType(CSharpType responseBodyType) - => GetPlainTextParseType(responseBodyType, out _) is not null; - /// /// Gets the framework type that a raw text response body is parsed into, or null when the response body /// type isn't a primitive or enum that can be parsed from raw text. Types such as , diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index 9de15e41fea..92adcc3f6f6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index d1964fb2048..3e6f145c10a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index d455517fc1d..6f0362c208c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index a91fdb1c1af..a1c9db2f9a3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -4,8 +4,8 @@ using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index ae7f36dfb77..d8eee1177b1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -36,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index fa152612afa..0a030549b66 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -29,8 +29,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -39,8 +39,8 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index a58531079f8..3eb5badd2fe 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -36,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index c33794b22b7..33e7cfd26fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -35,8 +35,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -46,8 +46,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index c57f279adbc..05454974818 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -37,8 +37,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -49,8 +49,8 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index ffcb38cebba..ef9d1060e4e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -36,8 +36,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); - string content1 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content1); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +48,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content1 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content1); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index c3a8a4f07e2..a7d8a296a63 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -35,8 +35,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -47,8 +47,8 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content0 = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content0); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 852aebbba1e..76c675d5e6b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index 436e4b9279f..b8babbb504c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 69683a932f8..83ecbb8d0a8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs index e004129df37..0f9138ef66b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index be09c28980b..8937191ff31 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs index 5ce2e23099b..a2e643750d1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index 1cf3ed795da..6ad649b8de1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 057ea1ef413..6550046d59d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs index 31b82c8fc16..a79117abb00 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs index b67c8f1613f..fa3e9b99eec 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs index 73d84d2e0c2..d0472ddb0da 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs index 0725410f59b..e540b2194df 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "P"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "P"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs index 1f60b8012ac..43df82093b5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "P"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "P"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs index b409ec033c1..c989740a7fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs index c563f8434c5..bc00e8878fe 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs index b409ec033c1..c989740a7fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs index c563f8434c5..bc00e8878fe 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs index 9a0394de94b..24f12e738d6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs index b1dfebeae4c..7cea97aa7b2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs index 293a46a6697..df1cc8872f3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs index 1cc826ce0f2..af446fc2ac6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs index 023e5e55402..5a51537a96e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs index 27675746fa4..0f3ec66fef1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs index 023e5e55402..5a51537a96e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs index 27675746fa4..0f3ec66fef1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs index 1effae407a0..4dc2b1d12bf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs index 365537f1083..9576b3d43eb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs index f0be3cce208..d75bf80ef53 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs index 717d685be14..a2d1a971259 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(long.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs index b67c8f1613f..fa3e9b99eec 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "c"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs index e3de8f298ee..8af61cdb4f1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs index 972e902f810..24c555b35bb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs index 6076a3a76f8..70aaf2a1eab 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs index 3fadb9f4cc3..a964515b28a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture)); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs index 5db2345600e..f88b306e31e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = content.ToTestEnum(); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = responseContent.ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs index 32773d0b10c..ee7da3bdb11 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : content.ToTestEnum(); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : responseContent.ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs index c2384e9e4a1..fce15f31fdf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(responseContent); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs index 99ffd919910..cdd51459e22 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (content.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(responseContent); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs index e60aa9f8da9..8af52b6f272 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - bool value = bool.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + bool value = bool.Parse(responseContent); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs index 99144f3d66d..f7157d25b4a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - bool? value = (content.Trim() == "null") ? ((bool?)null) : bool.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + bool? value = (responseContent.Trim() == "null") ? ((bool?)null) : bool.Parse(responseContent); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs index 0f2787434cd..2cb8ae9f1fa 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - byte value = byte.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + byte value = byte.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs index 2096ab0828b..540edacf26e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(content, "D"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(responseContent, "D"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs index 5830cf55741..3552596ea3a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - int value = int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + int value = int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs index 19ce9ffe81b..417bd715874 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - int? value = (content.Trim() == "null") ? ((int?)null) : int.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + int? value = (responseContent.Trim() == "null") ? ((int?)null) : int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs index 59c32d7181d..9df44570c5f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - sbyte value = sbyte.Parse(content, global::System.Globalization.CultureInfo.InvariantCulture); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + sbyte value = sbyte.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs index f8786805243..f376fd91ae7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(content, "T"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs index a3debf5c6f5..3c9abe5c949 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(content, "T"); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs index e657b2b0bb5..33ac4138f24 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs @@ -1,7 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.Uri value = new global::System.Uri(content, global::System.UriKind.RelativeOrAbsolute); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + global::System.Uri value = new global::System.Uri(responseContent, global::System.UriKind.RelativeOrAbsolute); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index e17daacdef4..64efc8b63b8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); bool value = document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index bd688db8f2d..d195b47e755 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs index 501270a5126..14f1dfdcc07 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); byte value = document.RootElement.GetByte(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index 3e25c024fec..d2093f1da79 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index 9fe273cc03b..805b2536a73 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); decimal value = document.RootElement.GetDecimal(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 8ccb380fa30..969f7115a27 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); double value = document.RootElement.GetDouble(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index 4f2ebeaa888..fabc6864f25 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index c27126bbfa8..e70666393ba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 22b846f5be7..32d4a8bc966 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index 50fc187fe0b..abccb3207b7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,8 +1,8 @@ public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index 124dd51dac5..e3a6750d45f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); long value = document.RootElement.GetInt64(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs index fc016db7c98..aaa5edd149e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); sbyte value = document.RootElement.GetSByte(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index 732c97cb9a0..b1665f28222 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); float value = document.RootElement.GetSingle(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index 8476e83978d..2ef5985a49f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index be7599b073c..01bcb5abce3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index bf91854b34f..de29b05007d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs index 67fc6983cda..132ea56216e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs @@ -1,8 +1,8 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); global::System.Uri value = new global::System.Uri(document.RootElement.GetString(), global::System.UriKind.RelativeOrAbsolute); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs index a18c819431c..c9d6fbc23ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs @@ -39,27 +39,5 @@ public async Task JsonInt32ResponseDeserialization(bool hasBom, bool isAsync) Assert.AreSame(response.Object, result.GetRawResponse()); Assert.AreSame(content, result.GetRawResponse().Content); } - - [TestCase(false)] - [TestCase(true)] - public async Task JsonUint8ResponseDeserialization(bool isAsync) - { - var payload = Encoding.UTF8.GetBytes("42"); - var content = BinaryData.FromBytes([.. Encoding.UTF8.GetPreamble(), .. payload]); - var response = new Mock(); - response.SetupGet(r => r.Content).Returns(content); - var protocolResult = ClientResult.FromResponse(response.Object); - var client = new Mock { CallBase = true }; - client.Setup(c => c.GetJsonUint8(It.IsAny())).Returns(protocolResult); - client.Setup(c => c.GetJsonUint8Async(It.IsAny())).ReturnsAsync(protocolResult); - - var result = isAsync - ? await client.Object.GetJsonUint8Async() - : client.Object.GetJsonUint8(); - - Assert.AreEqual(42, result.Value); - Assert.AreSame(response.Object, result.GetRawResponse()); - Assert.AreSame(content, result.GetRawResponse().Content); - } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 3884111de59..5082930e1ed 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -955,11 +955,3 @@ op getJsonInt32(): { @body body: int32; @header contentType: "application/json"; }; - -@get -@route("/json-uint8") -@doc("get JSON uint8") -op getJsonUint8(): { - @body body: uint8; - @header contentType: "application/json"; -}; diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index 9497f27782f..3b1bfa50e55 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -511,17 +511,5 @@ internal PipelineMessage CreateGetJsonInt32Request(RequestOptions options) message.Apply(options); return message; } - - internal PipelineMessage CreateGetJsonUint8Request(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/json-uint8", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 36180bc32c5..34591f52710 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -2122,64 +2122,6 @@ public virtual async Task> GetJsonInt32Async(CancellationToken return ClientResult.FromValue(value, result.GetRawResponse()); } - /// - /// [Protocol Method] get JSON uint8 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetJsonUint8(RequestOptions options) - { - using PipelineMessage message = CreateGetJsonUint8Request(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] get JSON uint8 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetJsonUint8Async(RequestOptions options) - { - using PipelineMessage message = CreateGetJsonUint8Request(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// get JSON uint8. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult GetJsonUint8(CancellationToken cancellationToken = default) - { - ClientResult result = GetJsonUint8(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using JsonDocument document = JsonDocument.Parse(content); - byte value = document.RootElement.GetByte(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - - /// get JSON uint8. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task> GetJsonUint8Async(CancellationToken cancellationToken = default) - { - ClientResult result = await GetJsonUint8Async(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using JsonDocument document = JsonDocument.Parse(content); - byte value = document.RootElement.GetByte(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - /// Initializes a new instance of AnimalOperations. public virtual AnimalOperations GetAnimalOperationsClient() { diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 8ffb1293fe5..623f6c30b1a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -2271,7 +2271,7 @@ { "$id": "232", "kind": "constant", - "name": "GetJsonInt32ResponseContentType40", + "name": "GetXmlAdvancedModelResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -2281,14 +2281,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "234", "kind": "constant", - "name": "GetJsonInt32ResponseContentType41", + "name": "GetXmlAdvancedModelResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -2298,14 +2298,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "236", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType6", + "name": "GetJsonInt32ResponseContentType40", "namespace": "", "usage": "None", "valueType": { @@ -2315,14 +2315,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "238", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType7", + "name": "GetJsonInt32ResponseContentType41", "namespace": "", "usage": "None", "valueType": { @@ -2332,14 +2332,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "240", "kind": "constant", - "name": "GetJsonInt32ResponseContentType42", + "name": "GetXmlAdvancedModelResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -2349,14 +2349,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "242", "kind": "constant", - "name": "GetJsonInt32ResponseContentType43", + "name": "GetXmlAdvancedModelResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -2366,14 +2366,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "244", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType8", + "name": "GetXmlAdvancedModelResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -2390,7 +2390,7 @@ { "$id": "246", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType9", + "name": "GetXmlAdvancedModelResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -2407,7 +2407,7 @@ { "$id": "248", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType10", + "name": "GetJsonInt32ResponseContentType42", "namespace": "", "usage": "None", "valueType": { @@ -2417,14 +2417,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "250", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType11", + "name": "GetJsonInt32ResponseContentType43", "namespace": "", "usage": "None", "valueType": { @@ -2434,7 +2434,7 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, @@ -2505,45 +2505,11 @@ "value": "application/json", "decorators": [], "isExactName": false - }, - { - "$id": "260", - "kind": "constant", - "name": "GetJsonInt32ResponseContentType48", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "261", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "262", - "kind": "constant", - "name": "GetJsonInt32ResponseContentType49", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "263", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false } ], "models": [ { - "$id": "264", + "$id": "260", "kind": "model", "name": "Thing", "apiVersions": [ @@ -2563,7 +2529,7 @@ "isExactName": false, "properties": [ { - "$id": "265", + "$id": "261", "kind": "property", "name": "name", "apiVersions": [ @@ -2573,7 +2539,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "266", + "$id": "262", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2594,7 +2560,7 @@ "isExactName": false }, { - "$id": "267", + "$id": "263", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -2604,23 +2570,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "268", + "$id": "264", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "269", + "$id": "265", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "270", + "$id": "266", "kind": "array", "name": "Array", "valueType": { - "$id": "271", + "$id": "267", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2630,7 +2596,7 @@ "decorators": [] }, { - "$id": "272", + "$id": "268", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2656,7 +2622,7 @@ "isExactName": false }, { - "$id": "273", + "$id": "269", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -2683,7 +2649,7 @@ "isExactName": false }, { - "$id": "274", + "$id": "270", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -2693,10 +2659,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "275", + "$id": "271", "kind": "nullable", "type": { - "$id": "276", + "$id": "272", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2719,7 +2685,7 @@ "isExactName": false }, { - "$id": "277", + "$id": "273", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -2729,10 +2695,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "278", + "$id": "274", "kind": "nullable", "type": { - "$id": "279", + "$id": "275", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2755,7 +2721,7 @@ "isExactName": false }, { - "$id": "280", + "$id": "276", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -2782,7 +2748,7 @@ "isExactName": false }, { - "$id": "281", + "$id": "277", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -2809,7 +2775,7 @@ "isExactName": false }, { - "$id": "282", + "$id": "278", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -2836,7 +2802,7 @@ "isExactName": false }, { - "$id": "283", + "$id": "279", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -2863,7 +2829,7 @@ "isExactName": false }, { - "$id": "284", + "$id": "280", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -2873,7 +2839,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "285", + "$id": "281", "kind": "nullable", "type": { "$ref": "5" @@ -2895,7 +2861,7 @@ "isExactName": false }, { - "$id": "286", + "$id": "282", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -2922,7 +2888,7 @@ "isExactName": false }, { - "$id": "287", + "$id": "283", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -2949,7 +2915,7 @@ "isExactName": false }, { - "$id": "288", + "$id": "284", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -2976,7 +2942,7 @@ "isExactName": false }, { - "$id": "289", + "$id": "285", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -2986,7 +2952,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "290", + "$id": "286", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3007,7 +2973,7 @@ "isExactName": false }, { - "$id": "291", + "$id": "287", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -3017,14 +2983,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "292", + "$id": "288", "kind": "nullable", "type": { - "$id": "293", + "$id": "289", "kind": "array", "name": "Array1", "valueType": { - "$id": "294", + "$id": "290", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3050,7 +3016,7 @@ "isExactName": false }, { - "$id": "295", + "$id": "291", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -3060,10 +3026,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "296", + "$id": "292", "kind": "nullable", "type": { - "$ref": "293" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -3082,7 +3048,7 @@ "isExactName": false }, { - "$id": "297", + "$id": "293", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3092,7 +3058,7 @@ "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "298", + "$id": "294", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3115,7 +3081,7 @@ ] }, { - "$id": "299", + "$id": "295", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3135,7 +3101,7 @@ "isExactName": false, "properties": [ { - "$id": "300", + "$id": "296", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3145,7 +3111,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "301", + "$id": "297", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3166,7 +3132,7 @@ "isExactName": false }, { - "$id": "302", + "$id": "298", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -3176,7 +3142,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "303", + "$id": "299", "kind": "int32", "name": "int32", "encode": "string", @@ -3198,7 +3164,7 @@ "isExactName": false }, { - "$id": "304", + "$id": "300", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -3208,7 +3174,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "305", + "$id": "301", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -3232,7 +3198,7 @@ "isExactName": false }, { - "$id": "306", + "$id": "302", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -3242,10 +3208,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "307", + "$id": "303", "kind": "dict", "keyType": { - "$id": "308", + "$id": "304", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3271,7 +3237,7 @@ "isExactName": false }, { - "$id": "309", + "$id": "305", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -3281,7 +3247,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "264" + "$ref": "260" }, "optional": false, "readOnly": false, @@ -3298,7 +3264,7 @@ "isExactName": false }, { - "$id": "310", + "$id": "306", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -3325,7 +3291,7 @@ "isExactName": false }, { - "$id": "311", + "$id": "307", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -3335,7 +3301,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "312", + "$id": "308", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -3359,7 +3325,7 @@ "isExactName": false }, { - "$id": "313", + "$id": "309", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -3386,7 +3352,7 @@ "isExactName": false }, { - "$id": "314", + "$id": "310", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -3413,7 +3379,7 @@ "isExactName": false }, { - "$id": "315", + "$id": "311", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -3423,7 +3389,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "316", + "$id": "312", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -3447,7 +3413,7 @@ "isExactName": false }, { - "$id": "317", + "$id": "313", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -3474,7 +3440,7 @@ "isExactName": false }, { - "$id": "318", + "$id": "314", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -3501,7 +3467,7 @@ "isExactName": false }, { - "$id": "319", + "$id": "315", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -3511,7 +3477,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "320", + "$id": "316", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -3535,7 +3501,7 @@ "isExactName": false }, { - "$id": "321", + "$id": "317", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -3562,7 +3528,7 @@ "isExactName": false }, { - "$id": "322", + "$id": "318", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -3572,7 +3538,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "323", + "$id": "319", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -3596,7 +3562,7 @@ "isExactName": false }, { - "$id": "324", + "$id": "320", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -3623,7 +3589,7 @@ "isExactName": false }, { - "$id": "325", + "$id": "321", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -3633,7 +3599,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "326", + "$id": "322", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3654,7 +3620,7 @@ "isExactName": false }, { - "$id": "327", + "$id": "323", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -3664,7 +3630,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "328", + "$id": "324", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3685,7 +3651,7 @@ "isExactName": false }, { - "$id": "329", + "$id": "325", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -3695,17 +3661,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "330", + "$id": "326", "kind": "dict", "keyType": { - "$id": "331", + "$id": "327", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "332", + "$id": "328", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3728,7 +3694,7 @@ "isExactName": false }, { - "$id": "333", + "$id": "329", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -3738,7 +3704,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "330" + "$ref": "326" }, "optional": true, "readOnly": false, @@ -3755,7 +3721,7 @@ "isExactName": false }, { - "$id": "334", + "$id": "330", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -3765,7 +3731,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "330" + "$ref": "326" }, "optional": false, "readOnly": true, @@ -3782,7 +3748,7 @@ "isExactName": false }, { - "$id": "335", + "$id": "331", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -3792,7 +3758,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "330" + "$ref": "326" }, "optional": true, "readOnly": true, @@ -3809,7 +3775,7 @@ "isExactName": false }, { - "$id": "336", + "$id": "332", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -3819,7 +3785,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "337", + "$id": "333", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -3839,7 +3805,7 @@ "isExactName": false, "properties": [ { - "$id": "338", + "$id": "334", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -3849,10 +3815,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "339", + "$id": "335", "kind": "nullable", "type": { - "$id": "340", + "$id": "336", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3875,7 +3841,7 @@ "isExactName": false }, { - "$id": "341", + "$id": "337", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -3885,7 +3851,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "342", + "$id": "338", "kind": "nullable", "type": { "$ref": "22" @@ -3907,7 +3873,7 @@ "isExactName": false }, { - "$id": "343", + "$id": "339", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -3917,7 +3883,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "344", + "$id": "340", "kind": "nullable", "type": { "$ref": "17" @@ -3955,7 +3921,7 @@ "isExactName": false }, { - "$id": "345", + "$id": "341", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -3965,7 +3931,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "346", + "$id": "342", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -3989,10 +3955,10 @@ ] }, { - "$ref": "337" + "$ref": "333" }, { - "$id": "347", + "$id": "343", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -4007,7 +3973,7 @@ "isExactName": false, "properties": [ { - "$id": "348", + "$id": "344", "kind": "property", "name": "p1", "apiVersions": [ @@ -4016,7 +3982,7 @@ ], "doc": "header parameter", "type": { - "$id": "349", + "$id": "345", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4033,7 +3999,7 @@ "isExactName": false }, { - "$id": "350", + "$id": "346", "kind": "property", "name": "action", "apiVersions": [ @@ -4042,7 +4008,7 @@ ], "doc": "body parameter", "type": { - "$ref": "299" + "$ref": "295" }, "optional": false, "readOnly": false, @@ -4055,7 +4021,7 @@ "isExactName": false }, { - "$id": "351", + "$id": "347", "kind": "property", "name": "p2", "apiVersions": [ @@ -4064,7 +4030,7 @@ ], "doc": "path parameter", "type": { - "$id": "352", + "$id": "348", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4083,7 +4049,7 @@ ] }, { - "$id": "353", + "$id": "349", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4103,7 +4069,7 @@ "isExactName": false, "properties": [ { - "$id": "354", + "$id": "350", "kind": "property", "name": "name", "apiVersions": [ @@ -4113,7 +4079,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "355", + "$id": "351", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4136,7 +4102,7 @@ ] }, { - "$id": "356", + "$id": "352", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -4156,7 +4122,7 @@ "isExactName": false, "properties": [ { - "$id": "357", + "$id": "353", "kind": "property", "name": "otherName", "apiVersions": [ @@ -4166,7 +4132,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "358", + "$id": "354", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4189,7 +4155,7 @@ ] }, { - "$id": "359", + "$id": "355", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -4209,7 +4175,7 @@ "properties": [] }, { - "$id": "360", + "$id": "356", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -4228,7 +4194,7 @@ "isExactName": false, "properties": [ { - "$id": "361", + "$id": "357", "kind": "property", "name": "things", "apiVersions": [ @@ -4237,11 +4203,11 @@ ], "serializedName": "things", "type": { - "$id": "362", + "$id": "358", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "264" + "$ref": "260" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -4261,7 +4227,7 @@ "isExactName": false }, { - "$id": "363", + "$id": "359", "kind": "property", "name": "next", "apiVersions": [ @@ -4270,7 +4236,7 @@ ], "serializedName": "next", "type": { - "$id": "364", + "$id": "360", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -4293,7 +4259,7 @@ ] }, { - "$id": "365", + "$id": "361", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -4312,7 +4278,7 @@ "isExactName": false, "properties": [ { - "$id": "366", + "$id": "362", "kind": "property", "name": "things", "apiVersions": [ @@ -4321,7 +4287,7 @@ ], "serializedName": "things", "type": { - "$ref": "362" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4338,7 +4304,7 @@ "isExactName": false }, { - "$id": "367", + "$id": "363", "kind": "property", "name": "next", "apiVersions": [ @@ -4347,7 +4313,7 @@ ], "serializedName": "next", "type": { - "$id": "368", + "$id": "364", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4370,7 +4336,7 @@ ] }, { - "$id": "369", + "$id": "365", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -4389,7 +4355,7 @@ "isExactName": false, "properties": [ { - "$id": "370", + "$id": "366", "kind": "property", "name": "things", "apiVersions": [ @@ -4398,7 +4364,7 @@ ], "serializedName": "things", "type": { - "$ref": "362" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4415,7 +4381,7 @@ "isExactName": false }, { - "$id": "371", + "$id": "367", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -4424,7 +4390,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "372", + "$id": "368", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4447,7 +4413,7 @@ ] }, { - "$id": "373", + "$id": "369", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -4463,7 +4429,7 @@ "isExactName": false, "properties": [ { - "$id": "374", + "$id": "370", "kind": "property", "name": "things", "apiVersions": [ @@ -4472,7 +4438,7 @@ ], "serializedName": "things", "type": { - "$ref": "362" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4491,7 +4457,7 @@ ] }, { - "$id": "375", + "$id": "371", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -4510,7 +4476,7 @@ "isExactName": false, "properties": [ { - "$id": "376", + "$id": "372", "kind": "property", "name": "items", "apiVersions": [ @@ -4519,7 +4485,7 @@ ], "serializedName": "items", "type": { - "$ref": "362" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -4538,7 +4504,7 @@ ] }, { - "$id": "377", + "$id": "373", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -4557,7 +4523,7 @@ "isExactName": false, "properties": [ { - "$id": "378", + "$id": "374", "kind": "property", "name": "name", "apiVersions": [ @@ -4567,7 +4533,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "379", + "$id": "375", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4588,7 +4554,7 @@ "isExactName": false }, { - "$id": "380", + "$id": "376", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -4598,7 +4564,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "381", + "$id": "377", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4619,7 +4585,7 @@ "isExactName": false }, { - "$id": "382", + "$id": "378", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -4629,7 +4595,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "383", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4650,7 +4616,7 @@ "isExactName": false }, { - "$id": "384", + "$id": "380", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -4660,7 +4626,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "385", + "$id": "381", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4681,7 +4647,7 @@ "isExactName": false }, { - "$id": "386", + "$id": "382", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -4691,7 +4657,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "387", + "$id": "383", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4714,7 +4680,7 @@ ] }, { - "$id": "388", + "$id": "384", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -4739,7 +4705,7 @@ "isExactName": false, "properties": [ { - "$id": "389", + "$id": "385", "kind": "property", "name": "name", "apiVersions": [ @@ -4748,7 +4714,7 @@ ], "serializedName": "name", "type": { - "$id": "390", + "$id": "386", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4769,7 +4735,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "387", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4778,7 +4744,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "392", + "$id": "388", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4799,7 +4765,7 @@ "isExactName": false }, { - "$id": "393", + "$id": "389", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -4808,7 +4774,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "394", + "$id": "390", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4829,7 +4795,7 @@ "isExactName": false }, { - "$id": "395", + "$id": "391", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -4838,10 +4804,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "396", + "$id": "392", "kind": "nullable", "type": { - "$ref": "293" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -4860,7 +4826,7 @@ "isExactName": false }, { - "$id": "397", + "$id": "393", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -4869,10 +4835,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "398", + "$id": "394", "kind": "nullable", "type": { - "$ref": "293" + "$ref": "289" }, "namespace": "SampleTypeSpec" }, @@ -4891,7 +4857,7 @@ "isExactName": false }, { - "$id": "399", + "$id": "395", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -4900,20 +4866,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "400", + "$id": "396", "kind": "nullable", "type": { - "$id": "401", + "$id": "397", "kind": "dict", "keyType": { - "$id": "402", + "$id": "398", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "403", + "$id": "399", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4938,7 +4904,7 @@ "isExactName": false }, { - "$id": "404", + "$id": "400", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -4947,10 +4913,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "405", + "$id": "401", "kind": "nullable", "type": { - "$ref": "401" + "$ref": "397" }, "namespace": "SampleTypeSpec" }, @@ -4969,7 +4935,7 @@ "isExactName": false }, { - "$id": "406", + "$id": "402", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -4978,7 +4944,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "401" + "$ref": "397" }, "optional": false, "readOnly": false, @@ -4995,7 +4961,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "403", "kind": "property", "name": "foo", "apiVersions": [ @@ -5004,7 +4970,7 @@ ], "serializedName": "foo", "type": { - "$id": "408", + "$id": "404", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -5029,7 +4995,7 @@ "isExactName": false, "properties": [ { - "$id": "409", + "$id": "405", "kind": "property", "name": "bar", "apiVersions": [ @@ -5038,7 +5004,7 @@ ], "serializedName": "bar", "type": { - "$id": "410", + "$id": "406", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5075,7 +5041,7 @@ "isExactName": false }, { - "$id": "411", + "$id": "407", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5084,11 +5050,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "412", + "$id": "408", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "408" + "$ref": "404" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5108,7 +5074,7 @@ "isExactName": false }, { - "$id": "413", + "$id": "409", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -5117,11 +5083,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "414", + "$id": "410", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "412" + "$ref": "408" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5141,7 +5107,7 @@ "isExactName": false }, { - "$id": "415", + "$id": "411", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -5150,17 +5116,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "416", + "$id": "412", "kind": "dict", "keyType": { - "$id": "417", + "$id": "413", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "408" + "$ref": "404" }, "decorators": [] }, @@ -5179,7 +5145,7 @@ "isExactName": false }, { - "$id": "418", + "$id": "414", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -5188,17 +5154,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "419", + "$id": "415", "kind": "dict", "keyType": { - "$id": "420", + "$id": "416", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "416" + "$ref": "412" }, "decorators": [] }, @@ -5217,7 +5183,7 @@ "isExactName": false }, { - "$id": "421", + "$id": "417", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -5226,17 +5192,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "422", + "$id": "418", "kind": "dict", "keyType": { - "$id": "423", + "$id": "419", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "412" + "$ref": "408" }, "decorators": [] }, @@ -5255,7 +5221,7 @@ "isExactName": false }, { - "$id": "424", + "$id": "420", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -5264,11 +5230,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "425", + "$id": "421", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "416" + "$ref": "412" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5290,10 +5256,10 @@ ] }, { - "$ref": "408" + "$ref": "404" }, { - "$id": "426", + "$id": "422", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -5322,7 +5288,7 @@ "isExactName": false, "properties": [ { - "$id": "427", + "$id": "423", "kind": "property", "name": "name", "apiVersions": [ @@ -5332,7 +5298,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "428", + "$id": "424", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5355,7 +5321,7 @@ "isExactName": false }, { - "$id": "429", + "$id": "425", "kind": "property", "name": "age", "apiVersions": [ @@ -5365,7 +5331,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "430", + "$id": "426", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5388,7 +5354,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "427", "kind": "property", "name": "enabled", "apiVersions": [ @@ -5398,7 +5364,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "432", + "$id": "428", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5421,7 +5387,7 @@ "isExactName": false }, { - "$id": "433", + "$id": "429", "kind": "property", "name": "score", "apiVersions": [ @@ -5431,7 +5397,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "434", + "$id": "430", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -5454,7 +5420,7 @@ "isExactName": false }, { - "$id": "435", + "$id": "431", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -5464,7 +5430,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "436", + "$id": "432", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5487,7 +5453,7 @@ "isExactName": false }, { - "$id": "437", + "$id": "433", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5497,7 +5463,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "438", + "$id": "434", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5520,7 +5486,7 @@ "isExactName": false }, { - "$id": "439", + "$id": "435", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -5530,10 +5496,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "440", + "$id": "436", "kind": "nullable", "type": { - "$id": "441", + "$id": "437", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5558,7 +5524,7 @@ "isExactName": false }, { - "$id": "442", + "$id": "438", "kind": "property", "name": "id", "apiVersions": [ @@ -5568,7 +5534,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "443", + "$id": "439", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5596,7 +5562,7 @@ "isExactName": false }, { - "$id": "444", + "$id": "440", "kind": "property", "name": "version", "apiVersions": [ @@ -5606,7 +5572,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "445", + "$id": "441", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5634,7 +5600,7 @@ "isExactName": false }, { - "$id": "446", + "$id": "442", "kind": "property", "name": "isActive", "apiVersions": [ @@ -5644,7 +5610,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "447", + "$id": "443", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5672,7 +5638,7 @@ "isExactName": false }, { - "$id": "448", + "$id": "444", "kind": "property", "name": "originalName", "apiVersions": [ @@ -5682,7 +5648,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "449", + "$id": "445", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5712,7 +5678,7 @@ "isExactName": false }, { - "$id": "450", + "$id": "446", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -5722,7 +5688,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "451", + "$id": "447", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5756,7 +5722,7 @@ "isExactName": false }, { - "$id": "452", + "$id": "448", "kind": "property", "name": "content", "apiVersions": [ @@ -5766,7 +5732,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "453", + "$id": "449", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5794,7 +5760,7 @@ "isExactName": false }, { - "$id": "454", + "$id": "450", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -5804,7 +5770,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "270" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -5829,7 +5795,7 @@ "isExactName": false }, { - "$id": "455", + "$id": "451", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -5839,7 +5805,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "293" + "$ref": "289" }, "optional": false, "readOnly": false, @@ -5864,7 +5830,7 @@ "isExactName": false }, { - "$id": "456", + "$id": "452", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -5874,11 +5840,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "457", + "$id": "453", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "458", + "$id": "454", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -5907,7 +5873,7 @@ "isExactName": false, "properties": [ { - "$id": "459", + "$id": "455", "kind": "property", "name": "itemName", "apiVersions": [ @@ -5917,7 +5883,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "460", + "$id": "456", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5940,7 +5906,7 @@ "isExactName": false }, { - "$id": "461", + "$id": "457", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -5950,7 +5916,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "462", + "$id": "458", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5973,7 +5939,7 @@ "isExactName": false }, { - "$id": "463", + "$id": "459", "kind": "property", "name": "itemId", "apiVersions": [ @@ -5983,7 +5949,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "464", + "$id": "460", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6038,7 +6004,7 @@ "isExactName": false }, { - "$id": "465", + "$id": "461", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -6048,7 +6014,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "270" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -6068,7 +6034,7 @@ "isExactName": false }, { - "$id": "466", + "$id": "462", "kind": "property", "name": "items", "apiVersions": [ @@ -6078,7 +6044,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "457" + "$ref": "453" }, "optional": false, "readOnly": false, @@ -6105,7 +6071,7 @@ "isExactName": false }, { - "$id": "467", + "$id": "463", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -6115,7 +6081,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "468", + "$id": "464", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -6137,7 +6103,7 @@ "isExactName": false, "properties": [ { - "$id": "469", + "$id": "465", "kind": "property", "name": "value", "apiVersions": [ @@ -6147,7 +6113,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "470", + "$id": "466", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6170,7 +6136,7 @@ "isExactName": false }, { - "$id": "471", + "$id": "467", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -6180,7 +6146,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "472", + "$id": "468", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6226,7 +6192,7 @@ "isExactName": false }, { - "$id": "473", + "$id": "469", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -6236,7 +6202,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "468" + "$ref": "464" }, "optional": true, "readOnly": false, @@ -6255,7 +6221,7 @@ "isExactName": false }, { - "$id": "474", + "$id": "470", "kind": "property", "name": "metadata", "apiVersions": [ @@ -6265,17 +6231,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "475", + "$id": "471", "kind": "dict", "keyType": { - "$id": "476", + "$id": "472", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "477", + "$id": "473", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6300,7 +6266,7 @@ "isExactName": false }, { - "$id": "478", + "$id": "474", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -6310,12 +6276,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "479", + "$id": "475", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "480", + "$id": "476", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6341,7 +6307,7 @@ "isExactName": false }, { - "$id": "481", + "$id": "477", "kind": "property", "name": "duration", "apiVersions": [ @@ -6351,12 +6317,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "482", + "$id": "478", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "483", + "$id": "479", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6382,7 +6348,7 @@ "isExactName": false }, { - "$id": "484", + "$id": "480", "kind": "property", "name": "data", "apiVersions": [ @@ -6392,7 +6358,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "485", + "$id": "481", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -6416,7 +6382,7 @@ "isExactName": false }, { - "$id": "486", + "$id": "482", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -6426,7 +6392,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "330" + "$ref": "326" }, "optional": true, "readOnly": false, @@ -6445,7 +6411,7 @@ "isExactName": false }, { - "$id": "487", + "$id": "483", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -6474,7 +6440,7 @@ "isExactName": false }, { - "$id": "488", + "$id": "484", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -6503,7 +6469,7 @@ "isExactName": false }, { - "$id": "489", + "$id": "485", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -6532,7 +6498,7 @@ "isExactName": false }, { - "$id": "490", + "$id": "486", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -6561,7 +6527,7 @@ "isExactName": false }, { - "$id": "491", + "$id": "487", "kind": "property", "name": "label", "apiVersions": [ @@ -6570,7 +6536,7 @@ ], "serializedName": "label", "type": { - "$id": "492", + "$id": "488", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6585,14 +6551,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "493", + "$id": "489", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "494", + "$id": "490", "kind": "enum", "decorators": [ { @@ -6605,7 +6571,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "495", + "$id": "491", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -6614,32 +6580,32 @@ }, "values": [ { - "$id": "496", + "$id": "492", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "494" + "$ref": "490" }, "valueType": { - "$ref": "495" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "497", + "$id": "493", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "494" + "$ref": "490" }, "valueType": { - "$ref": "495" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6657,7 +6623,7 @@ "__accessSet": true }, "valueType": { - "$ref": "495" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -6684,7 +6650,7 @@ "isExactName": false }, { - "$id": "498", + "$id": "494", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -6693,7 +6659,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "499", + "$id": "495", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6708,17 +6674,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "500", + "$id": "496", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "494" + "$ref": "490" }, "valueType": { - "$ref": "495" + "$ref": "491" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6741,7 +6707,7 @@ "isExactName": false }, { - "$id": "501", + "$id": "497", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -6750,7 +6716,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "270" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -6782,7 +6748,7 @@ "isExactName": false }, { - "$id": "502", + "$id": "498", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -6791,7 +6757,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "468" + "$ref": "464" }, "optional": false, "readOnly": false, @@ -6822,7 +6788,7 @@ "isExactName": false }, { - "$id": "503", + "$id": "499", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -6831,11 +6797,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "504", + "$id": "500", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "505", + "$id": "501", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -6868,7 +6834,7 @@ "isExactName": false, "properties": [ { - "$id": "506", + "$id": "502", "kind": "property", "name": "foo", "apiVersions": [ @@ -6877,7 +6843,7 @@ ], "serializedName": "foo", "type": { - "$id": "507", + "$id": "503", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6926,7 +6892,7 @@ "isExactName": false }, { - "$id": "508", + "$id": "504", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -6935,7 +6901,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "504" + "$ref": "500" }, "optional": false, "readOnly": false, @@ -6960,7 +6926,7 @@ "isExactName": false }, { - "$id": "509", + "$id": "505", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6969,11 +6935,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "510", + "$id": "506", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "457" + "$ref": "453" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6996,7 +6962,7 @@ "isExactName": false }, { - "$id": "511", + "$id": "507", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -7005,17 +6971,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "512", + "$id": "508", "kind": "dict", "keyType": { - "$id": "513", + "$id": "509", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "458" + "$ref": "454" }, "decorators": [] }, @@ -7036,7 +7002,7 @@ "isExactName": false }, { - "$id": "514", + "$id": "510", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -7045,17 +7011,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "515", + "$id": "511", "kind": "dict", "keyType": { - "$id": "516", + "$id": "512", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "512" + "$ref": "508" }, "decorators": [] }, @@ -7076,7 +7042,7 @@ "isExactName": false }, { - "$id": "517", + "$id": "513", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7085,17 +7051,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "518", + "$id": "514", "kind": "dict", "keyType": { - "$id": "519", + "$id": "515", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "457" + "$ref": "453" }, "decorators": [] }, @@ -7116,7 +7082,7 @@ "isExactName": false }, { - "$id": "520", + "$id": "516", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -7125,11 +7091,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "521", + "$id": "517", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "512" + "$ref": "508" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7154,16 +7120,16 @@ ] }, { - "$ref": "458" + "$ref": "454" }, { - "$ref": "468" + "$ref": "464" }, { - "$ref": "505" + "$ref": "501" }, { - "$id": "522", + "$id": "518", "kind": "model", "name": "Cat", "apiVersions": [ @@ -7178,7 +7144,7 @@ "isExactName": false, "properties": [ { - "$id": "523", + "$id": "519", "kind": "property", "name": "id", "apiVersions": [ @@ -7187,7 +7153,7 @@ ], "serializedName": "id", "type": { - "$id": "524", + "$id": "520", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7214,7 +7180,7 @@ "isExactName": false }, { - "$id": "525", + "$id": "521", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -7223,7 +7189,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "526", + "$id": "522", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -7250,7 +7216,7 @@ "isExactName": false }, { - "$id": "527", + "$id": "523", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -7259,7 +7225,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "528", + "$id": "524", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7286,7 +7252,7 @@ "isExactName": false }, { - "$id": "529", + "$id": "525", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -7295,7 +7261,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "530", + "$id": "526", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -7322,7 +7288,7 @@ "isExactName": false }, { - "$id": "531", + "$id": "527", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -7331,7 +7297,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "532", + "$id": "528", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -7358,7 +7324,7 @@ "isExactName": false }, { - "$id": "533", + "$id": "529", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -7367,7 +7333,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "534", + "$id": "530", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -7394,7 +7360,7 @@ "isExactName": false }, { - "$id": "535", + "$id": "531", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -7403,7 +7369,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "536", + "$id": "532", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -7430,7 +7396,7 @@ "isExactName": false }, { - "$id": "537", + "$id": "533", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -7439,7 +7405,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "538", + "$id": "534", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -7466,7 +7432,7 @@ "isExactName": false }, { - "$id": "539", + "$id": "535", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -7475,7 +7441,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "540", + "$id": "536", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -7502,7 +7468,7 @@ "isExactName": false }, { - "$id": "541", + "$id": "537", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -7511,7 +7477,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "475" + "$ref": "471" }, "optional": false, "readOnly": false, @@ -7534,7 +7500,7 @@ "isExactName": false }, { - "$id": "542", + "$id": "538", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -7543,17 +7509,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "543", + "$id": "539", "kind": "dict", "keyType": { - "$id": "544", + "$id": "540", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "264" + "$ref": "260" }, "decorators": [] }, @@ -7578,7 +7544,7 @@ "isExactName": false }, { - "$id": "545", + "$id": "541", "kind": "property", "name": "listPart", "apiVersions": [ @@ -7587,7 +7553,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "270" + "$ref": "266" }, "optional": false, "readOnly": false, @@ -7610,7 +7576,7 @@ "isExactName": false }, { - "$id": "546", + "$id": "542", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -7619,7 +7585,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "362" + "$ref": "358" }, "optional": false, "readOnly": false, @@ -7642,7 +7608,7 @@ "isExactName": false }, { - "$id": "547", + "$id": "543", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -7651,11 +7617,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "548", + "$id": "544", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "549", + "$id": "545", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7685,7 +7651,7 @@ "isExactName": false }, { - "$id": "550", + "$id": "546", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -7694,7 +7660,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "551", + "$id": "547", "kind": "model", "name": "File", "apiVersions": [], @@ -7709,14 +7675,14 @@ "isFileType": true, "properties": [ { - "$id": "552", + "$id": "548", "kind": "property", "name": "contentType", "apiVersions": [], "summary": "The allowed media (MIME) types of the file contents.", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "type": { - "$id": "553", + "$id": "549", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7733,14 +7699,14 @@ "isExactName": false }, { - "$id": "554", + "$id": "550", "kind": "property", "name": "filename", "apiVersions": [], "summary": "The name of the file, if any.", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "type": { - "$id": "555", + "$id": "551", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7757,14 +7723,14 @@ "isExactName": false }, { - "$id": "556", + "$id": "552", "kind": "property", "name": "contents", "apiVersions": [], "summary": "The contents of the file.", "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", "type": { - "$id": "557", + "$id": "553", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7794,12 +7760,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "558", + "$id": "554", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "summary": "The name of the file, if any.", "apiVersions": [], "type": { - "$id": "559", + "$id": "555", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7830,12 +7796,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "560", + "$id": "556", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "summary": "The allowed media (MIME) types of the file contents.", "apiVersions": [], "type": { - "$id": "561", + "$id": "557", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7876,7 +7842,7 @@ "isExactName": false }, { - "$id": "562", + "$id": "558", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -7908,7 +7874,7 @@ "isExactName": false }, { - "$id": "563", + "$id": "559", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -7940,7 +7906,7 @@ "isExactName": false }, { - "$id": "564", + "$id": "560", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -7972,7 +7938,7 @@ "isExactName": false }, { - "$id": "565", + "$id": "561", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -8006,7 +7972,7 @@ ] }, { - "$id": "566", + "$id": "562", "kind": "model", "name": "File", "apiVersions": [], @@ -8021,18 +7987,18 @@ "isFileType": true, "properties": [ { - "$ref": "552" + "$ref": "548" }, { - "$ref": "554" + "$ref": "550" }, { - "$ref": "556" + "$ref": "552" } ] }, { - "$id": "567", + "$id": "563", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -8051,7 +8017,7 @@ "isExactName": false, "properties": [ { - "$id": "568", + "$id": "564", "kind": "property", "name": "message", "apiVersions": [ @@ -8060,7 +8026,7 @@ ], "serializedName": "message", "type": { - "$id": "569", + "$id": "565", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8083,7 +8049,7 @@ ] }, { - "$id": "570", + "$id": "566", "kind": "model", "name": "Animal", "apiVersions": [ @@ -8102,7 +8068,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "571", + "$id": "567", "kind": "property", "name": "kind", "apiVersions": [ @@ -8112,7 +8078,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "572", + "$id": "568", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8134,10 +8100,10 @@ }, "properties": [ { - "$ref": "571" + "$ref": "567" }, { - "$id": "573", + "$id": "569", "kind": "property", "name": "name", "apiVersions": [ @@ -8147,7 +8113,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "574", + "$id": "570", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8170,7 +8136,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "575", + "$id": "571", "kind": "model", "name": "Pet", "apiVersions": [ @@ -8190,7 +8156,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "576", + "$id": "572", "kind": "property", "name": "kind", "apiVersions": [ @@ -8216,14 +8182,14 @@ "isExactName": false }, "baseModel": { - "$ref": "570" + "$ref": "566" }, "properties": [ { - "$ref": "576" + "$ref": "572" }, { - "$id": "577", + "$id": "573", "kind": "property", "name": "trained", "apiVersions": [ @@ -8233,7 +8199,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "578", + "$id": "574", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8256,7 +8222,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "579", + "$id": "575", "kind": "model", "name": "Dog", "apiVersions": [ @@ -8276,11 +8242,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "575" + "$ref": "571" }, "properties": [ { - "$id": "580", + "$id": "576", "kind": "property", "name": "kind", "apiVersions": [ @@ -8306,7 +8272,7 @@ "isExactName": false }, { - "$id": "581", + "$id": "577", "kind": "property", "name": "breed", "apiVersions": [ @@ -8316,7 +8282,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "582", + "$id": "578", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8341,18 +8307,18 @@ } }, "dog": { - "$ref": "579" + "$ref": "575" } } }, { - "$ref": "575" + "$ref": "571" }, { - "$ref": "579" + "$ref": "575" }, { - "$id": "583", + "$id": "579", "kind": "model", "name": "Tree", "apiVersions": [ @@ -8377,7 +8343,7 @@ }, "isExactName": false, "baseModel": { - "$id": "584", + "$id": "580", "kind": "model", "name": "Plant", "apiVersions": [ @@ -8401,7 +8367,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "585", + "$id": "581", "kind": "property", "name": "species", "apiVersions": [ @@ -8411,7 +8377,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "586", + "$id": "582", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8438,10 +8404,10 @@ }, "properties": [ { - "$ref": "585" + "$ref": "581" }, { - "$id": "587", + "$id": "583", "kind": "property", "name": "id", "apiVersions": [ @@ -8451,7 +8417,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "588", + "$id": "584", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8477,7 +8443,7 @@ "isExactName": false }, { - "$id": "589", + "$id": "585", "kind": "property", "name": "height", "apiVersions": [ @@ -8487,7 +8453,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "590", + "$id": "586", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8515,13 +8481,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "583" + "$ref": "579" } } }, "properties": [ { - "$id": "591", + "$id": "587", "kind": "property", "name": "species", "apiVersions": [ @@ -8552,7 +8518,7 @@ "isExactName": false }, { - "$id": "592", + "$id": "588", "kind": "property", "name": "age", "apiVersions": [ @@ -8562,7 +8528,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "593", + "$id": "589", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8590,10 +8556,10 @@ ] }, { - "$ref": "584" + "$ref": "580" }, { - "$id": "594", + "$id": "590", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -8612,7 +8578,7 @@ "isExactName": false, "properties": [ { - "$id": "595", + "$id": "591", "kind": "property", "name": "numSold", "apiVersions": [ @@ -8621,7 +8587,7 @@ ], "serializedName": "numSold", "type": { - "$id": "596", + "$id": "592", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8642,7 +8608,7 @@ "isExactName": false }, { - "$id": "597", + "$id": "593", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -8651,7 +8617,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "598", + "$id": "594", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8674,7 +8640,7 @@ ] }, { - "$id": "599", + "$id": "595", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -8693,7 +8659,7 @@ "isExactName": false, "properties": [ { - "$id": "600", + "$id": "596", "kind": "property", "name": "name", "apiVersions": [ @@ -8702,7 +8668,7 @@ ], "serializedName": "name", "type": { - "$id": "601", + "$id": "597", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8723,7 +8689,7 @@ "isExactName": false }, { - "$id": "602", + "$id": "598", "kind": "property", "name": "content", "apiVersions": [ @@ -8732,7 +8698,7 @@ ], "serializedName": "content", "type": { - "$id": "603", + "$id": "599", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8755,7 +8721,7 @@ ] }, { - "$id": "604", + "$id": "600", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -8780,7 +8746,7 @@ "isExactName": false, "properties": [ { - "$id": "605", + "$id": "601", "kind": "property", "name": "modelValue", "apiVersions": [ @@ -8789,10 +8755,10 @@ ], "serializedName": "modelValue", "type": { - "$id": "606", + "$id": "602", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8811,7 +8777,7 @@ "isExactName": false }, { - "$id": "607", + "$id": "603", "kind": "property", "name": "children", "apiVersions": [ @@ -8820,17 +8786,17 @@ ], "serializedName": "children", "type": { - "$id": "608", + "$id": "604", "kind": "nullable", "type": { - "$id": "609", + "$id": "605", "kind": "array", "name": "Array2", "valueType": { - "$id": "610", + "$id": "606", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8854,7 +8820,7 @@ "isExactName": false }, { - "$id": "611", + "$id": "607", "kind": "property", "name": "childDictionary", "apiVersions": [ @@ -8863,23 +8829,23 @@ ], "serializedName": "childDictionary", "type": { - "$id": "612", + "$id": "608", "kind": "nullable", "type": { - "$id": "613", + "$id": "609", "kind": "dict", "keyType": { - "$id": "614", + "$id": "610", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "615", + "$id": "611", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8902,7 +8868,7 @@ "isExactName": false }, { - "$id": "616", + "$id": "612", "kind": "property", "name": "nestedChildren", "apiVersions": [ @@ -8911,24 +8877,24 @@ ], "serializedName": "nestedChildren", "type": { - "$id": "617", + "$id": "613", "kind": "nullable", "type": { - "$id": "618", + "$id": "614", "kind": "array", "name": "Array3", "valueType": { - "$id": "619", + "$id": "615", "kind": "nullable", "type": { - "$id": "620", + "$id": "616", "kind": "array", "name": "Array4", "valueType": { - "$id": "621", + "$id": "617", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -8957,7 +8923,7 @@ "isExactName": false }, { - "$id": "622", + "$id": "618", "kind": "property", "name": "nestedChildDictionary", "apiVersions": [ @@ -8966,36 +8932,36 @@ ], "serializedName": "nestedChildDictionary", "type": { - "$id": "623", + "$id": "619", "kind": "nullable", "type": { - "$id": "624", + "$id": "620", "kind": "dict", "keyType": { - "$id": "625", + "$id": "621", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "626", + "$id": "622", "kind": "nullable", "type": { - "$id": "627", + "$id": "623", "kind": "dict", "keyType": { - "$id": "628", + "$id": "624", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "629", + "$id": "625", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -9022,7 +8988,7 @@ "isExactName": false }, { - "$id": "630", + "$id": "626", "kind": "property", "name": "dictionaryChildren", "apiVersions": [ @@ -9031,30 +8997,30 @@ ], "serializedName": "dictionaryChildren", "type": { - "$id": "631", + "$id": "627", "kind": "nullable", "type": { - "$id": "632", + "$id": "628", "kind": "dict", "keyType": { - "$id": "633", + "$id": "629", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "634", + "$id": "630", "kind": "nullable", "type": { - "$id": "635", + "$id": "631", "kind": "array", "name": "Array5", "valueType": { - "$id": "636", + "$id": "632", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -9082,7 +9048,7 @@ "isExactName": false }, { - "$id": "637", + "$id": "633", "kind": "property", "name": "listOfDictionaries", "apiVersions": [ @@ -9091,30 +9057,30 @@ ], "serializedName": "listOfDictionaries", "type": { - "$id": "638", + "$id": "634", "kind": "nullable", "type": { - "$id": "639", + "$id": "635", "kind": "array", "name": "Array6", "valueType": { - "$id": "640", + "$id": "636", "kind": "nullable", "type": { - "$id": "641", + "$id": "637", "kind": "dict", "keyType": { - "$id": "642", + "$id": "638", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "643", + "$id": "639", "kind": "nullable", "type": { - "$ref": "408" + "$ref": "404" }, "namespace": "SampleTypeSpec" }, @@ -9144,7 +9110,7 @@ ] }, { - "$id": "644", + "$id": "640", "kind": "model", "name": "JsonlStreamStreamingItem", "apiVersions": [], @@ -9157,7 +9123,7 @@ "isExactName": false, "properties": [ { - "$id": "645", + "$id": "641", "kind": "property", "name": "contentType", "apiVersions": [ @@ -9178,7 +9144,7 @@ "isExactName": false }, { - "$id": "646", + "$id": "642", "kind": "property", "name": "body", "apiVersions": [ @@ -9186,7 +9152,7 @@ "2024-08-16-preview" ], "type": { - "$id": "647", + "$id": "643", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "", @@ -9207,7 +9173,7 @@ ], "clients": [ { - "$id": "648", + "$id": "644", "kind": "client", "name": "SampleTypeSpecClient", "isExactName": false, @@ -9215,7 +9181,7 @@ "doc": "This is a sample typespec project.", "methods": [ { - "$id": "649", + "$id": "645", "kind": "basic", "name": "sayHi", "isExactName": false, @@ -9226,7 +9192,7 @@ ], "doc": "Return hi", "operation": { - "$id": "650", + "$id": "646", "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9234,12 +9200,12 @@ "accessibility": "public", "parameters": [ { - "$id": "651", + "$id": "647", "kind": "header", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "652", + "$id": "648", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9254,12 +9220,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "653", + "$id": "649", "kind": "method", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "654", + "$id": "650", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9279,12 +9245,12 @@ "isExactName": false }, { - "$id": "655", + "$id": "651", "kind": "query", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "656", + "$id": "652", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9299,12 +9265,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "657", + "$id": "653", "kind": "method", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "658", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9324,12 +9290,12 @@ "isExactName": false }, { - "$id": "659", + "$id": "655", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "660", + "$id": "656", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9344,12 +9310,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "661", + "$id": "657", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "662", + "$id": "658", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9369,7 +9335,7 @@ "isExactName": false }, { - "$id": "663", + "$id": "659", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9385,7 +9351,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "methodParameterSegments": [ { - "$id": "664", + "$id": "660", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9412,7 +9378,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -9438,21 +9404,21 @@ }, "parameters": [ { - "$ref": "653" + "$ref": "649" }, { - "$ref": "657" + "$ref": "653" }, { - "$ref": "661" + "$ref": "657" }, { - "$ref": "664" + "$ref": "660" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -9461,7 +9427,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "665", + "$id": "661", "kind": "basic", "name": "helloAgain", "isExactName": false, @@ -9472,7 +9438,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "666", + "$id": "662", "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9480,12 +9446,12 @@ "accessibility": "public", "parameters": [ { - "$id": "667", + "$id": "663", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "668", + "$id": "664", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9500,12 +9466,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "669", + "$id": "665", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "670", + "$id": "666", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9525,7 +9491,7 @@ "isExactName": false }, { - "$id": "671", + "$id": "667", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9541,7 +9507,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", "methodParameterSegments": [ { - "$id": "672", + "$id": "668", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9562,12 +9528,12 @@ "isExactName": false }, { - "$id": "673", + "$id": "669", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "674", + "$id": "670", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9585,12 +9551,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "675", + "$id": "671", "kind": "method", "name": "p2", "serializedName": "p2", "type": { - "$id": "676", + "$id": "672", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9610,7 +9576,7 @@ "isExactName": false }, { - "$id": "677", + "$id": "673", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9626,7 +9592,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "678", + "$id": "674", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9647,12 +9613,12 @@ "isExactName": false }, { - "$id": "679", + "$id": "675", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "299" + "$ref": "295" }, "isApiVersion": false, "contentTypes": [ @@ -9666,12 +9632,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", "methodParameterSegments": [ { - "$id": "680", + "$id": "676", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$ref": "299" + "$ref": "295" }, "location": "Body", "isApiVersion": false, @@ -9694,7 +9660,7 @@ 200 ], "bodyType": { - "$ref": "299" + "$ref": "295" }, "headers": [], "isErrorResponse": false, @@ -9723,24 +9689,24 @@ }, "parameters": [ { - "$ref": "669" + "$ref": "665" }, { - "$ref": "680" + "$ref": "676" }, { - "$ref": "672" + "$ref": "668" }, { - "$ref": "675" + "$ref": "671" }, { - "$ref": "678" + "$ref": "674" } ], "response": { "type": { - "$ref": "299" + "$ref": "295" } }, "isOverride": false, @@ -9749,7 +9715,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "681", + "$id": "677", "kind": "basic", "name": "noContentType", "isExactName": false, @@ -9760,7 +9726,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "682", + "$id": "678", "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9768,12 +9734,12 @@ "accessibility": "public", "parameters": [ { - "$id": "683", + "$id": "679", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "684", + "$id": "680", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9788,12 +9754,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "685", + "$id": "681", "kind": "method", "name": "info", "serializedName": "info", "type": { - "$ref": "347" + "$ref": "343" }, "location": "", "isApiVersion": false, @@ -9806,13 +9772,13 @@ "isExactName": false }, { - "$id": "686", + "$id": "682", "kind": "method", "name": "p1", "serializedName": "p1", "doc": "header parameter", "type": { - "$ref": "349" + "$ref": "345" }, "location": "", "isApiVersion": false, @@ -9828,12 +9794,12 @@ "isExactName": false }, { - "$id": "687", + "$id": "683", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "688", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9851,16 +9817,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "685" + "$ref": "681" }, { - "$id": "689", + "$id": "685", "kind": "method", "name": "p2", "serializedName": "p2", "doc": "path parameter", "type": { - "$ref": "352" + "$ref": "348" }, "location": "", "isApiVersion": false, @@ -9876,7 +9842,7 @@ "isExactName": false }, { - "$id": "690", + "$id": "686", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9893,7 +9859,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "691", + "$id": "687", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9915,7 +9881,7 @@ "isExactName": false }, { - "$id": "692", + "$id": "688", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9931,7 +9897,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "693", + "$id": "689", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9952,12 +9918,12 @@ "isExactName": false }, { - "$id": "694", + "$id": "690", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "299" + "$ref": "295" }, "isApiVersion": false, "contentTypes": [ @@ -9971,16 +9937,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", "methodParameterSegments": [ { - "$ref": "685" + "$ref": "681" }, { - "$id": "695", + "$id": "691", "kind": "method", "name": "action", "serializedName": "action", "doc": "body parameter", "type": { - "$ref": "299" + "$ref": "295" }, "location": "", "isApiVersion": false, @@ -10007,7 +9973,7 @@ 200 ], "bodyType": { - "$ref": "299" + "$ref": "295" }, "headers": [], "isErrorResponse": false, @@ -10036,18 +10002,18 @@ }, "parameters": [ { - "$ref": "685" + "$ref": "681" }, { - "$ref": "691" + "$ref": "687" }, { - "$ref": "693" + "$ref": "689" } ], "response": { "type": { - "$ref": "299" + "$ref": "295" } }, "isOverride": true, @@ -10056,7 +10022,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "696", + "$id": "692", "kind": "basic", "name": "helloDemo2", "isExactName": false, @@ -10067,7 +10033,7 @@ ], "doc": "Return hi in demo2", "operation": { - "$id": "697", + "$id": "693", "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10075,7 +10041,7 @@ "accessibility": "public", "parameters": [ { - "$id": "698", + "$id": "694", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10091,7 +10057,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "699", + "$id": "695", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10118,7 +10084,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10144,12 +10110,12 @@ }, "parameters": [ { - "$ref": "699" + "$ref": "695" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -10158,7 +10124,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "700", + "$id": "696", "kind": "basic", "name": "createLiteral", "isExactName": false, @@ -10169,7 +10135,7 @@ ], "doc": "Create with literal value", "operation": { - "$id": "701", + "$id": "697", "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10177,7 +10143,7 @@ "accessibility": "public", "parameters": [ { - "$id": "702", + "$id": "698", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10194,7 +10160,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", "methodParameterSegments": [ { - "$id": "703", + "$id": "699", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10216,7 +10182,7 @@ "isExactName": false }, { - "$id": "704", + "$id": "700", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10232,7 +10198,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "705", + "$id": "701", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10253,12 +10219,12 @@ "isExactName": false }, { - "$id": "706", + "$id": "702", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -10272,12 +10238,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", "methodParameterSegments": [ { - "$id": "707", + "$id": "703", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -10304,7 +10270,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10333,18 +10299,18 @@ }, "parameters": [ { - "$ref": "707" + "$ref": "703" }, { - "$ref": "703" + "$ref": "699" }, { - "$ref": "705" + "$ref": "701" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -10353,7 +10319,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "708", + "$id": "704", "kind": "basic", "name": "helloLiteral", "isExactName": false, @@ -10364,7 +10330,7 @@ ], "doc": "Send literal parameters", "operation": { - "$id": "709", + "$id": "705", "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10372,7 +10338,7 @@ "accessibility": "public", "parameters": [ { - "$id": "710", + "$id": "706", "kind": "header", "name": "p1", "serializedName": "p1", @@ -10388,7 +10354,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "711", + "$id": "707", "kind": "method", "name": "p1", "serializedName": "p1", @@ -10409,7 +10375,7 @@ "isExactName": false }, { - "$id": "712", + "$id": "708", "kind": "path", "name": "p2", "serializedName": "p2", @@ -10428,7 +10394,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$id": "713", + "$id": "709", "kind": "method", "name": "p2", "serializedName": "p2", @@ -10449,7 +10415,7 @@ "isExactName": false }, { - "$id": "714", + "$id": "710", "kind": "query", "name": "p3", "serializedName": "p3", @@ -10465,7 +10431,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "715", + "$id": "711", "kind": "method", "name": "p3", "serializedName": "p3", @@ -10486,7 +10452,7 @@ "isExactName": false }, { - "$id": "716", + "$id": "712", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10502,7 +10468,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "717", + "$id": "713", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10529,7 +10495,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10555,21 +10521,21 @@ }, "parameters": [ { - "$ref": "711" + "$ref": "707" }, { - "$ref": "713" + "$ref": "709" }, { - "$ref": "715" + "$ref": "711" }, { - "$ref": "717" + "$ref": "713" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -10578,7 +10544,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "718", + "$id": "714", "kind": "basic", "name": "topAction", "isExactName": false, @@ -10589,7 +10555,7 @@ ], "doc": "top level method", "operation": { - "$id": "719", + "$id": "715", "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10597,17 +10563,17 @@ "accessibility": "public", "parameters": [ { - "$id": "720", + "$id": "716", "kind": "path", "name": "action", "serializedName": "action", "type": { - "$id": "721", + "$id": "717", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "722", + "$id": "718", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10628,17 +10594,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "723", + "$id": "719", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$id": "724", + "$id": "720", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "725", + "$id": "721", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10661,7 +10627,7 @@ "isExactName": false }, { - "$id": "726", + "$id": "722", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10677,7 +10643,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "727", + "$id": "723", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10704,7 +10670,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10730,15 +10696,15 @@ }, "parameters": [ { - "$ref": "723" + "$ref": "719" }, { - "$ref": "727" + "$ref": "723" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -10747,7 +10713,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "728", + "$id": "724", "kind": "basic", "name": "topAction2", "isExactName": false, @@ -10758,7 +10724,7 @@ ], "doc": "top level method2", "operation": { - "$id": "729", + "$id": "725", "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10766,7 +10732,7 @@ "accessibility": "public", "parameters": [ { - "$id": "730", + "$id": "726", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10782,7 +10748,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "731", + "$id": "727", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10809,7 +10775,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -10835,12 +10801,12 @@ }, "parameters": [ { - "$ref": "731" + "$ref": "727" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -10849,7 +10815,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "732", + "$id": "728", "kind": "basic", "name": "patchAction", "isExactName": false, @@ -10860,7 +10826,7 @@ ], "doc": "top level patch", "operation": { - "$id": "733", + "$id": "729", "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10868,7 +10834,7 @@ "accessibility": "public", "parameters": [ { - "$id": "734", + "$id": "730", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10885,7 +10851,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "735", + "$id": "731", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10907,7 +10873,7 @@ "isExactName": false }, { - "$id": "736", + "$id": "732", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10923,7 +10889,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "737", + "$id": "733", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10944,12 +10910,12 @@ "isExactName": false }, { - "$id": "738", + "$id": "734", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -10963,12 +10929,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "739", + "$id": "735", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -10995,7 +10961,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -11024,18 +10990,18 @@ }, "parameters": [ { - "$ref": "739" + "$ref": "735" }, { - "$ref": "735" + "$ref": "731" }, { - "$ref": "737" + "$ref": "733" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -11044,7 +11010,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "740", + "$id": "736", "kind": "basic", "name": "anonymousBody", "isExactName": false, @@ -11055,7 +11021,7 @@ ], "doc": "body parameter without body decorator", "operation": { - "$id": "741", + "$id": "737", "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11063,7 +11029,7 @@ "accessibility": "public", "parameters": [ { - "$id": "742", + "$id": "738", "kind": "query", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11079,7 +11045,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "743", + "$id": "739", "kind": "method", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11100,7 +11066,7 @@ "isExactName": false }, { - "$id": "744", + "$id": "740", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", @@ -11116,7 +11082,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", "methodParameterSegments": [ { - "$id": "745", + "$id": "741", "kind": "method", "name": "requiredHeader", "serializedName": "required-header", @@ -11137,7 +11103,7 @@ "isExactName": false }, { - "$id": "746", + "$id": "742", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11154,7 +11120,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "747", + "$id": "743", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11176,7 +11142,7 @@ "isExactName": false }, { - "$id": "748", + "$id": "744", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11192,7 +11158,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "methodParameterSegments": [ { - "$id": "749", + "$id": "745", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11213,12 +11179,12 @@ "isExactName": false }, { - "$id": "750", + "$id": "746", "kind": "body", "name": "thing", "serializedName": "thing", "type": { - "$ref": "264" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -11232,13 +11198,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "751", + "$id": "747", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "752", + "$id": "748", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11269,7 +11235,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -11298,16 +11264,16 @@ }, "parameters": [ { - "$ref": "751" + "$ref": "747" }, { - "$id": "753", + "$id": "749", "kind": "method", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$ref": "268" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -11320,7 +11286,7 @@ "isExactName": false }, { - "$id": "754", + "$id": "750", "kind": "method", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", @@ -11339,13 +11305,13 @@ "isExactName": false }, { - "$id": "755", + "$id": "751", "kind": "method", "name": "requiredNullableString", "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$ref": "275" + "$ref": "271" }, "location": "Body", "isApiVersion": false, @@ -11358,13 +11324,13 @@ "isExactName": false }, { - "$id": "756", + "$id": "752", "kind": "method", "name": "optionalNullableString", "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$ref": "278" + "$ref": "274" }, "location": "Body", "isApiVersion": false, @@ -11377,7 +11343,7 @@ "isExactName": false }, { - "$id": "757", + "$id": "753", "kind": "method", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", @@ -11396,7 +11362,7 @@ "isExactName": false }, { - "$id": "758", + "$id": "754", "kind": "method", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", @@ -11415,7 +11381,7 @@ "isExactName": false }, { - "$id": "759", + "$id": "755", "kind": "method", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", @@ -11434,19 +11400,19 @@ "isExactName": false }, { - "$id": "760", + "$id": "756", "kind": "method", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "761", + "$id": "757", "kind": "enum", "name": "ThingOptionalLiteralString", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "762", + "$id": "758", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11454,12 +11420,12 @@ }, "values": [ { - "$id": "763", + "$id": "759", "kind": "enumvalue", "name": "reject", "value": "reject", "valueType": { - "$id": "764", + "$id": "760", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -11467,7 +11433,7 @@ "crossLanguageDefinitionId": "TypeSpec.string" }, "enumType": { - "$ref": "761" + "$ref": "757" }, "decorators": [], "isExactName": false @@ -11491,13 +11457,13 @@ "isExactName": false }, { - "$id": "765", + "$id": "761", "kind": "method", "name": "requiredNullableLiteralString", "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$ref": "285" + "$ref": "281" }, "location": "Body", "isApiVersion": false, @@ -11510,19 +11476,19 @@ "isExactName": false }, { - "$id": "766", + "$id": "762", "kind": "method", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "767", + "$id": "763", "kind": "enum", "name": "ThingOptionalLiteralInt", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "768", + "$id": "764", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -11530,12 +11496,12 @@ }, "values": [ { - "$id": "769", + "$id": "765", "kind": "enumvalue", "name": "456", "value": 456, "valueType": { - "$id": "770", + "$id": "766", "kind": "int32", "decorators": [], "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", @@ -11543,7 +11509,7 @@ "crossLanguageDefinitionId": "TypeSpec.int32" }, "enumType": { - "$ref": "767" + "$ref": "763" }, "decorators": [], "isExactName": false @@ -11567,19 +11533,19 @@ "isExactName": false }, { - "$id": "771", + "$id": "767", "kind": "method", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "772", + "$id": "768", "kind": "enum", "name": "ThingOptionalLiteralFloat", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "773", + "$id": "769", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -11587,12 +11553,12 @@ }, "values": [ { - "$id": "774", + "$id": "770", "kind": "enumvalue", "name": "4.56", "value": 4.56, "valueType": { - "$id": "775", + "$id": "771", "kind": "float32", "decorators": [], "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", @@ -11600,7 +11566,7 @@ "crossLanguageDefinitionId": "TypeSpec.float32" }, "enumType": { - "$ref": "772" + "$ref": "768" }, "decorators": [], "isExactName": false @@ -11624,7 +11590,7 @@ "isExactName": false }, { - "$id": "776", + "$id": "772", "kind": "method", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", @@ -11643,13 +11609,13 @@ "isExactName": false }, { - "$id": "777", + "$id": "773", "kind": "method", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "778", + "$id": "774", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11666,13 +11632,13 @@ "isExactName": false }, { - "$id": "779", + "$id": "775", "kind": "method", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$ref": "292" + "$ref": "288" }, "location": "Body", "isApiVersion": false, @@ -11685,13 +11651,13 @@ "isExactName": false }, { - "$id": "780", + "$id": "776", "kind": "method", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$ref": "296" + "$ref": "292" }, "location": "Body", "isApiVersion": false, @@ -11704,13 +11670,13 @@ "isExactName": false }, { - "$id": "781", + "$id": "777", "kind": "method", "name": "propertyWithSpecialDocs", "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "782", + "$id": "778", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11727,21 +11693,21 @@ "isExactName": false }, { - "$ref": "743" + "$ref": "739" }, { - "$ref": "745" + "$ref": "741" }, { - "$ref": "747" + "$ref": "743" }, { - "$ref": "749" + "$ref": "745" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -11750,7 +11716,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "783", + "$id": "779", "kind": "basic", "name": "friendlyModel", "isExactName": false, @@ -11761,7 +11727,7 @@ ], "doc": "Model can have its friendly name", "operation": { - "$id": "784", + "$id": "780", "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11769,7 +11735,7 @@ "accessibility": "public", "parameters": [ { - "$id": "785", + "$id": "781", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11786,7 +11752,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "786", + "$id": "782", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11808,7 +11774,7 @@ "isExactName": false }, { - "$id": "787", + "$id": "783", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11824,7 +11790,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "788", + "$id": "784", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11845,12 +11811,12 @@ "isExactName": false }, { - "$id": "789", + "$id": "785", "kind": "body", "name": "friend", "serializedName": "friend", "type": { - "$ref": "353" + "$ref": "349" }, "isApiVersion": false, "contentTypes": [ @@ -11864,13 +11830,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", "methodParameterSegments": [ { - "$id": "790", + "$id": "786", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "791", + "$id": "787", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11901,7 +11867,7 @@ 200 ], "bodyType": { - "$ref": "353" + "$ref": "349" }, "headers": [], "isErrorResponse": false, @@ -11930,18 +11896,18 @@ }, "parameters": [ { - "$ref": "790" + "$ref": "786" }, { - "$ref": "786" + "$ref": "782" }, { - "$ref": "788" + "$ref": "784" } ], "response": { "type": { - "$ref": "353" + "$ref": "349" } }, "isOverride": false, @@ -11950,7 +11916,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "792", + "$id": "788", "kind": "basic", "name": "addTimeHeader", "isExactName": false, @@ -11960,24 +11926,24 @@ "2024-08-16-preview" ], "operation": { - "$id": "793", + "$id": "789", "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "794", + "$id": "790", "kind": "header", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "795", + "$id": "791", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "796", + "$id": "792", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11995,17 +11961,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "797", + "$id": "793", "kind": "method", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "798", + "$id": "794", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "799", + "$id": "795", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12050,7 +12016,7 @@ }, "parameters": [ { - "$ref": "797" + "$ref": "793" } ], "response": {}, @@ -12060,7 +12026,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "800", + "$id": "796", "kind": "basic", "name": "projectedNameModel", "isExactName": false, @@ -12071,7 +12037,7 @@ ], "doc": "Model can have its projected name", "operation": { - "$id": "801", + "$id": "797", "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12079,7 +12045,7 @@ "accessibility": "public", "parameters": [ { - "$id": "802", + "$id": "798", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12096,7 +12062,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "803", + "$id": "799", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12118,7 +12084,7 @@ "isExactName": false }, { - "$id": "804", + "$id": "800", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12134,7 +12100,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "805", + "$id": "801", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12155,12 +12121,12 @@ "isExactName": false }, { - "$id": "806", + "$id": "802", "kind": "body", "name": "renamedModel", "serializedName": "renamedModel", "type": { - "$ref": "356" + "$ref": "352" }, "isApiVersion": false, "contentTypes": [ @@ -12174,13 +12140,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "807", + "$id": "803", "kind": "method", "name": "otherName", "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "808", + "$id": "804", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12211,7 +12177,7 @@ 200 ], "bodyType": { - "$ref": "356" + "$ref": "352" }, "headers": [], "isErrorResponse": false, @@ -12240,18 +12206,18 @@ }, "parameters": [ { - "$ref": "807" + "$ref": "803" }, { - "$ref": "803" + "$ref": "799" }, { - "$ref": "805" + "$ref": "801" } ], "response": { "type": { - "$ref": "356" + "$ref": "352" } }, "isOverride": false, @@ -12260,7 +12226,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "809", + "$id": "805", "kind": "basic", "name": "returnsAnonymousModel", "isExactName": false, @@ -12271,7 +12237,7 @@ ], "doc": "return anonymous model", "operation": { - "$id": "810", + "$id": "806", "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12279,7 +12245,7 @@ "accessibility": "public", "parameters": [ { - "$id": "811", + "$id": "807", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12295,7 +12261,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "812", + "$id": "808", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12322,7 +12288,7 @@ 200 ], "bodyType": { - "$ref": "359" + "$ref": "355" }, "headers": [], "isErrorResponse": false, @@ -12348,12 +12314,12 @@ }, "parameters": [ { - "$ref": "812" + "$ref": "808" } ], "response": { "type": { - "$ref": "359" + "$ref": "355" } }, "isOverride": false, @@ -12362,7 +12328,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$id": "813", + "$id": "809", "kind": "basic", "name": "getUnknownValue", "isExactName": false, @@ -12373,7 +12339,7 @@ ], "doc": "get extensible enum", "operation": { - "$id": "814", + "$id": "810", "name": "getUnknownValue", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12381,7 +12347,7 @@ "accessibility": "public", "parameters": [ { - "$id": "815", + "$id": "811", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12397,7 +12363,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "816", + "$id": "812", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12446,7 +12412,7 @@ }, "parameters": [ { - "$ref": "816" + "$ref": "812" } ], "response": { @@ -12460,7 +12426,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "817", + "$id": "813", "kind": "basic", "name": "internalProtocol", "isExactName": false, @@ -12471,7 +12437,7 @@ ], "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "818", + "$id": "814", "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12479,7 +12445,7 @@ "accessibility": "public", "parameters": [ { - "$id": "819", + "$id": "815", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12496,7 +12462,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "820", + "$id": "816", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12518,7 +12484,7 @@ "isExactName": false }, { - "$id": "821", + "$id": "817", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12534,7 +12500,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "822", + "$id": "818", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12555,12 +12521,12 @@ "isExactName": false }, { - "$id": "823", + "$id": "819", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "isApiVersion": false, "contentTypes": [ @@ -12574,12 +12540,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "824", + "$id": "820", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "264" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -12606,7 +12572,7 @@ 200 ], "bodyType": { - "$ref": "264" + "$ref": "260" }, "headers": [], "isErrorResponse": false, @@ -12635,18 +12601,18 @@ }, "parameters": [ { - "$ref": "824" + "$ref": "820" }, { - "$ref": "820" + "$ref": "816" }, { - "$ref": "822" + "$ref": "818" } ], "response": { "type": { - "$ref": "264" + "$ref": "260" } }, "isOverride": false, @@ -12655,7 +12621,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" }, { - "$id": "825", + "$id": "821", "kind": "basic", "name": "stillConvenient", "isExactName": false, @@ -12666,7 +12632,7 @@ ], "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "operation": { - "$id": "826", + "$id": "822", "name": "stillConvenient", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12701,7 +12667,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" }, { - "$id": "827", + "$id": "823", "kind": "basic", "name": "headAsBoolean", "isExactName": false, @@ -12712,7 +12678,7 @@ ], "doc": "head as boolean.", "operation": { - "$id": "828", + "$id": "824", "name": "headAsBoolean", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12720,12 +12686,12 @@ "accessibility": "public", "parameters": [ { - "$id": "829", + "$id": "825", "kind": "path", "name": "id", "serializedName": "id", "type": { - "$id": "830", + "$id": "826", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12743,12 +12709,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "831", + "$id": "827", "kind": "method", "name": "id", "serializedName": "id", "type": { - "$id": "832", + "$id": "828", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12790,7 +12756,7 @@ }, "parameters": [ { - "$ref": "831" + "$ref": "827" } ], "response": {}, @@ -12800,7 +12766,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "833", + "$id": "829", "kind": "basic", "name": "WithApiVersion", "isExactName": false, @@ -12811,7 +12777,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "834", + "$id": "830", "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12819,12 +12785,12 @@ "accessibility": "public", "parameters": [ { - "$id": "835", + "$id": "831", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "836", + "$id": "832", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12839,12 +12805,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "837", + "$id": "833", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "838", + "$id": "834", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12864,12 +12830,12 @@ "isExactName": false }, { - "$id": "839", + "$id": "835", "kind": "query", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "840", + "$id": "836", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12879,7 +12845,7 @@ "explode": false, "defaultValue": { "type": { - "$id": "841", + "$id": "837", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12893,12 +12859,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "842", + "$id": "838", "kind": "method", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "843", + "$id": "839", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12908,7 +12874,7 @@ "isApiVersion": true, "defaultValue": { "type": { - "$id": "844", + "$id": "840", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12949,7 +12915,7 @@ }, "parameters": [ { - "$ref": "837" + "$ref": "833" } ], "response": {}, @@ -12959,7 +12925,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" }, { - "$id": "845", + "$id": "841", "kind": "paging", "name": "ListWithNextLink", "isExactName": false, @@ -12970,7 +12936,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "846", + "$id": "842", "name": "ListWithNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12978,7 +12944,7 @@ "accessibility": "public", "parameters": [ { - "$id": "847", + "$id": "843", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12994,7 +12960,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "848", + "$id": "844", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13021,7 +12987,7 @@ 200 ], "bodyType": { - "$ref": "360" + "$ref": "356" }, "headers": [], "isErrorResponse": false, @@ -13047,12 +13013,12 @@ }, "parameters": [ { - "$ref": "848" + "$ref": "844" } ], "response": { "type": { - "$ref": "362" + "$ref": "358" }, "resultSegments": [ "things" @@ -13076,7 +13042,7 @@ } }, { - "$id": "849", + "$id": "845", "kind": "paging", "name": "ListWithStringNextLink", "isExactName": false, @@ -13087,7 +13053,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "850", + "$id": "846", "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13095,7 +13061,7 @@ "accessibility": "public", "parameters": [ { - "$id": "851", + "$id": "847", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13111,7 +13077,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "852", + "$id": "848", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13138,7 +13104,7 @@ 200 ], "bodyType": { - "$ref": "365" + "$ref": "361" }, "headers": [], "isErrorResponse": false, @@ -13164,12 +13130,12 @@ }, "parameters": [ { - "$ref": "852" + "$ref": "848" } ], "response": { "type": { - "$ref": "362" + "$ref": "358" }, "resultSegments": [ "things" @@ -13193,7 +13159,7 @@ } }, { - "$id": "853", + "$id": "849", "kind": "paging", "name": "ListWithContinuationToken", "isExactName": false, @@ -13204,7 +13170,7 @@ ], "doc": "List things with continuation token", "operation": { - "$id": "854", + "$id": "850", "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13212,12 +13178,12 @@ "accessibility": "public", "parameters": [ { - "$id": "855", + "$id": "851", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "856", + "$id": "852", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13232,12 +13198,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "857", + "$id": "853", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "858", + "$id": "854", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13257,7 +13223,7 @@ "isExactName": false }, { - "$id": "859", + "$id": "855", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13273,7 +13239,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "860", + "$id": "856", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13300,7 +13266,7 @@ 200 ], "bodyType": { - "$ref": "369" + "$ref": "365" }, "headers": [], "isErrorResponse": false, @@ -13326,15 +13292,15 @@ }, "parameters": [ { - "$ref": "857" + "$ref": "853" }, { - "$ref": "860" + "$ref": "856" } ], "response": { "type": { - "$ref": "362" + "$ref": "358" }, "resultSegments": [ "things" @@ -13350,7 +13316,7 @@ ], "continuationToken": { "parameter": { - "$ref": "855" + "$ref": "851" }, "responseSegments": [ "nextToken" @@ -13361,7 +13327,7 @@ } }, { - "$id": "861", + "$id": "857", "kind": "paging", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, @@ -13372,7 +13338,7 @@ ], "doc": "List things with continuation token header response", "operation": { - "$id": "862", + "$id": "858", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13380,12 +13346,12 @@ "accessibility": "public", "parameters": [ { - "$id": "863", + "$id": "859", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "864", + "$id": "860", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13400,12 +13366,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "865", + "$id": "861", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "866", + "$id": "862", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13425,7 +13391,7 @@ "isExactName": false }, { - "$id": "867", + "$id": "863", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13441,7 +13407,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "868", + "$id": "864", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13468,14 +13434,14 @@ 200 ], "bodyType": { - "$ref": "373" + "$ref": "369" }, "headers": [ { "name": "nextToken", "nameInResponse": "next-token", "type": { - "$id": "869", + "$id": "865", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13506,15 +13472,15 @@ }, "parameters": [ { - "$ref": "865" + "$ref": "861" }, { - "$ref": "868" + "$ref": "864" } ], "response": { "type": { - "$ref": "362" + "$ref": "358" }, "resultSegments": [ "things" @@ -13530,7 +13496,7 @@ ], "continuationToken": { "parameter": { - "$ref": "863" + "$ref": "859" }, "responseSegments": [ "next-token" @@ -13541,7 +13507,7 @@ } }, { - "$id": "870", + "$id": "866", "kind": "paging", "name": "ListWithPaging", "isExactName": false, @@ -13552,7 +13518,7 @@ ], "doc": "List things with paging", "operation": { - "$id": "871", + "$id": "867", "name": "ListWithPaging", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13560,7 +13526,7 @@ "accessibility": "public", "parameters": [ { - "$id": "872", + "$id": "868", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13576,7 +13542,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "873", + "$id": "869", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13603,7 +13569,7 @@ 200 ], "bodyType": { - "$ref": "375" + "$ref": "371" }, "headers": [], "isErrorResponse": false, @@ -13629,12 +13595,12 @@ }, "parameters": [ { - "$ref": "873" + "$ref": "869" } ], "response": { "type": { - "$ref": "362" + "$ref": "358" }, "resultSegments": [ "items" @@ -13652,7 +13618,7 @@ } }, { - "$id": "874", + "$id": "870", "kind": "basic", "name": "EmbeddedParameters", "isExactName": false, @@ -13663,7 +13629,7 @@ ], "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "875", + "$id": "871", "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13671,13 +13637,13 @@ "accessibility": "public", "parameters": [ { - "$id": "876", + "$id": "872", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", "doc": "required header parameter", "type": { - "$id": "877", + "$id": "873", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13692,12 +13658,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "878", + "$id": "874", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "377" + "$ref": "373" }, "location": "Body", "isApiVersion": false, @@ -13710,13 +13676,13 @@ "isExactName": false }, { - "$id": "879", + "$id": "875", "kind": "method", "name": "requiredHeader", "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$ref": "381" + "$ref": "377" }, "location": "", "isApiVersion": false, @@ -13732,13 +13698,13 @@ "isExactName": false }, { - "$id": "880", + "$id": "876", "kind": "header", "name": "optionalHeader", "serializedName": "optional-header", "doc": "optional header parameter", "type": { - "$id": "881", + "$id": "877", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13753,16 +13719,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$ref": "878" + "$ref": "874" }, { - "$id": "882", + "$id": "878", "kind": "method", "name": "optionalHeader", "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$ref": "383" + "$ref": "379" }, "location": "", "isApiVersion": false, @@ -13778,13 +13744,13 @@ "isExactName": false }, { - "$id": "883", + "$id": "879", "kind": "query", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "884", + "$id": "880", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13799,16 +13765,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "878" + "$ref": "874" }, { - "$id": "885", + "$id": "881", "kind": "method", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$ref": "385" + "$ref": "381" }, "location": "", "isApiVersion": false, @@ -13824,13 +13790,13 @@ "isExactName": false }, { - "$id": "886", + "$id": "882", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "887", + "$id": "883", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13845,16 +13811,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "878" + "$ref": "874" }, { - "$id": "888", + "$id": "884", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$ref": "387" + "$ref": "383" }, "location": "", "isApiVersion": false, @@ -13870,7 +13836,7 @@ "isExactName": false }, { - "$id": "889", + "$id": "885", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13887,7 +13853,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "890", + "$id": "886", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13909,12 +13875,12 @@ "isExactName": false }, { - "$id": "891", + "$id": "887", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "377" + "$ref": "373" }, "isApiVersion": false, "contentTypes": [ @@ -13928,7 +13894,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "methodParameterSegments": [ { - "$ref": "878" + "$ref": "874" } ], "isExactName": false, @@ -13964,10 +13930,10 @@ }, "parameters": [ { - "$ref": "878" + "$ref": "874" }, { - "$ref": "890" + "$ref": "886" } ], "response": {}, @@ -13977,7 +13943,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "892", + "$id": "888", "kind": "basic", "name": "DynamicModelOperation", "isExactName": false, @@ -13988,7 +13954,7 @@ ], "doc": "An operation with a dynamic model", "operation": { - "$id": "893", + "$id": "889", "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13996,7 +13962,7 @@ "accessibility": "public", "parameters": [ { - "$id": "894", + "$id": "890", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14013,7 +13979,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "895", + "$id": "891", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14035,12 +14001,12 @@ "isExactName": false }, { - "$id": "896", + "$id": "892", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "388" + "$ref": "384" }, "isApiVersion": false, "contentTypes": [ @@ -14054,12 +14020,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "897", + "$id": "893", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "388" + "$ref": "384" }, "location": "Body", "isApiVersion": false, @@ -14105,10 +14071,10 @@ }, "parameters": [ { - "$ref": "897" + "$ref": "893" }, { - "$ref": "895" + "$ref": "891" } ], "response": {}, @@ -14118,7 +14084,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "898", + "$id": "894", "kind": "basic", "name": "GetXmlAdvancedModel", "isExactName": false, @@ -14129,7 +14095,7 @@ ], "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "899", + "$id": "895", "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14137,7 +14103,7 @@ "accessibility": "public", "parameters": [ { - "$id": "900", + "$id": "896", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14153,7 +14119,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "901", + "$id": "897", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14180,7 +14146,7 @@ 200 ], "bodyType": { - "$ref": "426" + "$ref": "422" }, "headers": [ { @@ -14214,12 +14180,12 @@ }, "parameters": [ { - "$ref": "901" + "$ref": "897" } ], "response": { "type": { - "$ref": "426" + "$ref": "422" } }, "isOverride": false, @@ -14228,7 +14194,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "902", + "$id": "898", "kind": "basic", "name": "UpdateXmlAdvancedModel", "isExactName": false, @@ -14239,7 +14205,7 @@ ], "doc": "Update an advanced XML model with various property types", "operation": { - "$id": "903", + "$id": "899", "name": "UpdateXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14247,7 +14213,7 @@ "accessibility": "public", "parameters": [ { - "$id": "904", + "$id": "900", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14263,7 +14229,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "905", + "$id": "901", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14284,7 +14250,7 @@ "isExactName": false }, { - "$id": "906", + "$id": "902", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14300,7 +14266,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "907", + "$id": "903", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14321,12 +14287,12 @@ "isExactName": false }, { - "$id": "908", + "$id": "904", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "426" + "$ref": "422" }, "isApiVersion": false, "contentTypes": [ @@ -14340,12 +14306,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "909", + "$id": "905", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "426" + "$ref": "422" }, "location": "Body", "isApiVersion": false, @@ -14372,7 +14338,7 @@ 200 ], "bodyType": { - "$ref": "426" + "$ref": "422" }, "headers": [ { @@ -14409,18 +14375,18 @@ }, "parameters": [ { - "$ref": "909" + "$ref": "905" }, { - "$ref": "905" + "$ref": "901" }, { - "$ref": "907" + "$ref": "903" } ], "response": { "type": { - "$ref": "426" + "$ref": "422" } }, "isOverride": false, @@ -14429,7 +14395,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, { - "$id": "910", + "$id": "906", "kind": "basic", "name": "uploadCat", "isExactName": false, @@ -14439,14 +14405,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "911", + "$id": "907", "name": "uploadCat", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "912", + "$id": "908", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14462,7 +14428,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "methodParameterSegments": [ { - "$id": "913", + "$id": "909", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14483,12 +14449,12 @@ "isExactName": false }, { - "$id": "914", + "$id": "910", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "522" + "$ref": "518" }, "isApiVersion": false, "contentTypes": [ @@ -14502,12 +14468,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "methodParameterSegments": [ { - "$id": "915", + "$id": "911", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "522" + "$ref": "518" }, "location": "Body", "isApiVersion": false, @@ -14549,10 +14515,10 @@ }, "parameters": [ { - "$ref": "913" + "$ref": "909" }, { - "$ref": "915" + "$ref": "911" } ], "response": {}, @@ -14562,7 +14528,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" }, { - "$id": "916", + "$id": "912", "kind": "basic", "name": "sendJsonLines", "isExactName": false, @@ -14572,14 +14538,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "917", + "$id": "913", "name": "sendJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "918", + "$id": "914", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14595,16 +14561,16 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "methodParameterSegments": [ { - "$id": "919", + "$id": "915", "kind": "method", "name": "stream", "serializedName": "stream", "type": { - "$id": "920", + "$id": "916", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "567" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14623,7 +14589,7 @@ "isExactName": false }, { - "$id": "921", + "$id": "917", "kind": "method", "name": "contentType", "serializedName": "contentType", @@ -14644,16 +14610,16 @@ "isExactName": false }, { - "$id": "922", + "$id": "918", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$id": "923", + "$id": "919", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "567" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14673,15 +14639,15 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "methodParameterSegments": [ { - "$ref": "919" + "$ref": "915" }, { - "$id": "924", + "$id": "920", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "647" + "$ref": "643" }, "location": "", "isApiVersion": false, @@ -14727,7 +14693,7 @@ }, "parameters": [ { - "$ref": "919" + "$ref": "915" } ], "response": {}, @@ -14737,7 +14703,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "925", + "$id": "921", "kind": "basic", "name": "receiveJsonLines", "isExactName": false, @@ -14747,14 +14713,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "926", + "$id": "922", "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "927", + "$id": "923", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14770,7 +14736,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "928", + "$id": "924", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14797,11 +14763,11 @@ 200 ], "bodyType": { - "$id": "929", + "$id": "925", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "567" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14841,16 +14807,16 @@ }, "parameters": [ { - "$ref": "928" + "$ref": "924" } ], "response": { "type": { - "$id": "930", + "$id": "926", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "567" + "$ref": "563" }, "streamKind": "jsonl", "contentTypes": [ @@ -14865,7 +14831,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "931", + "$id": "927", "kind": "basic", "name": "receiveSse", "isExactName": false, @@ -14875,14 +14841,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "932", + "$id": "928", "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "933", + "$id": "929", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14898,7 +14864,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "934", + "$id": "930", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14925,16 +14891,16 @@ 200 ], "bodyType": { - "$id": "935", + "$id": "931", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$id": "936", + "$id": "932", "kind": "union", "name": "SampleEvents", "variantTypes": [ { - "$ref": "567" + "$ref": "563" }, { "$ref": "204" @@ -14979,16 +14945,16 @@ }, "parameters": [ { - "$ref": "934" + "$ref": "930" } ], "response": { "type": { - "$id": "937", + "$id": "933", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$ref": "936" + "$ref": "932" }, "streamKind": "sse", "contentTypes": [ @@ -15004,7 +14970,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" }, { - "$id": "938", + "$id": "934", "kind": "basic", "name": "getJsonInt32", "isExactName": false, @@ -15015,7 +14981,7 @@ ], "doc": "get JSON int32", "operation": { - "$id": "939", + "$id": "935", "name": "getJsonInt32", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -15023,7 +14989,7 @@ "accessibility": "public", "parameters": [ { - "$id": "940", + "$id": "936", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -15039,7 +15005,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", "methodParameterSegments": [ { - "$id": "941", + "$id": "937", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -15066,7 +15032,7 @@ 200 ], "bodyType": { - "$id": "942", + "$id": "938", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -15104,142 +15070,28 @@ }, "parameters": [ { - "$ref": "941" + "$ref": "937" } ], "response": { "type": { - "$ref": "942" + "$ref": "938" } }, "isOverride": false, "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32" - }, - { - "$id": "943", - "kind": "basic", - "name": "getJsonUint8", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "get JSON uint8", - "operation": { - "$id": "944", - "name": "getJsonUint8", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "get JSON uint8", - "accessibility": "public", - "parameters": [ - { - "$id": "945", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "212" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8.accept", - "methodParameterSegments": [ - { - "$id": "946", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "212" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "947", - "kind": "uint8", - "name": "uint8", - "crossLanguageDefinitionId": "TypeSpec.uint8", - "decorators": [] - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "214" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/json-uint8", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "946" - } - ], - "response": { - "type": { - "$ref": "947" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonUint8" } ], "parameters": [ { - "$id": "948", + "$id": "939", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "949", + "$id": "940", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15255,7 +15107,7 @@ "isExactName": false }, { - "$ref": "842" + "$ref": "838" } ], "initializedBy": 1, @@ -15267,14 +15119,14 @@ ], "children": [ { - "$id": "950", + "$id": "941", "kind": "client", "name": "AnimalOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "951", + "$id": "942", "kind": "basic", "name": "updatePetAsAnimal", "isExactName": false, @@ -15285,7 +15137,7 @@ ], "doc": "Update a pet as an animal", "operation": { - "$id": "952", + "$id": "943", "name": "updatePetAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15293,13 +15145,13 @@ "accessibility": "public", "parameters": [ { - "$id": "953", + "$id": "944", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "212" }, "isApiVersion": false, "optional": false, @@ -15310,13 +15162,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "954", + "$id": "945", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "212" }, "location": "Header", "isApiVersion": false, @@ -15332,12 +15184,12 @@ "isExactName": false }, { - "$id": "955", + "$id": "946", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "214" }, "isApiVersion": false, "optional": false, @@ -15348,12 +15200,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "956", + "$id": "947", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "214" }, "location": "Header", "isApiVersion": false, @@ -15369,12 +15221,12 @@ "isExactName": false }, { - "$id": "957", + "$id": "948", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "570" + "$ref": "566" }, "isApiVersion": false, "contentTypes": [ @@ -15388,12 +15240,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", "methodParameterSegments": [ { - "$id": "958", + "$id": "949", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "570" + "$ref": "566" }, "location": "Body", "isApiVersion": false, @@ -15420,7 +15272,7 @@ 200 ], "bodyType": { - "$ref": "570" + "$ref": "566" }, "headers": [], "isErrorResponse": false, @@ -15449,18 +15301,18 @@ }, "parameters": [ { - "$ref": "958" + "$ref": "949" }, { - "$ref": "954" + "$ref": "945" }, { - "$ref": "956" + "$ref": "947" } ], "response": { "type": { - "$ref": "570" + "$ref": "566" } }, "isOverride": false, @@ -15469,7 +15321,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "959", + "$id": "950", "kind": "basic", "name": "updateDogAsAnimal", "isExactName": false, @@ -15480,7 +15332,7 @@ ], "doc": "Update a dog as an animal", "operation": { - "$id": "960", + "$id": "951", "name": "updateDogAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15488,13 +15340,13 @@ "accessibility": "public", "parameters": [ { - "$id": "961", + "$id": "952", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -15505,13 +15357,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "962", + "$id": "953", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "216" }, "location": "Header", "isApiVersion": false, @@ -15527,12 +15379,12 @@ "isExactName": false }, { - "$id": "963", + "$id": "954", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "218" }, "isApiVersion": false, "optional": false, @@ -15543,12 +15395,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "964", + "$id": "955", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "218" }, "location": "Header", "isApiVersion": false, @@ -15564,12 +15416,12 @@ "isExactName": false }, { - "$id": "965", + "$id": "956", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "570" + "$ref": "566" }, "isApiVersion": false, "contentTypes": [ @@ -15583,12 +15435,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", "methodParameterSegments": [ { - "$id": "966", + "$id": "957", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "570" + "$ref": "566" }, "location": "Body", "isApiVersion": false, @@ -15615,7 +15467,7 @@ 200 ], "bodyType": { - "$ref": "570" + "$ref": "566" }, "headers": [], "isErrorResponse": false, @@ -15644,18 +15496,18 @@ }, "parameters": [ { - "$ref": "966" + "$ref": "957" }, { - "$ref": "962" + "$ref": "953" }, { - "$ref": "964" + "$ref": "955" } ], "response": { "type": { - "$ref": "570" + "$ref": "566" } }, "isOverride": false, @@ -15666,12 +15518,12 @@ ], "parameters": [ { - "$id": "967", + "$id": "958", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "968", + "$id": "959", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15695,19 +15547,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "969", + "$id": "960", "kind": "client", "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "970", + "$id": "961", "kind": "basic", "name": "updatePetAsPet", "isExactName": false, @@ -15718,7 +15570,7 @@ ], "doc": "Update a pet as a pet", "operation": { - "$id": "971", + "$id": "962", "name": "updatePetAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15726,13 +15578,13 @@ "accessibility": "public", "parameters": [ { - "$id": "972", + "$id": "963", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "220" }, "isApiVersion": false, "optional": false, @@ -15743,13 +15595,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", "methodParameterSegments": [ { - "$id": "973", + "$id": "964", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "220" }, "location": "Header", "isApiVersion": false, @@ -15765,12 +15617,12 @@ "isExactName": false }, { - "$id": "974", + "$id": "965", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "222" }, "isApiVersion": false, "optional": false, @@ -15781,12 +15633,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "975", + "$id": "966", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "222" }, "location": "Header", "isApiVersion": false, @@ -15802,12 +15654,12 @@ "isExactName": false }, { - "$id": "976", + "$id": "967", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "575" + "$ref": "571" }, "isApiVersion": false, "contentTypes": [ @@ -15821,12 +15673,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "977", + "$id": "968", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "575" + "$ref": "571" }, "location": "Body", "isApiVersion": false, @@ -15853,7 +15705,7 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "571" }, "headers": [], "isErrorResponse": false, @@ -15882,18 +15734,18 @@ }, "parameters": [ { - "$ref": "977" + "$ref": "968" }, { - "$ref": "973" + "$ref": "964" }, { - "$ref": "975" + "$ref": "966" } ], "response": { "type": { - "$ref": "575" + "$ref": "571" } }, "isOverride": false, @@ -15902,7 +15754,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "978", + "$id": "969", "kind": "basic", "name": "updateDogAsPet", "isExactName": false, @@ -15913,7 +15765,7 @@ ], "doc": "Update a dog as a pet", "operation": { - "$id": "979", + "$id": "970", "name": "updateDogAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15921,13 +15773,13 @@ "accessibility": "public", "parameters": [ { - "$id": "980", + "$id": "971", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "224" }, "isApiVersion": false, "optional": false, @@ -15938,13 +15790,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "981", + "$id": "972", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "224" }, "location": "Header", "isApiVersion": false, @@ -15960,12 +15812,12 @@ "isExactName": false }, { - "$id": "982", + "$id": "973", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "226" }, "isApiVersion": false, "optional": false, @@ -15976,12 +15828,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "methodParameterSegments": [ { - "$id": "983", + "$id": "974", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "226" }, "location": "Header", "isApiVersion": false, @@ -15997,12 +15849,12 @@ "isExactName": false }, { - "$id": "984", + "$id": "975", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "575" + "$ref": "571" }, "isApiVersion": false, "contentTypes": [ @@ -16016,12 +15868,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "985", + "$id": "976", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "575" + "$ref": "571" }, "location": "Body", "isApiVersion": false, @@ -16048,7 +15900,7 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "571" }, "headers": [], "isErrorResponse": false, @@ -16077,18 +15929,18 @@ }, "parameters": [ { - "$ref": "985" + "$ref": "976" }, { - "$ref": "981" + "$ref": "972" }, { - "$ref": "983" + "$ref": "974" } ], "response": { "type": { - "$ref": "575" + "$ref": "571" } }, "isOverride": false, @@ -16099,12 +15951,12 @@ ], "parameters": [ { - "$id": "986", + "$id": "977", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "987", + "$id": "978", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16128,19 +15980,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "988", + "$id": "979", "kind": "client", "name": "DogOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "989", + "$id": "980", "kind": "basic", "name": "updateDogAsDog", "isExactName": false, @@ -16151,7 +16003,7 @@ ], "doc": "Update a dog as a dog", "operation": { - "$id": "990", + "$id": "981", "name": "updateDogAsDog", "isExactName": false, "resourceName": "DogOperations", @@ -16159,13 +16011,13 @@ "accessibility": "public", "parameters": [ { - "$id": "991", + "$id": "982", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "232" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -16176,13 +16028,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "992", + "$id": "983", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "232" + "$ref": "228" }, "location": "Header", "isApiVersion": false, @@ -16198,12 +16050,12 @@ "isExactName": false }, { - "$id": "993", + "$id": "984", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "234" + "$ref": "230" }, "isApiVersion": false, "optional": false, @@ -16214,12 +16066,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "994", + "$id": "985", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "234" + "$ref": "230" }, "location": "Header", "isApiVersion": false, @@ -16235,12 +16087,12 @@ "isExactName": false }, { - "$id": "995", + "$id": "986", "kind": "body", "name": "dog", "serializedName": "dog", "type": { - "$ref": "579" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -16254,12 +16106,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", "methodParameterSegments": [ { - "$id": "996", + "$id": "987", "kind": "method", "name": "dog", "serializedName": "dog", "type": { - "$ref": "579" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -16286,7 +16138,7 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -16315,18 +16167,18 @@ }, "parameters": [ { - "$ref": "996" + "$ref": "987" }, { - "$ref": "992" + "$ref": "983" }, { - "$ref": "994" + "$ref": "985" } ], "response": { "type": { - "$ref": "579" + "$ref": "575" } }, "isOverride": false, @@ -16337,12 +16189,12 @@ ], "parameters": [ { - "$id": "997", + "$id": "988", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "998", + "$id": "989", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16366,19 +16218,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "999", + "$id": "990", "kind": "client", "name": "PlantOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1000", + "$id": "991", "kind": "basic", "name": "getTree", "isExactName": false, @@ -16389,7 +16241,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "1001", + "$id": "992", "name": "getTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16397,12 +16249,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1002", + "$id": "993", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "232" }, "isApiVersion": false, "optional": false, @@ -16413,12 +16265,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "1003", + "$id": "994", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "232" }, "location": "Header", "isApiVersion": false, @@ -16440,14 +16292,14 @@ 200 ], "bodyType": { - "$ref": "583" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "238" + "$ref": "234" } } ], @@ -16474,12 +16326,12 @@ }, "parameters": [ { - "$ref": "1003" + "$ref": "994" } ], "response": { "type": { - "$ref": "583" + "$ref": "579" } }, "isOverride": false, @@ -16488,7 +16340,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "1004", + "$id": "995", "kind": "basic", "name": "getTreeAsJson", "isExactName": false, @@ -16499,7 +16351,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "1005", + "$id": "996", "name": "getTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16507,12 +16359,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1006", + "$id": "997", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "236" }, "isApiVersion": false, "optional": false, @@ -16523,12 +16375,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1007", + "$id": "998", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "236" }, "location": "Header", "isApiVersion": false, @@ -16550,14 +16402,14 @@ 200 ], "bodyType": { - "$ref": "583" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "242" + "$ref": "238" } } ], @@ -16584,12 +16436,12 @@ }, "parameters": [ { - "$ref": "1007" + "$ref": "998" } ], "response": { "type": { - "$ref": "583" + "$ref": "579" } }, "isOverride": false, @@ -16598,7 +16450,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" }, { - "$id": "1008", + "$id": "999", "kind": "basic", "name": "updateTree", "isExactName": false, @@ -16609,7 +16461,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1009", + "$id": "1000", "name": "updateTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16617,12 +16469,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1010", + "$id": "1001", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "240" }, "isApiVersion": false, "optional": false, @@ -16633,12 +16485,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "1011", + "$id": "1002", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "240" }, "location": "Header", "isApiVersion": false, @@ -16654,12 +16506,12 @@ "isExactName": false }, { - "$id": "1012", + "$id": "1003", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -16670,12 +16522,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "methodParameterSegments": [ { - "$id": "1013", + "$id": "1004", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "244" }, "location": "Header", "isApiVersion": false, @@ -16691,12 +16543,12 @@ "isExactName": false }, { - "$id": "1014", + "$id": "1005", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "583" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -16710,12 +16562,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "1015", + "$id": "1006", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "583" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -16742,14 +16594,14 @@ 200 ], "bodyType": { - "$ref": "583" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "250" + "$ref": "246" } } ], @@ -16779,18 +16631,18 @@ }, "parameters": [ { - "$ref": "1015" + "$ref": "1006" }, { - "$ref": "1011" + "$ref": "1002" }, { - "$ref": "1013" + "$ref": "1004" } ], "response": { "type": { - "$ref": "583" + "$ref": "579" } }, "isOverride": false, @@ -16799,7 +16651,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "1016", + "$id": "1007", "kind": "basic", "name": "updateTreeAsJson", "isExactName": false, @@ -16810,7 +16662,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1017", + "$id": "1008", "name": "updateTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16818,12 +16670,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1018", + "$id": "1009", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "252" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -16834,12 +16686,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1019", + "$id": "1010", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "252" + "$ref": "248" }, "location": "Header", "isApiVersion": false, @@ -16855,12 +16707,12 @@ "isExactName": false }, { - "$id": "1020", + "$id": "1011", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -16871,12 +16723,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1021", + "$id": "1012", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "252" }, "location": "Header", "isApiVersion": false, @@ -16892,12 +16744,12 @@ "isExactName": false }, { - "$id": "1022", + "$id": "1013", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "583" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -16911,12 +16763,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1023", + "$id": "1014", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "583" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -16943,14 +16795,14 @@ 200 ], "bodyType": { - "$ref": "583" + "$ref": "579" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "258" + "$ref": "254" } } ], @@ -16980,18 +16832,18 @@ }, "parameters": [ { - "$ref": "1023" + "$ref": "1014" }, { - "$ref": "1019" + "$ref": "1010" }, { - "$ref": "1021" + "$ref": "1012" } ], "response": { "type": { - "$ref": "583" + "$ref": "579" } }, "isOverride": false, @@ -17002,12 +16854,12 @@ ], "parameters": [ { - "$id": "1024", + "$id": "1015", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1025", + "$id": "1016", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17031,19 +16883,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "1026", + "$id": "1017", "kind": "client", "name": "Metrics", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1027", + "$id": "1018", "kind": "basic", "name": "getWidgetMetrics", "isExactName": false, @@ -17054,7 +16906,7 @@ ], "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1028", + "$id": "1019", "name": "getWidgetMetrics", "isExactName": false, "resourceName": "Metrics", @@ -17062,12 +16914,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1029", + "$id": "1020", "kind": "path", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1030", + "$id": "1021", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17085,12 +16937,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", "methodParameterSegments": [ { - "$id": "1031", + "$id": "1022", "kind": "method", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1032", + "$id": "1023", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17110,7 +16962,7 @@ "isExactName": false }, { - "$id": "1033", + "$id": "1024", "kind": "path", "name": "day", "serializedName": "day", @@ -17129,7 +16981,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1034", + "$id": "1025", "kind": "method", "name": "day", "serializedName": "day", @@ -17150,12 +17002,12 @@ "isExactName": false }, { - "$id": "1035", + "$id": "1026", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "260" + "$ref": "256" }, "isApiVersion": false, "optional": false, @@ -17166,12 +17018,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1036", + "$id": "1027", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "260" + "$ref": "256" }, "location": "Header", "isApiVersion": false, @@ -17193,7 +17045,7 @@ 200 ], "bodyType": { - "$ref": "594" + "$ref": "590" }, "headers": [], "isErrorResponse": false, @@ -17219,15 +17071,15 @@ }, "parameters": [ { - "$ref": "1034" + "$ref": "1025" }, { - "$ref": "1036" + "$ref": "1027" } ], "response": { "type": { - "$ref": "594" + "$ref": "590" } }, "isOverride": false, @@ -17238,12 +17090,12 @@ ], "parameters": [ { - "$id": "1037", + "$id": "1028", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1038", + "$id": "1029", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17259,7 +17111,7 @@ "isExactName": false }, { - "$ref": "1031" + "$ref": "1022" } ], "initializedBy": 3, @@ -17270,19 +17122,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false }, { - "$id": "1039", + "$id": "1030", "kind": "client", "name": "Notebooks", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1040", + "$id": "1031", "kind": "basic", "name": "getNotebook", "isExactName": false, @@ -17293,7 +17145,7 @@ ], "doc": "Get a notebook by name", "operation": { - "$id": "1041", + "$id": "1032", "name": "getNotebook", "isExactName": false, "resourceName": "Notebooks", @@ -17301,12 +17153,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1042", + "$id": "1033", "kind": "path", "name": "notebookName", "serializedName": "notebookName", "type": { - "$id": "1043", + "$id": "1034", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17324,12 +17176,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1044", + "$id": "1035", "kind": "method", "name": "notebook", "serializedName": "notebook", "type": { - "$id": "1045", + "$id": "1036", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17350,12 +17202,12 @@ "isExactName": false }, { - "$id": "1046", + "$id": "1037", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "262" + "$ref": "258" }, "isApiVersion": false, "optional": false, @@ -17366,12 +17218,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1047", + "$id": "1038", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "262" + "$ref": "258" }, "location": "Header", "isApiVersion": false, @@ -17393,7 +17245,7 @@ 200 ], "bodyType": { - "$ref": "599" + "$ref": "595" }, "headers": [], "isErrorResponse": false, @@ -17419,12 +17271,12 @@ }, "parameters": [ { - "$ref": "1047" + "$ref": "1038" } ], "response": { "type": { - "$ref": "599" + "$ref": "595" } }, "isOverride": false, @@ -17435,12 +17287,12 @@ ], "parameters": [ { - "$id": "1048", + "$id": "1039", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1049", + "$id": "1040", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17456,7 +17308,7 @@ "isExactName": false }, { - "$ref": "1044" + "$ref": "1035" } ], "initializedBy": 3, @@ -17467,7 +17319,7 @@ "2024-08-16-preview" ], "parent": { - "$ref": "648" + "$ref": "644" }, "isMultiServiceClient": false } From 1c66d03ac7ea2ba8456dc9742e7d6b51b97d5e10 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 17:34:16 +0000 Subject: [PATCH 43/47] test(http-client-csharp): revert local primitive response sample Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Local.Tests/PrimitiveResponseTests.cs | 43 - .../Local/Sample-TypeSpec/Sample-TypeSpec.tsp | 8 - .../SampleTypeSpecClient.RestClient.cs | 12 - .../src/Generated/SampleTypeSpecClient.cs | 67 +- .../Local/Sample-TypeSpec/tspCodeModel.json | 2504 ++++++++--------- 5 files changed, 1182 insertions(+), 1452 deletions(-) delete mode 100644 packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs deleted file mode 100644 index c9d6fbc23ab..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text; -using System.Threading.Tasks; -using Moq; -using NUnit.Framework; -using SampleTypeSpec; - -namespace TestProjects.Local.Tests -{ - public class PrimitiveResponseTests - { - [TestCase(false, false)] - [TestCase(false, true)] - [TestCase(true, false)] - [TestCase(true, true)] - public async Task JsonInt32ResponseDeserialization(bool hasBom, bool isAsync) - { - var payload = Encoding.UTF8.GetBytes("42"); - var content = hasBom - ? BinaryData.FromBytes([.. Encoding.UTF8.GetPreamble(), .. payload]) - : BinaryData.FromBytes(payload); - var response = new Mock(); - response.SetupGet(r => r.Content).Returns(content); - var protocolResult = ClientResult.FromResponse(response.Object); - var client = new Mock { CallBase = true }; - client.Setup(c => c.GetJsonInt32(It.IsAny())).Returns(protocolResult); - client.Setup(c => c.GetJsonInt32Async(It.IsAny())).ReturnsAsync(protocolResult); - - var result = isAsync - ? await client.Object.GetJsonInt32Async() - : client.Object.GetJsonInt32(); - - Assert.AreEqual(42, result.Value); - Assert.AreSame(response.Object, result.GetRawResponse()); - Assert.AreSame(content, result.GetRawResponse().Content); - } - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp index 5082930e1ed..7daa3c98cff 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Sample-TypeSpec.tsp @@ -947,11 +947,3 @@ op receiveJsonLines(): JsonlStream; @get @route("/streaming/sse/receive") op receiveSse(): SSEStream; - -@get -@route("/json-int32") -@doc("get JSON int32") -op getJsonInt32(): { - @body body: int32; - @header contentType: "application/json"; -}; diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs index 3b1bfa50e55..23707366819 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.RestClient.cs @@ -499,17 +499,5 @@ internal PipelineMessage CreateReceiveSseRequest(RequestOptions options) message.Apply(options); return message; } - - internal PipelineMessage CreateGetJsonInt32Request(RequestOptions options) - { - ClientUriBuilder uri = new ClientUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/json-int32", false); - PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); - PipelineRequest request = message.Request; - request.Headers.Set("Accept", "application/json"); - message.Apply(options); - return message; - } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 34591f52710..792f8625d5e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -12,7 +12,6 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.ServerSentEvents; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; using SampleTypeSpec.Models.Custom; @@ -1087,8 +1086,8 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(responseContent); return ClientResult.FromValue(value, result.GetRawResponse()); } @@ -1098,8 +1097,8 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); + string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(responseContent); return ClientResult.FromValue(value, result.GetRawResponse()); } @@ -2064,64 +2063,6 @@ public virtual async Task>> Re } #pragma warning restore SCME0005 // Type is for evaluation purposes only and is subject to change or removal in future updates. - /// - /// [Protocol Method] get JSON int32 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual ClientResult GetJsonInt32(RequestOptions options) - { - using PipelineMessage message = CreateGetJsonInt32Request(options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); - } - - /// - /// [Protocol Method] get JSON int32 - /// - /// - /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. - /// - /// - /// - /// The request options, which can override default behaviors of the client pipeline on a per-call basis. - /// Service returned a non-success status code. - /// The response returned from the service. - public virtual async Task GetJsonInt32Async(RequestOptions options) - { - using PipelineMessage message = CreateGetJsonInt32Request(options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); - } - - /// get JSON int32. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual ClientResult GetJsonInt32(CancellationToken cancellationToken = default) - { - ClientResult result = GetJsonInt32(cancellationToken.ToRequestOptions()); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using JsonDocument document = JsonDocument.Parse(content); - int value = document.RootElement.GetInt32(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - - /// get JSON int32. - /// The cancellation token that can be used to cancel the operation. - /// Service returned a non-success status code. - public virtual async Task> GetJsonInt32Async(CancellationToken cancellationToken = default) - { - ClientResult result = await GetJsonInt32Async(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string content = result.GetRawResponse().Content.ToString().TrimStart(''); - using JsonDocument document = JsonDocument.Parse(content); - int value = document.RootElement.GetInt32(); - return ClientResult.FromValue(value, result.GetRawResponse()); - } - /// Initializes a new instance of AnimalOperations. public virtual AnimalOperations GetAnimalOperationsClient() { diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 623f6c30b1a..c9dfa4e0ea7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -1030,7 +1030,7 @@ { "$id": "86", "kind": "constant", - "name": "GetJsonInt32ResponseContentType", + "name": "GetTreeAsJsonResponseContentType", "namespace": "", "usage": "None", "valueType": { @@ -1081,7 +1081,7 @@ { "$id": "92", "kind": "constant", - "name": "GetJsonInt32ResponseContentType1", + "name": "GetTreeAsJsonResponseContentType1", "namespace": "", "usage": "None", "valueType": { @@ -1098,7 +1098,7 @@ { "$id": "94", "kind": "constant", - "name": "GetJsonInt32ResponseContentType2", + "name": "GetTreeAsJsonResponseContentType2", "namespace": "", "usage": "None", "valueType": { @@ -1115,7 +1115,7 @@ { "$id": "96", "kind": "constant", - "name": "GetJsonInt32ResponseContentType3", + "name": "GetTreeAsJsonResponseContentType3", "namespace": "", "usage": "None", "valueType": { @@ -1132,7 +1132,7 @@ { "$id": "98", "kind": "constant", - "name": "GetJsonInt32ResponseContentType4", + "name": "GetTreeAsJsonResponseContentType4", "namespace": "", "usage": "None", "valueType": { @@ -1149,7 +1149,7 @@ { "$id": "100", "kind": "constant", - "name": "GetJsonInt32ResponseContentType5", + "name": "GetTreeAsJsonResponseContentType5", "namespace": "", "usage": "None", "valueType": { @@ -1166,7 +1166,7 @@ { "$id": "102", "kind": "constant", - "name": "GetJsonInt32ResponseContentType6", + "name": "GetTreeAsJsonResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -1285,7 +1285,7 @@ { "$id": "116", "kind": "constant", - "name": "GetJsonInt32ResponseContentType7", + "name": "GetTreeAsJsonResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -1302,7 +1302,7 @@ { "$id": "118", "kind": "constant", - "name": "GetJsonInt32ResponseContentType8", + "name": "GetTreeAsJsonResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -1319,7 +1319,7 @@ { "$id": "120", "kind": "constant", - "name": "GetJsonInt32ResponseContentType9", + "name": "GetTreeAsJsonResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -1336,7 +1336,7 @@ { "$id": "122", "kind": "constant", - "name": "GetJsonInt32ResponseContentType10", + "name": "GetTreeAsJsonResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -1353,7 +1353,7 @@ { "$id": "124", "kind": "constant", - "name": "GetJsonInt32ResponseContentType11", + "name": "GetTreeAsJsonResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -1438,7 +1438,7 @@ { "$id": "134", "kind": "constant", - "name": "GetJsonInt32ResponseContentType12", + "name": "GetTreeAsJsonResponseContentType12", "namespace": "", "usage": "None", "valueType": { @@ -1455,7 +1455,7 @@ { "$id": "136", "kind": "constant", - "name": "GetJsonInt32ResponseContentType13", + "name": "GetTreeAsJsonResponseContentType13", "namespace": "", "usage": "None", "valueType": { @@ -1557,7 +1557,7 @@ { "$id": "148", "kind": "constant", - "name": "GetJsonInt32ResponseContentType14", + "name": "GetTreeAsJsonResponseContentType14", "namespace": "", "usage": "None", "valueType": { @@ -1574,7 +1574,7 @@ { "$id": "150", "kind": "constant", - "name": "GetJsonInt32ResponseContentType15", + "name": "GetTreeAsJsonResponseContentType15", "namespace": "", "usage": "None", "valueType": { @@ -1591,7 +1591,7 @@ { "$id": "152", "kind": "constant", - "name": "GetJsonInt32ResponseContentType16", + "name": "GetTreeAsJsonResponseContentType16", "namespace": "", "usage": "None", "valueType": { @@ -1608,7 +1608,7 @@ { "$id": "154", "kind": "constant", - "name": "GetJsonInt32ResponseContentType17", + "name": "GetTreeAsJsonResponseContentType17", "namespace": "", "usage": "None", "valueType": { @@ -1625,7 +1625,7 @@ { "$id": "156", "kind": "constant", - "name": "GetJsonInt32ResponseContentType18", + "name": "GetTreeAsJsonResponseContentType18", "namespace": "", "usage": "None", "valueType": { @@ -1659,7 +1659,7 @@ { "$id": "160", "kind": "constant", - "name": "GetJsonInt32ResponseContentType19", + "name": "GetTreeAsJsonResponseContentType19", "namespace": "", "usage": "None", "valueType": { @@ -1676,7 +1676,7 @@ { "$id": "162", "kind": "constant", - "name": "GetJsonInt32ResponseContentType20", + "name": "GetTreeAsJsonResponseContentType20", "namespace": "", "usage": "None", "valueType": { @@ -1693,7 +1693,7 @@ { "$id": "164", "kind": "constant", - "name": "GetJsonInt32ResponseContentType21", + "name": "GetTreeAsJsonResponseContentType21", "namespace": "", "usage": "None", "valueType": { @@ -1710,7 +1710,7 @@ { "$id": "166", "kind": "constant", - "name": "GetJsonInt32ResponseContentType22", + "name": "GetTreeAsJsonResponseContentType22", "namespace": "", "usage": "None", "valueType": { @@ -1727,7 +1727,7 @@ { "$id": "168", "kind": "constant", - "name": "GetJsonInt32ResponseContentType23", + "name": "GetTreeAsJsonResponseContentType23", "namespace": "", "usage": "None", "valueType": { @@ -1744,7 +1744,7 @@ { "$id": "170", "kind": "constant", - "name": "GetJsonInt32ResponseContentType24", + "name": "GetTreeAsJsonResponseContentType24", "namespace": "", "usage": "None", "valueType": { @@ -1761,7 +1761,7 @@ { "$id": "172", "kind": "constant", - "name": "GetJsonInt32ResponseContentType25", + "name": "GetTreeAsJsonResponseContentType25", "namespace": "", "usage": "None", "valueType": { @@ -1778,7 +1778,7 @@ { "$id": "174", "kind": "constant", - "name": "GetJsonInt32ResponseContentType26", + "name": "GetTreeAsJsonResponseContentType26", "namespace": "", "usage": "None", "valueType": { @@ -1795,7 +1795,7 @@ { "$id": "176", "kind": "constant", - "name": "GetJsonInt32ResponseContentType27", + "name": "GetTreeAsJsonResponseContentType27", "namespace": "", "usage": "None", "valueType": { @@ -2067,7 +2067,7 @@ { "$id": "208", "kind": "constant", - "name": "GetJsonInt32ResponseContentType28", + "name": "GetTreeAsJsonResponseContentType28", "namespace": "", "usage": "None", "valueType": { @@ -2084,7 +2084,7 @@ { "$id": "210", "kind": "constant", - "name": "GetJsonInt32ResponseContentType29", + "name": "GetTreeAsJsonResponseContentType29", "namespace": "", "usage": "None", "valueType": { @@ -2101,7 +2101,7 @@ { "$id": "212", "kind": "constant", - "name": "GetJsonInt32ResponseContentType30", + "name": "GetTreeAsJsonResponseContentType30", "namespace": "", "usage": "None", "valueType": { @@ -2118,7 +2118,7 @@ { "$id": "214", "kind": "constant", - "name": "GetJsonInt32ResponseContentType31", + "name": "GetTreeAsJsonResponseContentType31", "namespace": "", "usage": "None", "valueType": { @@ -2135,7 +2135,7 @@ { "$id": "216", "kind": "constant", - "name": "GetJsonInt32ResponseContentType32", + "name": "GetTreeAsJsonResponseContentType32", "namespace": "", "usage": "None", "valueType": { @@ -2152,7 +2152,7 @@ { "$id": "218", "kind": "constant", - "name": "GetJsonInt32ResponseContentType33", + "name": "GetTreeAsJsonResponseContentType33", "namespace": "", "usage": "None", "valueType": { @@ -2169,7 +2169,7 @@ { "$id": "220", "kind": "constant", - "name": "GetJsonInt32ResponseContentType34", + "name": "GetTreeAsJsonResponseContentType34", "namespace": "", "usage": "None", "valueType": { @@ -2186,7 +2186,7 @@ { "$id": "222", "kind": "constant", - "name": "GetJsonInt32ResponseContentType35", + "name": "GetTreeAsJsonResponseContentType35", "namespace": "", "usage": "None", "valueType": { @@ -2203,7 +2203,7 @@ { "$id": "224", "kind": "constant", - "name": "GetJsonInt32ResponseContentType36", + "name": "GetTreeAsJsonResponseContentType36", "namespace": "", "usage": "None", "valueType": { @@ -2220,7 +2220,7 @@ { "$id": "226", "kind": "constant", - "name": "GetJsonInt32ResponseContentType37", + "name": "GetTreeAsJsonResponseContentType37", "namespace": "", "usage": "None", "valueType": { @@ -2237,7 +2237,7 @@ { "$id": "228", "kind": "constant", - "name": "GetJsonInt32ResponseContentType38", + "name": "GetXmlAdvancedModelResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -2247,14 +2247,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "230", "kind": "constant", - "name": "GetJsonInt32ResponseContentType39", + "name": "GetXmlAdvancedModelResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -2264,14 +2264,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "232", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType6", + "name": "GetTreeAsJsonResponseContentType38", "namespace": "", "usage": "None", "valueType": { @@ -2281,14 +2281,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "234", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType7", + "name": "GetTreeAsJsonResponseContentType39", "namespace": "", "usage": "None", "valueType": { @@ -2298,14 +2298,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "236", "kind": "constant", - "name": "GetJsonInt32ResponseContentType40", + "name": "GetXmlAdvancedModelResponseContentType8", "namespace": "", "usage": "None", "valueType": { @@ -2315,14 +2315,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "238", "kind": "constant", - "name": "GetJsonInt32ResponseContentType41", + "name": "GetXmlAdvancedModelResponseContentType9", "namespace": "", "usage": "None", "valueType": { @@ -2332,14 +2332,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$id": "240", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType8", + "name": "GetXmlAdvancedModelResponseContentType10", "namespace": "", "usage": "None", "valueType": { @@ -2356,7 +2356,7 @@ { "$id": "242", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType9", + "name": "GetXmlAdvancedModelResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -2373,7 +2373,7 @@ { "$id": "244", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType10", + "name": "GetTreeAsJsonResponseContentType40", "namespace": "", "usage": "None", "valueType": { @@ -2383,14 +2383,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "246", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType11", + "name": "GetTreeAsJsonResponseContentType41", "namespace": "", "usage": "None", "valueType": { @@ -2400,14 +2400,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/xml", + "value": "application/json", "decorators": [], "isExactName": false }, { "$id": "248", "kind": "constant", - "name": "GetJsonInt32ResponseContentType42", + "name": "GetTreeAsJsonResponseContentType42", "namespace": "", "usage": "None", "valueType": { @@ -2424,7 +2424,7 @@ { "$id": "250", "kind": "constant", - "name": "GetJsonInt32ResponseContentType43", + "name": "GetTreeAsJsonResponseContentType43", "namespace": "", "usage": "None", "valueType": { @@ -2441,7 +2441,7 @@ { "$id": "252", "kind": "constant", - "name": "GetJsonInt32ResponseContentType44", + "name": "GetTreeAsJsonResponseContentType44", "namespace": "", "usage": "None", "valueType": { @@ -2458,7 +2458,7 @@ { "$id": "254", "kind": "constant", - "name": "GetJsonInt32ResponseContentType45", + "name": "GetTreeAsJsonResponseContentType45", "namespace": "", "usage": "None", "valueType": { @@ -2471,45 +2471,11 @@ "value": "application/json", "decorators": [], "isExactName": false - }, - { - "$id": "256", - "kind": "constant", - "name": "GetJsonInt32ResponseContentType46", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "257", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false - }, - { - "$id": "258", - "kind": "constant", - "name": "GetJsonInt32ResponseContentType47", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "259", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [], - "isExactName": false } ], "models": [ { - "$id": "260", + "$id": "256", "kind": "model", "name": "Thing", "apiVersions": [ @@ -2529,7 +2495,7 @@ "isExactName": false, "properties": [ { - "$id": "261", + "$id": "257", "kind": "property", "name": "name", "apiVersions": [ @@ -2539,7 +2505,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "262", + "$id": "258", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2560,7 +2526,7 @@ "isExactName": false }, { - "$id": "263", + "$id": "259", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -2570,23 +2536,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "264", + "$id": "260", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "265", + "$id": "261", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "266", + "$id": "262", "kind": "array", "name": "Array", "valueType": { - "$id": "267", + "$id": "263", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2596,7 +2562,7 @@ "decorators": [] }, { - "$id": "268", + "$id": "264", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2622,7 +2588,7 @@ "isExactName": false }, { - "$id": "269", + "$id": "265", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -2649,7 +2615,7 @@ "isExactName": false }, { - "$id": "270", + "$id": "266", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -2659,10 +2625,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "271", + "$id": "267", "kind": "nullable", "type": { - "$id": "272", + "$id": "268", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2685,7 +2651,7 @@ "isExactName": false }, { - "$id": "273", + "$id": "269", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -2695,10 +2661,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "274", + "$id": "270", "kind": "nullable", "type": { - "$id": "275", + "$id": "271", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2721,7 +2687,7 @@ "isExactName": false }, { - "$id": "276", + "$id": "272", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -2748,7 +2714,7 @@ "isExactName": false }, { - "$id": "277", + "$id": "273", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -2775,7 +2741,7 @@ "isExactName": false }, { - "$id": "278", + "$id": "274", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -2802,7 +2768,7 @@ "isExactName": false }, { - "$id": "279", + "$id": "275", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -2829,7 +2795,7 @@ "isExactName": false }, { - "$id": "280", + "$id": "276", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -2839,7 +2805,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "281", + "$id": "277", "kind": "nullable", "type": { "$ref": "5" @@ -2861,7 +2827,7 @@ "isExactName": false }, { - "$id": "282", + "$id": "278", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -2888,7 +2854,7 @@ "isExactName": false }, { - "$id": "283", + "$id": "279", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -2915,7 +2881,7 @@ "isExactName": false }, { - "$id": "284", + "$id": "280", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -2942,7 +2908,7 @@ "isExactName": false }, { - "$id": "285", + "$id": "281", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -2952,7 +2918,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "286", + "$id": "282", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2973,7 +2939,7 @@ "isExactName": false }, { - "$id": "287", + "$id": "283", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -2983,14 +2949,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "288", + "$id": "284", "kind": "nullable", "type": { - "$id": "289", + "$id": "285", "kind": "array", "name": "Array1", "valueType": { - "$id": "290", + "$id": "286", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3016,7 +2982,7 @@ "isExactName": false }, { - "$id": "291", + "$id": "287", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -3026,10 +2992,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "292", + "$id": "288", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "285" }, "namespace": "SampleTypeSpec" }, @@ -3048,7 +3014,7 @@ "isExactName": false }, { - "$id": "293", + "$id": "289", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3058,7 +3024,7 @@ "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "294", + "$id": "290", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3081,7 +3047,7 @@ ] }, { - "$id": "295", + "$id": "291", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3101,7 +3067,7 @@ "isExactName": false, "properties": [ { - "$id": "296", + "$id": "292", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3111,7 +3077,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "297", + "$id": "293", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3132,7 +3098,7 @@ "isExactName": false }, { - "$id": "298", + "$id": "294", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -3142,7 +3108,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "299", + "$id": "295", "kind": "int32", "name": "int32", "encode": "string", @@ -3164,7 +3130,7 @@ "isExactName": false }, { - "$id": "300", + "$id": "296", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -3174,7 +3140,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "301", + "$id": "297", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -3198,7 +3164,7 @@ "isExactName": false }, { - "$id": "302", + "$id": "298", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -3208,10 +3174,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "303", + "$id": "299", "kind": "dict", "keyType": { - "$id": "304", + "$id": "300", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3237,7 +3203,7 @@ "isExactName": false }, { - "$id": "305", + "$id": "301", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -3247,7 +3213,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "260" + "$ref": "256" }, "optional": false, "readOnly": false, @@ -3264,7 +3230,7 @@ "isExactName": false }, { - "$id": "306", + "$id": "302", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -3291,7 +3257,7 @@ "isExactName": false }, { - "$id": "307", + "$id": "303", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -3301,7 +3267,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "308", + "$id": "304", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -3325,7 +3291,7 @@ "isExactName": false }, { - "$id": "309", + "$id": "305", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -3352,7 +3318,7 @@ "isExactName": false }, { - "$id": "310", + "$id": "306", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -3379,7 +3345,7 @@ "isExactName": false }, { - "$id": "311", + "$id": "307", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -3389,7 +3355,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "312", + "$id": "308", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -3413,7 +3379,7 @@ "isExactName": false }, { - "$id": "313", + "$id": "309", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -3440,7 +3406,7 @@ "isExactName": false }, { - "$id": "314", + "$id": "310", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -3467,7 +3433,7 @@ "isExactName": false }, { - "$id": "315", + "$id": "311", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -3477,7 +3443,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "316", + "$id": "312", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -3501,7 +3467,7 @@ "isExactName": false }, { - "$id": "317", + "$id": "313", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -3528,7 +3494,7 @@ "isExactName": false }, { - "$id": "318", + "$id": "314", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -3538,7 +3504,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "319", + "$id": "315", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -3562,7 +3528,7 @@ "isExactName": false }, { - "$id": "320", + "$id": "316", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -3589,7 +3555,7 @@ "isExactName": false }, { - "$id": "321", + "$id": "317", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -3599,7 +3565,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "322", + "$id": "318", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3620,7 +3586,7 @@ "isExactName": false }, { - "$id": "323", + "$id": "319", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -3630,7 +3596,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "324", + "$id": "320", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3651,7 +3617,7 @@ "isExactName": false }, { - "$id": "325", + "$id": "321", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -3661,17 +3627,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "326", + "$id": "322", "kind": "dict", "keyType": { - "$id": "327", + "$id": "323", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "328", + "$id": "324", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3694,7 +3660,7 @@ "isExactName": false }, { - "$id": "329", + "$id": "325", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -3704,7 +3670,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "326" + "$ref": "322" }, "optional": true, "readOnly": false, @@ -3721,7 +3687,7 @@ "isExactName": false }, { - "$id": "330", + "$id": "326", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -3731,7 +3697,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "326" + "$ref": "322" }, "optional": false, "readOnly": true, @@ -3748,7 +3714,7 @@ "isExactName": false }, { - "$id": "331", + "$id": "327", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -3758,7 +3724,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "326" + "$ref": "322" }, "optional": true, "readOnly": true, @@ -3775,7 +3741,7 @@ "isExactName": false }, { - "$id": "332", + "$id": "328", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -3785,7 +3751,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "333", + "$id": "329", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -3805,7 +3771,7 @@ "isExactName": false, "properties": [ { - "$id": "334", + "$id": "330", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -3815,10 +3781,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "335", + "$id": "331", "kind": "nullable", "type": { - "$id": "336", + "$id": "332", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3841,7 +3807,7 @@ "isExactName": false }, { - "$id": "337", + "$id": "333", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -3851,7 +3817,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "338", + "$id": "334", "kind": "nullable", "type": { "$ref": "22" @@ -3873,7 +3839,7 @@ "isExactName": false }, { - "$id": "339", + "$id": "335", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -3883,7 +3849,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "340", + "$id": "336", "kind": "nullable", "type": { "$ref": "17" @@ -3921,7 +3887,7 @@ "isExactName": false }, { - "$id": "341", + "$id": "337", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -3931,7 +3897,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "342", + "$id": "338", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -3955,10 +3921,10 @@ ] }, { - "$ref": "333" + "$ref": "329" }, { - "$id": "343", + "$id": "339", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -3973,7 +3939,7 @@ "isExactName": false, "properties": [ { - "$id": "344", + "$id": "340", "kind": "property", "name": "p1", "apiVersions": [ @@ -3982,7 +3948,7 @@ ], "doc": "header parameter", "type": { - "$id": "345", + "$id": "341", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3999,7 +3965,7 @@ "isExactName": false }, { - "$id": "346", + "$id": "342", "kind": "property", "name": "action", "apiVersions": [ @@ -4008,7 +3974,7 @@ ], "doc": "body parameter", "type": { - "$ref": "295" + "$ref": "291" }, "optional": false, "readOnly": false, @@ -4021,7 +3987,7 @@ "isExactName": false }, { - "$id": "347", + "$id": "343", "kind": "property", "name": "p2", "apiVersions": [ @@ -4030,7 +3996,7 @@ ], "doc": "path parameter", "type": { - "$id": "348", + "$id": "344", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4049,7 +4015,7 @@ ] }, { - "$id": "349", + "$id": "345", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4069,7 +4035,7 @@ "isExactName": false, "properties": [ { - "$id": "350", + "$id": "346", "kind": "property", "name": "name", "apiVersions": [ @@ -4079,7 +4045,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "351", + "$id": "347", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4102,7 +4068,7 @@ ] }, { - "$id": "352", + "$id": "348", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -4122,7 +4088,7 @@ "isExactName": false, "properties": [ { - "$id": "353", + "$id": "349", "kind": "property", "name": "otherName", "apiVersions": [ @@ -4132,7 +4098,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "354", + "$id": "350", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4155,7 +4121,7 @@ ] }, { - "$id": "355", + "$id": "351", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -4175,7 +4141,7 @@ "properties": [] }, { - "$id": "356", + "$id": "352", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -4194,7 +4160,7 @@ "isExactName": false, "properties": [ { - "$id": "357", + "$id": "353", "kind": "property", "name": "things", "apiVersions": [ @@ -4203,11 +4169,11 @@ ], "serializedName": "things", "type": { - "$id": "358", + "$id": "354", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "260" + "$ref": "256" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -4227,7 +4193,7 @@ "isExactName": false }, { - "$id": "359", + "$id": "355", "kind": "property", "name": "next", "apiVersions": [ @@ -4236,7 +4202,7 @@ ], "serializedName": "next", "type": { - "$id": "360", + "$id": "356", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -4259,7 +4225,7 @@ ] }, { - "$id": "361", + "$id": "357", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -4278,7 +4244,7 @@ "isExactName": false, "properties": [ { - "$id": "362", + "$id": "358", "kind": "property", "name": "things", "apiVersions": [ @@ -4287,7 +4253,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "354" }, "optional": false, "readOnly": false, @@ -4304,7 +4270,7 @@ "isExactName": false }, { - "$id": "363", + "$id": "359", "kind": "property", "name": "next", "apiVersions": [ @@ -4313,7 +4279,7 @@ ], "serializedName": "next", "type": { - "$id": "364", + "$id": "360", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4336,7 +4302,7 @@ ] }, { - "$id": "365", + "$id": "361", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -4355,7 +4321,7 @@ "isExactName": false, "properties": [ { - "$id": "366", + "$id": "362", "kind": "property", "name": "things", "apiVersions": [ @@ -4364,7 +4330,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "354" }, "optional": false, "readOnly": false, @@ -4381,7 +4347,7 @@ "isExactName": false }, { - "$id": "367", + "$id": "363", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -4390,7 +4356,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "368", + "$id": "364", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4413,7 +4379,7 @@ ] }, { - "$id": "369", + "$id": "365", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -4429,7 +4395,7 @@ "isExactName": false, "properties": [ { - "$id": "370", + "$id": "366", "kind": "property", "name": "things", "apiVersions": [ @@ -4438,7 +4404,7 @@ ], "serializedName": "things", "type": { - "$ref": "358" + "$ref": "354" }, "optional": false, "readOnly": false, @@ -4457,7 +4423,7 @@ ] }, { - "$id": "371", + "$id": "367", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -4476,7 +4442,7 @@ "isExactName": false, "properties": [ { - "$id": "372", + "$id": "368", "kind": "property", "name": "items", "apiVersions": [ @@ -4485,7 +4451,7 @@ ], "serializedName": "items", "type": { - "$ref": "358" + "$ref": "354" }, "optional": false, "readOnly": false, @@ -4504,7 +4470,7 @@ ] }, { - "$id": "373", + "$id": "369", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -4523,7 +4489,7 @@ "isExactName": false, "properties": [ { - "$id": "374", + "$id": "370", "kind": "property", "name": "name", "apiVersions": [ @@ -4533,7 +4499,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "375", + "$id": "371", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4554,7 +4520,7 @@ "isExactName": false }, { - "$id": "376", + "$id": "372", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -4564,7 +4530,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "377", + "$id": "373", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4585,7 +4551,7 @@ "isExactName": false }, { - "$id": "378", + "$id": "374", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -4595,7 +4561,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "379", + "$id": "375", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4616,7 +4582,7 @@ "isExactName": false }, { - "$id": "380", + "$id": "376", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -4626,7 +4592,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "381", + "$id": "377", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4647,7 +4613,7 @@ "isExactName": false }, { - "$id": "382", + "$id": "378", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -4657,7 +4623,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "383", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4680,7 +4646,7 @@ ] }, { - "$id": "384", + "$id": "380", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -4705,7 +4671,7 @@ "isExactName": false, "properties": [ { - "$id": "385", + "$id": "381", "kind": "property", "name": "name", "apiVersions": [ @@ -4714,7 +4680,7 @@ ], "serializedName": "name", "type": { - "$id": "386", + "$id": "382", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4735,7 +4701,7 @@ "isExactName": false }, { - "$id": "387", + "$id": "383", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4744,7 +4710,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "388", + "$id": "384", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4765,7 +4731,7 @@ "isExactName": false }, { - "$id": "389", + "$id": "385", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -4774,7 +4740,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "390", + "$id": "386", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4795,7 +4761,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "387", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -4804,10 +4770,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "392", + "$id": "388", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "285" }, "namespace": "SampleTypeSpec" }, @@ -4826,7 +4792,7 @@ "isExactName": false }, { - "$id": "393", + "$id": "389", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -4835,10 +4801,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "394", + "$id": "390", "kind": "nullable", "type": { - "$ref": "289" + "$ref": "285" }, "namespace": "SampleTypeSpec" }, @@ -4857,7 +4823,7 @@ "isExactName": false }, { - "$id": "395", + "$id": "391", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -4866,20 +4832,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "396", + "$id": "392", "kind": "nullable", "type": { - "$id": "397", + "$id": "393", "kind": "dict", "keyType": { - "$id": "398", + "$id": "394", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "399", + "$id": "395", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4904,7 +4870,7 @@ "isExactName": false }, { - "$id": "400", + "$id": "396", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -4913,10 +4879,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "401", + "$id": "397", "kind": "nullable", "type": { - "$ref": "397" + "$ref": "393" }, "namespace": "SampleTypeSpec" }, @@ -4935,7 +4901,7 @@ "isExactName": false }, { - "$id": "402", + "$id": "398", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -4944,7 +4910,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "397" + "$ref": "393" }, "optional": false, "readOnly": false, @@ -4961,7 +4927,7 @@ "isExactName": false }, { - "$id": "403", + "$id": "399", "kind": "property", "name": "foo", "apiVersions": [ @@ -4970,7 +4936,7 @@ ], "serializedName": "foo", "type": { - "$id": "404", + "$id": "400", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -4995,7 +4961,7 @@ "isExactName": false, "properties": [ { - "$id": "405", + "$id": "401", "kind": "property", "name": "bar", "apiVersions": [ @@ -5004,7 +4970,7 @@ ], "serializedName": "bar", "type": { - "$id": "406", + "$id": "402", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5041,7 +5007,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "403", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5050,11 +5016,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "408", + "$id": "404", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "404" + "$ref": "400" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5074,7 +5040,7 @@ "isExactName": false }, { - "$id": "409", + "$id": "405", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -5083,11 +5049,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "410", + "$id": "406", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "408" + "$ref": "404" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5107,7 +5073,7 @@ "isExactName": false }, { - "$id": "411", + "$id": "407", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -5116,17 +5082,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "412", + "$id": "408", "kind": "dict", "keyType": { - "$id": "413", + "$id": "409", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "404" + "$ref": "400" }, "decorators": [] }, @@ -5145,7 +5111,7 @@ "isExactName": false }, { - "$id": "414", + "$id": "410", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -5154,17 +5120,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "415", + "$id": "411", "kind": "dict", "keyType": { - "$id": "416", + "$id": "412", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "412" + "$ref": "408" }, "decorators": [] }, @@ -5183,7 +5149,7 @@ "isExactName": false }, { - "$id": "417", + "$id": "413", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -5192,17 +5158,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "418", + "$id": "414", "kind": "dict", "keyType": { - "$id": "419", + "$id": "415", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "408" + "$ref": "404" }, "decorators": [] }, @@ -5221,7 +5187,7 @@ "isExactName": false }, { - "$id": "420", + "$id": "416", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -5230,11 +5196,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "421", + "$id": "417", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "412" + "$ref": "408" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5256,10 +5222,10 @@ ] }, { - "$ref": "404" + "$ref": "400" }, { - "$id": "422", + "$id": "418", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -5288,7 +5254,7 @@ "isExactName": false, "properties": [ { - "$id": "423", + "$id": "419", "kind": "property", "name": "name", "apiVersions": [ @@ -5298,7 +5264,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "424", + "$id": "420", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5321,7 +5287,7 @@ "isExactName": false }, { - "$id": "425", + "$id": "421", "kind": "property", "name": "age", "apiVersions": [ @@ -5331,7 +5297,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "426", + "$id": "422", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5354,7 +5320,7 @@ "isExactName": false }, { - "$id": "427", + "$id": "423", "kind": "property", "name": "enabled", "apiVersions": [ @@ -5364,7 +5330,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "428", + "$id": "424", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5387,7 +5353,7 @@ "isExactName": false }, { - "$id": "429", + "$id": "425", "kind": "property", "name": "score", "apiVersions": [ @@ -5397,7 +5363,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "430", + "$id": "426", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -5420,7 +5386,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "427", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -5430,7 +5396,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "432", + "$id": "428", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5453,7 +5419,7 @@ "isExactName": false }, { - "$id": "433", + "$id": "429", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5463,7 +5429,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "434", + "$id": "430", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5486,7 +5452,7 @@ "isExactName": false }, { - "$id": "435", + "$id": "431", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -5496,10 +5462,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "436", + "$id": "432", "kind": "nullable", "type": { - "$id": "437", + "$id": "433", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5524,7 +5490,7 @@ "isExactName": false }, { - "$id": "438", + "$id": "434", "kind": "property", "name": "id", "apiVersions": [ @@ -5534,7 +5500,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "439", + "$id": "435", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5562,7 +5528,7 @@ "isExactName": false }, { - "$id": "440", + "$id": "436", "kind": "property", "name": "version", "apiVersions": [ @@ -5572,7 +5538,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "441", + "$id": "437", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5600,7 +5566,7 @@ "isExactName": false }, { - "$id": "442", + "$id": "438", "kind": "property", "name": "isActive", "apiVersions": [ @@ -5610,7 +5576,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "443", + "$id": "439", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5638,7 +5604,7 @@ "isExactName": false }, { - "$id": "444", + "$id": "440", "kind": "property", "name": "originalName", "apiVersions": [ @@ -5648,7 +5614,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "445", + "$id": "441", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5678,7 +5644,7 @@ "isExactName": false }, { - "$id": "446", + "$id": "442", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -5688,7 +5654,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "447", + "$id": "443", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5722,7 +5688,7 @@ "isExactName": false }, { - "$id": "448", + "$id": "444", "kind": "property", "name": "content", "apiVersions": [ @@ -5732,7 +5698,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "449", + "$id": "445", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5760,7 +5726,7 @@ "isExactName": false }, { - "$id": "450", + "$id": "446", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -5770,7 +5736,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "266" + "$ref": "262" }, "optional": false, "readOnly": false, @@ -5795,7 +5761,7 @@ "isExactName": false }, { - "$id": "451", + "$id": "447", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -5805,7 +5771,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "289" + "$ref": "285" }, "optional": false, "readOnly": false, @@ -5830,7 +5796,7 @@ "isExactName": false }, { - "$id": "452", + "$id": "448", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -5840,11 +5806,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "453", + "$id": "449", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "454", + "$id": "450", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -5873,7 +5839,7 @@ "isExactName": false, "properties": [ { - "$id": "455", + "$id": "451", "kind": "property", "name": "itemName", "apiVersions": [ @@ -5883,7 +5849,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "456", + "$id": "452", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5906,7 +5872,7 @@ "isExactName": false }, { - "$id": "457", + "$id": "453", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -5916,7 +5882,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "458", + "$id": "454", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5939,7 +5905,7 @@ "isExactName": false }, { - "$id": "459", + "$id": "455", "kind": "property", "name": "itemId", "apiVersions": [ @@ -5949,7 +5915,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "460", + "$id": "456", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6004,7 +5970,7 @@ "isExactName": false }, { - "$id": "461", + "$id": "457", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -6014,7 +5980,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "266" + "$ref": "262" }, "optional": false, "readOnly": false, @@ -6034,7 +6000,7 @@ "isExactName": false }, { - "$id": "462", + "$id": "458", "kind": "property", "name": "items", "apiVersions": [ @@ -6044,7 +6010,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "453" + "$ref": "449" }, "optional": false, "readOnly": false, @@ -6071,7 +6037,7 @@ "isExactName": false }, { - "$id": "463", + "$id": "459", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -6081,7 +6047,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "464", + "$id": "460", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -6103,7 +6069,7 @@ "isExactName": false, "properties": [ { - "$id": "465", + "$id": "461", "kind": "property", "name": "value", "apiVersions": [ @@ -6113,7 +6079,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "466", + "$id": "462", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6136,7 +6102,7 @@ "isExactName": false }, { - "$id": "467", + "$id": "463", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -6146,7 +6112,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "468", + "$id": "464", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6192,7 +6158,7 @@ "isExactName": false }, { - "$id": "469", + "$id": "465", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -6202,7 +6168,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "464" + "$ref": "460" }, "optional": true, "readOnly": false, @@ -6221,7 +6187,7 @@ "isExactName": false }, { - "$id": "470", + "$id": "466", "kind": "property", "name": "metadata", "apiVersions": [ @@ -6231,17 +6197,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "471", + "$id": "467", "kind": "dict", "keyType": { - "$id": "472", + "$id": "468", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "473", + "$id": "469", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6266,7 +6232,7 @@ "isExactName": false }, { - "$id": "474", + "$id": "470", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -6276,12 +6242,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "475", + "$id": "471", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "476", + "$id": "472", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6307,7 +6273,7 @@ "isExactName": false }, { - "$id": "477", + "$id": "473", "kind": "property", "name": "duration", "apiVersions": [ @@ -6317,12 +6283,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "478", + "$id": "474", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "479", + "$id": "475", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6348,7 +6314,7 @@ "isExactName": false }, { - "$id": "480", + "$id": "476", "kind": "property", "name": "data", "apiVersions": [ @@ -6358,7 +6324,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "481", + "$id": "477", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -6382,7 +6348,7 @@ "isExactName": false }, { - "$id": "482", + "$id": "478", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -6392,7 +6358,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "326" + "$ref": "322" }, "optional": true, "readOnly": false, @@ -6411,7 +6377,7 @@ "isExactName": false }, { - "$id": "483", + "$id": "479", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -6440,7 +6406,7 @@ "isExactName": false }, { - "$id": "484", + "$id": "480", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -6469,7 +6435,7 @@ "isExactName": false }, { - "$id": "485", + "$id": "481", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -6498,7 +6464,7 @@ "isExactName": false }, { - "$id": "486", + "$id": "482", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -6527,7 +6493,7 @@ "isExactName": false }, { - "$id": "487", + "$id": "483", "kind": "property", "name": "label", "apiVersions": [ @@ -6536,7 +6502,7 @@ ], "serializedName": "label", "type": { - "$id": "488", + "$id": "484", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6551,14 +6517,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "489", + "$id": "485", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "490", + "$id": "486", "kind": "enum", "decorators": [ { @@ -6571,7 +6537,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "491", + "$id": "487", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -6580,32 +6546,32 @@ }, "values": [ { - "$id": "492", + "$id": "488", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "490" + "$ref": "486" }, "valueType": { - "$ref": "491" + "$ref": "487" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "493", + "$id": "489", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "490" + "$ref": "486" }, "valueType": { - "$ref": "491" + "$ref": "487" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6623,7 +6589,7 @@ "__accessSet": true }, "valueType": { - "$ref": "491" + "$ref": "487" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -6650,7 +6616,7 @@ "isExactName": false }, { - "$id": "494", + "$id": "490", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -6659,7 +6625,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "495", + "$id": "491", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6674,17 +6640,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "496", + "$id": "492", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "490" + "$ref": "486" }, "valueType": { - "$ref": "491" + "$ref": "487" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6707,7 +6673,7 @@ "isExactName": false }, { - "$id": "497", + "$id": "493", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -6716,7 +6682,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "266" + "$ref": "262" }, "optional": false, "readOnly": false, @@ -6748,7 +6714,7 @@ "isExactName": false }, { - "$id": "498", + "$id": "494", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -6757,7 +6723,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "464" + "$ref": "460" }, "optional": false, "readOnly": false, @@ -6788,7 +6754,7 @@ "isExactName": false }, { - "$id": "499", + "$id": "495", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -6797,11 +6763,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "500", + "$id": "496", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "501", + "$id": "497", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -6834,7 +6800,7 @@ "isExactName": false, "properties": [ { - "$id": "502", + "$id": "498", "kind": "property", "name": "foo", "apiVersions": [ @@ -6843,7 +6809,7 @@ ], "serializedName": "foo", "type": { - "$id": "503", + "$id": "499", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6892,7 +6858,7 @@ "isExactName": false }, { - "$id": "504", + "$id": "500", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -6901,7 +6867,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "500" + "$ref": "496" }, "optional": false, "readOnly": false, @@ -6926,7 +6892,7 @@ "isExactName": false }, { - "$id": "505", + "$id": "501", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6935,11 +6901,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "506", + "$id": "502", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "453" + "$ref": "449" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6962,7 +6928,7 @@ "isExactName": false }, { - "$id": "507", + "$id": "503", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -6971,17 +6937,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "508", + "$id": "504", "kind": "dict", "keyType": { - "$id": "509", + "$id": "505", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "454" + "$ref": "450" }, "decorators": [] }, @@ -7002,7 +6968,7 @@ "isExactName": false }, { - "$id": "510", + "$id": "506", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -7011,17 +6977,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "511", + "$id": "507", "kind": "dict", "keyType": { - "$id": "512", + "$id": "508", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "508" + "$ref": "504" }, "decorators": [] }, @@ -7042,7 +7008,7 @@ "isExactName": false }, { - "$id": "513", + "$id": "509", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7051,17 +7017,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "514", + "$id": "510", "kind": "dict", "keyType": { - "$id": "515", + "$id": "511", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "453" + "$ref": "449" }, "decorators": [] }, @@ -7082,7 +7048,7 @@ "isExactName": false }, { - "$id": "516", + "$id": "512", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -7091,11 +7057,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "517", + "$id": "513", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "508" + "$ref": "504" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7120,16 +7086,16 @@ ] }, { - "$ref": "454" + "$ref": "450" }, { - "$ref": "464" + "$ref": "460" }, { - "$ref": "501" + "$ref": "497" }, { - "$id": "518", + "$id": "514", "kind": "model", "name": "Cat", "apiVersions": [ @@ -7144,7 +7110,7 @@ "isExactName": false, "properties": [ { - "$id": "519", + "$id": "515", "kind": "property", "name": "id", "apiVersions": [ @@ -7153,7 +7119,7 @@ ], "serializedName": "id", "type": { - "$id": "520", + "$id": "516", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7180,7 +7146,7 @@ "isExactName": false }, { - "$id": "521", + "$id": "517", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -7189,7 +7155,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "522", + "$id": "518", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -7216,7 +7182,7 @@ "isExactName": false }, { - "$id": "523", + "$id": "519", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -7225,7 +7191,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "524", + "$id": "520", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7252,7 +7218,7 @@ "isExactName": false }, { - "$id": "525", + "$id": "521", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -7261,7 +7227,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "526", + "$id": "522", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -7288,7 +7254,7 @@ "isExactName": false }, { - "$id": "527", + "$id": "523", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -7297,7 +7263,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "528", + "$id": "524", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -7324,7 +7290,7 @@ "isExactName": false }, { - "$id": "529", + "$id": "525", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -7333,7 +7299,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "530", + "$id": "526", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -7360,7 +7326,7 @@ "isExactName": false }, { - "$id": "531", + "$id": "527", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -7369,7 +7335,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "532", + "$id": "528", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -7396,7 +7362,7 @@ "isExactName": false }, { - "$id": "533", + "$id": "529", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -7405,7 +7371,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "534", + "$id": "530", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -7432,7 +7398,7 @@ "isExactName": false }, { - "$id": "535", + "$id": "531", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -7441,7 +7407,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "536", + "$id": "532", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -7468,7 +7434,7 @@ "isExactName": false }, { - "$id": "537", + "$id": "533", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -7477,7 +7443,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "471" + "$ref": "467" }, "optional": false, "readOnly": false, @@ -7500,7 +7466,7 @@ "isExactName": false }, { - "$id": "538", + "$id": "534", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -7509,17 +7475,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "539", + "$id": "535", "kind": "dict", "keyType": { - "$id": "540", + "$id": "536", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "260" + "$ref": "256" }, "decorators": [] }, @@ -7544,7 +7510,7 @@ "isExactName": false }, { - "$id": "541", + "$id": "537", "kind": "property", "name": "listPart", "apiVersions": [ @@ -7553,7 +7519,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "266" + "$ref": "262" }, "optional": false, "readOnly": false, @@ -7576,7 +7542,7 @@ "isExactName": false }, { - "$id": "542", + "$id": "538", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -7585,7 +7551,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "358" + "$ref": "354" }, "optional": false, "readOnly": false, @@ -7608,7 +7574,7 @@ "isExactName": false }, { - "$id": "543", + "$id": "539", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -7617,11 +7583,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "544", + "$id": "540", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "545", + "$id": "541", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7651,7 +7617,7 @@ "isExactName": false }, { - "$id": "546", + "$id": "542", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -7660,7 +7626,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "547", + "$id": "543", "kind": "model", "name": "File", "apiVersions": [], @@ -7675,14 +7641,14 @@ "isFileType": true, "properties": [ { - "$id": "548", + "$id": "544", "kind": "property", "name": "contentType", "apiVersions": [], "summary": "The allowed media (MIME) types of the file contents.", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "type": { - "$id": "549", + "$id": "545", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7699,14 +7665,14 @@ "isExactName": false }, { - "$id": "550", + "$id": "546", "kind": "property", "name": "filename", "apiVersions": [], "summary": "The name of the file, if any.", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "type": { - "$id": "551", + "$id": "547", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7723,14 +7689,14 @@ "isExactName": false }, { - "$id": "552", + "$id": "548", "kind": "property", "name": "contents", "apiVersions": [], "summary": "The contents of the file.", "doc": "The contents of the file.\n\nIn file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,\nthis value is serialized as a field in the response.", "type": { - "$id": "553", + "$id": "549", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7760,12 +7726,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "554", + "$id": "550", "doc": "The name of the file, if any.\n\nIn file bodies, this value comes from the `filename` parameter of the `Content-Disposition` header of the response\nor multipart payload. In JSON bodies, this value is serialized as a field in the response.\n\nNOTE: By default, `filename` cannot be sent in request payloads and can only be sent in responses and multipart\npayloads, as the `Content-Disposition` header is not valid in requests. If you want to send the `filename` in a request,\nyou must extend the `File` model and override the `filename` property with a different location defined by HTTP metadata\ndecorators.", "summary": "The name of the file, if any.", "apiVersions": [], "type": { - "$id": "555", + "$id": "551", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7796,12 +7762,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "556", + "$id": "552", "doc": "The allowed media (MIME) types of the file contents.\n\nIn file bodies, this value comes from the `Content-Type` header of the request or response. In JSON bodies,\nthis value is serialized as a field in the response.\n\nNOTE: this is not _necessarily_ the same as the `Content-Type` header of the request or response, but\nit will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the\n_contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.", "summary": "The allowed media (MIME) types of the file contents.", "apiVersions": [], "type": { - "$id": "557", + "$id": "553", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7842,7 +7808,7 @@ "isExactName": false }, { - "$id": "558", + "$id": "554", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -7874,7 +7840,7 @@ "isExactName": false }, { - "$id": "559", + "$id": "555", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -7906,7 +7872,7 @@ "isExactName": false }, { - "$id": "560", + "$id": "556", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -7938,7 +7904,7 @@ "isExactName": false }, { - "$id": "561", + "$id": "557", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -7972,7 +7938,7 @@ ] }, { - "$id": "562", + "$id": "558", "kind": "model", "name": "File", "apiVersions": [], @@ -7987,18 +7953,18 @@ "isFileType": true, "properties": [ { - "$ref": "548" + "$ref": "544" }, { - "$ref": "550" + "$ref": "546" }, { - "$ref": "552" + "$ref": "548" } ] }, { - "$id": "563", + "$id": "559", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -8017,7 +7983,7 @@ "isExactName": false, "properties": [ { - "$id": "564", + "$id": "560", "kind": "property", "name": "message", "apiVersions": [ @@ -8026,7 +7992,7 @@ ], "serializedName": "message", "type": { - "$id": "565", + "$id": "561", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8049,7 +8015,7 @@ ] }, { - "$id": "566", + "$id": "562", "kind": "model", "name": "Animal", "apiVersions": [ @@ -8068,7 +8034,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "567", + "$id": "563", "kind": "property", "name": "kind", "apiVersions": [ @@ -8078,7 +8044,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "568", + "$id": "564", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8100,10 +8066,10 @@ }, "properties": [ { - "$ref": "567" + "$ref": "563" }, { - "$id": "569", + "$id": "565", "kind": "property", "name": "name", "apiVersions": [ @@ -8113,7 +8079,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "570", + "$id": "566", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8136,7 +8102,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "571", + "$id": "567", "kind": "model", "name": "Pet", "apiVersions": [ @@ -8156,7 +8122,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "572", + "$id": "568", "kind": "property", "name": "kind", "apiVersions": [ @@ -8182,14 +8148,14 @@ "isExactName": false }, "baseModel": { - "$ref": "566" + "$ref": "562" }, "properties": [ { - "$ref": "572" + "$ref": "568" }, { - "$id": "573", + "$id": "569", "kind": "property", "name": "trained", "apiVersions": [ @@ -8199,7 +8165,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "574", + "$id": "570", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8222,7 +8188,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "575", + "$id": "571", "kind": "model", "name": "Dog", "apiVersions": [ @@ -8242,11 +8208,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "571" + "$ref": "567" }, "properties": [ { - "$id": "576", + "$id": "572", "kind": "property", "name": "kind", "apiVersions": [ @@ -8272,7 +8238,7 @@ "isExactName": false }, { - "$id": "577", + "$id": "573", "kind": "property", "name": "breed", "apiVersions": [ @@ -8282,7 +8248,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "578", + "$id": "574", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8307,18 +8273,18 @@ } }, "dog": { - "$ref": "575" + "$ref": "571" } } }, { - "$ref": "571" + "$ref": "567" }, { - "$ref": "575" + "$ref": "571" }, { - "$id": "579", + "$id": "575", "kind": "model", "name": "Tree", "apiVersions": [ @@ -8343,7 +8309,7 @@ }, "isExactName": false, "baseModel": { - "$id": "580", + "$id": "576", "kind": "model", "name": "Plant", "apiVersions": [ @@ -8367,7 +8333,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "581", + "$id": "577", "kind": "property", "name": "species", "apiVersions": [ @@ -8377,7 +8343,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "582", + "$id": "578", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8404,10 +8370,10 @@ }, "properties": [ { - "$ref": "581" + "$ref": "577" }, { - "$id": "583", + "$id": "579", "kind": "property", "name": "id", "apiVersions": [ @@ -8417,7 +8383,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "584", + "$id": "580", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8443,7 +8409,7 @@ "isExactName": false }, { - "$id": "585", + "$id": "581", "kind": "property", "name": "height", "apiVersions": [ @@ -8453,7 +8419,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "586", + "$id": "582", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8481,13 +8447,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "579" + "$ref": "575" } } }, "properties": [ { - "$id": "587", + "$id": "583", "kind": "property", "name": "species", "apiVersions": [ @@ -8518,7 +8484,7 @@ "isExactName": false }, { - "$id": "588", + "$id": "584", "kind": "property", "name": "age", "apiVersions": [ @@ -8528,7 +8494,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "589", + "$id": "585", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8556,10 +8522,10 @@ ] }, { - "$ref": "580" + "$ref": "576" }, { - "$id": "590", + "$id": "586", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -8578,7 +8544,7 @@ "isExactName": false, "properties": [ { - "$id": "591", + "$id": "587", "kind": "property", "name": "numSold", "apiVersions": [ @@ -8587,7 +8553,7 @@ ], "serializedName": "numSold", "type": { - "$id": "592", + "$id": "588", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8608,7 +8574,7 @@ "isExactName": false }, { - "$id": "593", + "$id": "589", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -8617,7 +8583,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "594", + "$id": "590", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8640,7 +8606,7 @@ ] }, { - "$id": "595", + "$id": "591", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -8659,7 +8625,7 @@ "isExactName": false, "properties": [ { - "$id": "596", + "$id": "592", "kind": "property", "name": "name", "apiVersions": [ @@ -8668,7 +8634,7 @@ ], "serializedName": "name", "type": { - "$id": "597", + "$id": "593", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8689,7 +8655,7 @@ "isExactName": false }, { - "$id": "598", + "$id": "594", "kind": "property", "name": "content", "apiVersions": [ @@ -8698,7 +8664,7 @@ ], "serializedName": "content", "type": { - "$id": "599", + "$id": "595", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8721,7 +8687,7 @@ ] }, { - "$id": "600", + "$id": "596", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -8746,7 +8712,7 @@ "isExactName": false, "properties": [ { - "$id": "601", + "$id": "597", "kind": "property", "name": "modelValue", "apiVersions": [ @@ -8755,10 +8721,10 @@ ], "serializedName": "modelValue", "type": { - "$id": "602", + "$id": "598", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -8777,7 +8743,7 @@ "isExactName": false }, { - "$id": "603", + "$id": "599", "kind": "property", "name": "children", "apiVersions": [ @@ -8786,17 +8752,17 @@ ], "serializedName": "children", "type": { - "$id": "604", + "$id": "600", "kind": "nullable", "type": { - "$id": "605", + "$id": "601", "kind": "array", "name": "Array2", "valueType": { - "$id": "606", + "$id": "602", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -8820,7 +8786,7 @@ "isExactName": false }, { - "$id": "607", + "$id": "603", "kind": "property", "name": "childDictionary", "apiVersions": [ @@ -8829,23 +8795,23 @@ ], "serializedName": "childDictionary", "type": { - "$id": "608", + "$id": "604", "kind": "nullable", "type": { - "$id": "609", + "$id": "605", "kind": "dict", "keyType": { - "$id": "610", + "$id": "606", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "611", + "$id": "607", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -8868,7 +8834,7 @@ "isExactName": false }, { - "$id": "612", + "$id": "608", "kind": "property", "name": "nestedChildren", "apiVersions": [ @@ -8877,24 +8843,24 @@ ], "serializedName": "nestedChildren", "type": { - "$id": "613", + "$id": "609", "kind": "nullable", "type": { - "$id": "614", + "$id": "610", "kind": "array", "name": "Array3", "valueType": { - "$id": "615", + "$id": "611", "kind": "nullable", "type": { - "$id": "616", + "$id": "612", "kind": "array", "name": "Array4", "valueType": { - "$id": "617", + "$id": "613", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -8923,7 +8889,7 @@ "isExactName": false }, { - "$id": "618", + "$id": "614", "kind": "property", "name": "nestedChildDictionary", "apiVersions": [ @@ -8932,36 +8898,36 @@ ], "serializedName": "nestedChildDictionary", "type": { - "$id": "619", + "$id": "615", "kind": "nullable", "type": { - "$id": "620", + "$id": "616", "kind": "dict", "keyType": { - "$id": "621", + "$id": "617", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "622", + "$id": "618", "kind": "nullable", "type": { - "$id": "623", + "$id": "619", "kind": "dict", "keyType": { - "$id": "624", + "$id": "620", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "625", + "$id": "621", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -8988,7 +8954,7 @@ "isExactName": false }, { - "$id": "626", + "$id": "622", "kind": "property", "name": "dictionaryChildren", "apiVersions": [ @@ -8997,30 +8963,30 @@ ], "serializedName": "dictionaryChildren", "type": { - "$id": "627", + "$id": "623", "kind": "nullable", "type": { - "$id": "628", + "$id": "624", "kind": "dict", "keyType": { - "$id": "629", + "$id": "625", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "630", + "$id": "626", "kind": "nullable", "type": { - "$id": "631", + "$id": "627", "kind": "array", "name": "Array5", "valueType": { - "$id": "632", + "$id": "628", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -9048,7 +9014,7 @@ "isExactName": false }, { - "$id": "633", + "$id": "629", "kind": "property", "name": "listOfDictionaries", "apiVersions": [ @@ -9057,30 +9023,30 @@ ], "serializedName": "listOfDictionaries", "type": { - "$id": "634", + "$id": "630", "kind": "nullable", "type": { - "$id": "635", + "$id": "631", "kind": "array", "name": "Array6", "valueType": { - "$id": "636", + "$id": "632", "kind": "nullable", "type": { - "$id": "637", + "$id": "633", "kind": "dict", "keyType": { - "$id": "638", + "$id": "634", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "639", + "$id": "635", "kind": "nullable", "type": { - "$ref": "404" + "$ref": "400" }, "namespace": "SampleTypeSpec" }, @@ -9110,7 +9076,7 @@ ] }, { - "$id": "640", + "$id": "636", "kind": "model", "name": "JsonlStreamStreamingItem", "apiVersions": [], @@ -9123,7 +9089,7 @@ "isExactName": false, "properties": [ { - "$id": "641", + "$id": "637", "kind": "property", "name": "contentType", "apiVersions": [ @@ -9144,7 +9110,7 @@ "isExactName": false }, { - "$id": "642", + "$id": "638", "kind": "property", "name": "body", "apiVersions": [ @@ -9152,7 +9118,7 @@ "2024-08-16-preview" ], "type": { - "$id": "643", + "$id": "639", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "", @@ -9173,7 +9139,7 @@ ], "clients": [ { - "$id": "644", + "$id": "640", "kind": "client", "name": "SampleTypeSpecClient", "isExactName": false, @@ -9181,7 +9147,7 @@ "doc": "This is a sample typespec project.", "methods": [ { - "$id": "645", + "$id": "641", "kind": "basic", "name": "sayHi", "isExactName": false, @@ -9192,7 +9158,7 @@ ], "doc": "Return hi", "operation": { - "$id": "646", + "$id": "642", "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9200,12 +9166,12 @@ "accessibility": "public", "parameters": [ { - "$id": "647", + "$id": "643", "kind": "header", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "648", + "$id": "644", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9220,12 +9186,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "649", + "$id": "645", "kind": "method", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "650", + "$id": "646", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9245,12 +9211,12 @@ "isExactName": false }, { - "$id": "651", + "$id": "647", "kind": "query", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "652", + "$id": "648", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9265,12 +9231,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "653", + "$id": "649", "kind": "method", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "654", + "$id": "650", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9290,12 +9256,12 @@ "isExactName": false }, { - "$id": "655", + "$id": "651", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "656", + "$id": "652", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9310,12 +9276,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "657", + "$id": "653", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "658", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9335,7 +9301,7 @@ "isExactName": false }, { - "$id": "659", + "$id": "655", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9351,7 +9317,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "methodParameterSegments": [ { - "$id": "660", + "$id": "656", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9378,7 +9344,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -9404,21 +9370,21 @@ }, "parameters": [ { - "$ref": "649" + "$ref": "645" }, { - "$ref": "653" + "$ref": "649" }, { - "$ref": "657" + "$ref": "653" }, { - "$ref": "660" + "$ref": "656" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -9427,7 +9393,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "661", + "$id": "657", "kind": "basic", "name": "helloAgain", "isExactName": false, @@ -9438,7 +9404,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "662", + "$id": "658", "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9446,12 +9412,12 @@ "accessibility": "public", "parameters": [ { - "$id": "663", + "$id": "659", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "664", + "$id": "660", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9466,12 +9432,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "665", + "$id": "661", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "666", + "$id": "662", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9491,7 +9457,7 @@ "isExactName": false }, { - "$id": "667", + "$id": "663", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9507,7 +9473,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", "methodParameterSegments": [ { - "$id": "668", + "$id": "664", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9528,12 +9494,12 @@ "isExactName": false }, { - "$id": "669", + "$id": "665", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "670", + "$id": "666", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9551,12 +9517,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "671", + "$id": "667", "kind": "method", "name": "p2", "serializedName": "p2", "type": { - "$id": "672", + "$id": "668", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9576,7 +9542,7 @@ "isExactName": false }, { - "$id": "673", + "$id": "669", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9592,7 +9558,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "674", + "$id": "670", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9613,12 +9579,12 @@ "isExactName": false }, { - "$id": "675", + "$id": "671", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "291" }, "isApiVersion": false, "contentTypes": [ @@ -9632,12 +9598,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", "methodParameterSegments": [ { - "$id": "676", + "$id": "672", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "291" }, "location": "Body", "isApiVersion": false, @@ -9660,7 +9626,7 @@ 200 ], "bodyType": { - "$ref": "295" + "$ref": "291" }, "headers": [], "isErrorResponse": false, @@ -9689,24 +9655,24 @@ }, "parameters": [ { - "$ref": "665" + "$ref": "661" }, { - "$ref": "676" + "$ref": "672" }, { - "$ref": "668" + "$ref": "664" }, { - "$ref": "671" + "$ref": "667" }, { - "$ref": "674" + "$ref": "670" } ], "response": { "type": { - "$ref": "295" + "$ref": "291" } }, "isOverride": false, @@ -9715,7 +9681,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "677", + "$id": "673", "kind": "basic", "name": "noContentType", "isExactName": false, @@ -9726,7 +9692,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "678", + "$id": "674", "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9734,12 +9700,12 @@ "accessibility": "public", "parameters": [ { - "$id": "679", + "$id": "675", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "680", + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9754,12 +9720,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "681", + "$id": "677", "kind": "method", "name": "info", "serializedName": "info", "type": { - "$ref": "343" + "$ref": "339" }, "location": "", "isApiVersion": false, @@ -9772,13 +9738,13 @@ "isExactName": false }, { - "$id": "682", + "$id": "678", "kind": "method", "name": "p1", "serializedName": "p1", "doc": "header parameter", "type": { - "$ref": "345" + "$ref": "341" }, "location": "", "isApiVersion": false, @@ -9794,12 +9760,12 @@ "isExactName": false }, { - "$id": "683", + "$id": "679", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "684", + "$id": "680", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9817,16 +9783,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "681" + "$ref": "677" }, { - "$id": "685", + "$id": "681", "kind": "method", "name": "p2", "serializedName": "p2", "doc": "path parameter", "type": { - "$ref": "348" + "$ref": "344" }, "location": "", "isApiVersion": false, @@ -9842,7 +9808,7 @@ "isExactName": false }, { - "$id": "686", + "$id": "682", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9859,7 +9825,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "687", + "$id": "683", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9881,7 +9847,7 @@ "isExactName": false }, { - "$id": "688", + "$id": "684", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9897,7 +9863,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "689", + "$id": "685", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9918,12 +9884,12 @@ "isExactName": false }, { - "$id": "690", + "$id": "686", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "295" + "$ref": "291" }, "isApiVersion": false, "contentTypes": [ @@ -9937,16 +9903,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", "methodParameterSegments": [ { - "$ref": "681" + "$ref": "677" }, { - "$id": "691", + "$id": "687", "kind": "method", "name": "action", "serializedName": "action", "doc": "body parameter", "type": { - "$ref": "295" + "$ref": "291" }, "location": "", "isApiVersion": false, @@ -9973,7 +9939,7 @@ 200 ], "bodyType": { - "$ref": "295" + "$ref": "291" }, "headers": [], "isErrorResponse": false, @@ -10002,18 +9968,18 @@ }, "parameters": [ { - "$ref": "681" + "$ref": "677" }, { - "$ref": "687" + "$ref": "683" }, { - "$ref": "689" + "$ref": "685" } ], "response": { "type": { - "$ref": "295" + "$ref": "291" } }, "isOverride": true, @@ -10022,7 +9988,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "692", + "$id": "688", "kind": "basic", "name": "helloDemo2", "isExactName": false, @@ -10033,7 +9999,7 @@ ], "doc": "Return hi in demo2", "operation": { - "$id": "693", + "$id": "689", "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10041,7 +10007,7 @@ "accessibility": "public", "parameters": [ { - "$id": "694", + "$id": "690", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10057,7 +10023,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "695", + "$id": "691", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10084,7 +10050,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10110,12 +10076,12 @@ }, "parameters": [ { - "$ref": "695" + "$ref": "691" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -10124,7 +10090,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "696", + "$id": "692", "kind": "basic", "name": "createLiteral", "isExactName": false, @@ -10135,7 +10101,7 @@ ], "doc": "Create with literal value", "operation": { - "$id": "697", + "$id": "693", "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10143,7 +10109,7 @@ "accessibility": "public", "parameters": [ { - "$id": "698", + "$id": "694", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10160,7 +10126,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", "methodParameterSegments": [ { - "$id": "699", + "$id": "695", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10182,7 +10148,7 @@ "isExactName": false }, { - "$id": "700", + "$id": "696", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10198,7 +10164,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "701", + "$id": "697", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10219,12 +10185,12 @@ "isExactName": false }, { - "$id": "702", + "$id": "698", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "isApiVersion": false, "contentTypes": [ @@ -10238,12 +10204,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", "methodParameterSegments": [ { - "$id": "703", + "$id": "699", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "location": "Body", "isApiVersion": false, @@ -10270,7 +10236,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10299,18 +10265,18 @@ }, "parameters": [ { - "$ref": "703" + "$ref": "699" }, { - "$ref": "699" + "$ref": "695" }, { - "$ref": "701" + "$ref": "697" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -10319,7 +10285,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "704", + "$id": "700", "kind": "basic", "name": "helloLiteral", "isExactName": false, @@ -10330,7 +10296,7 @@ ], "doc": "Send literal parameters", "operation": { - "$id": "705", + "$id": "701", "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10338,7 +10304,7 @@ "accessibility": "public", "parameters": [ { - "$id": "706", + "$id": "702", "kind": "header", "name": "p1", "serializedName": "p1", @@ -10354,7 +10320,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "707", + "$id": "703", "kind": "method", "name": "p1", "serializedName": "p1", @@ -10375,7 +10341,7 @@ "isExactName": false }, { - "$id": "708", + "$id": "704", "kind": "path", "name": "p2", "serializedName": "p2", @@ -10394,7 +10360,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$id": "709", + "$id": "705", "kind": "method", "name": "p2", "serializedName": "p2", @@ -10415,7 +10381,7 @@ "isExactName": false }, { - "$id": "710", + "$id": "706", "kind": "query", "name": "p3", "serializedName": "p3", @@ -10431,7 +10397,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "711", + "$id": "707", "kind": "method", "name": "p3", "serializedName": "p3", @@ -10452,7 +10418,7 @@ "isExactName": false }, { - "$id": "712", + "$id": "708", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10468,7 +10434,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "713", + "$id": "709", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10495,7 +10461,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10521,21 +10487,21 @@ }, "parameters": [ { - "$ref": "707" + "$ref": "703" }, { - "$ref": "709" + "$ref": "705" }, { - "$ref": "711" + "$ref": "707" }, { - "$ref": "713" + "$ref": "709" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -10544,7 +10510,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "714", + "$id": "710", "kind": "basic", "name": "topAction", "isExactName": false, @@ -10555,7 +10521,7 @@ ], "doc": "top level method", "operation": { - "$id": "715", + "$id": "711", "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10563,17 +10529,17 @@ "accessibility": "public", "parameters": [ { - "$id": "716", + "$id": "712", "kind": "path", "name": "action", "serializedName": "action", "type": { - "$id": "717", + "$id": "713", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "718", + "$id": "714", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10594,17 +10560,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "719", + "$id": "715", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$id": "720", + "$id": "716", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "721", + "$id": "717", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10627,7 +10593,7 @@ "isExactName": false }, { - "$id": "722", + "$id": "718", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10643,7 +10609,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "723", + "$id": "719", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10670,7 +10636,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10696,15 +10662,15 @@ }, "parameters": [ { - "$ref": "719" + "$ref": "715" }, { - "$ref": "723" + "$ref": "719" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -10713,7 +10679,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "724", + "$id": "720", "kind": "basic", "name": "topAction2", "isExactName": false, @@ -10724,7 +10690,7 @@ ], "doc": "top level method2", "operation": { - "$id": "725", + "$id": "721", "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10732,7 +10698,7 @@ "accessibility": "public", "parameters": [ { - "$id": "726", + "$id": "722", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10748,7 +10714,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "727", + "$id": "723", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10775,7 +10741,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10801,12 +10767,12 @@ }, "parameters": [ { - "$ref": "727" + "$ref": "723" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -10815,7 +10781,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "728", + "$id": "724", "kind": "basic", "name": "patchAction", "isExactName": false, @@ -10826,7 +10792,7 @@ ], "doc": "top level patch", "operation": { - "$id": "729", + "$id": "725", "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10834,7 +10800,7 @@ "accessibility": "public", "parameters": [ { - "$id": "730", + "$id": "726", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10851,7 +10817,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "731", + "$id": "727", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10873,7 +10839,7 @@ "isExactName": false }, { - "$id": "732", + "$id": "728", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10889,7 +10855,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "733", + "$id": "729", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10910,12 +10876,12 @@ "isExactName": false }, { - "$id": "734", + "$id": "730", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "isApiVersion": false, "contentTypes": [ @@ -10929,12 +10895,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "735", + "$id": "731", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "location": "Body", "isApiVersion": false, @@ -10961,7 +10927,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -10990,18 +10956,18 @@ }, "parameters": [ { - "$ref": "735" + "$ref": "731" }, { - "$ref": "731" + "$ref": "727" }, { - "$ref": "733" + "$ref": "729" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -11010,7 +10976,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "736", + "$id": "732", "kind": "basic", "name": "anonymousBody", "isExactName": false, @@ -11021,7 +10987,7 @@ ], "doc": "body parameter without body decorator", "operation": { - "$id": "737", + "$id": "733", "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11029,7 +10995,7 @@ "accessibility": "public", "parameters": [ { - "$id": "738", + "$id": "734", "kind": "query", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11045,7 +11011,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "739", + "$id": "735", "kind": "method", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11066,7 +11032,7 @@ "isExactName": false }, { - "$id": "740", + "$id": "736", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", @@ -11082,7 +11048,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", "methodParameterSegments": [ { - "$id": "741", + "$id": "737", "kind": "method", "name": "requiredHeader", "serializedName": "required-header", @@ -11103,7 +11069,7 @@ "isExactName": false }, { - "$id": "742", + "$id": "738", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11120,7 +11086,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "743", + "$id": "739", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11142,7 +11108,7 @@ "isExactName": false }, { - "$id": "744", + "$id": "740", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11158,7 +11124,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "methodParameterSegments": [ { - "$id": "745", + "$id": "741", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11179,12 +11145,12 @@ "isExactName": false }, { - "$id": "746", + "$id": "742", "kind": "body", "name": "thing", "serializedName": "thing", "type": { - "$ref": "260" + "$ref": "256" }, "isApiVersion": false, "contentTypes": [ @@ -11198,13 +11164,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "747", + "$id": "743", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "748", + "$id": "744", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11235,7 +11201,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -11264,16 +11230,16 @@ }, "parameters": [ { - "$ref": "747" + "$ref": "743" }, { - "$id": "749", + "$id": "745", "kind": "method", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$ref": "264" + "$ref": "260" }, "location": "Body", "isApiVersion": false, @@ -11286,7 +11252,7 @@ "isExactName": false }, { - "$id": "750", + "$id": "746", "kind": "method", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", @@ -11305,13 +11271,13 @@ "isExactName": false }, { - "$id": "751", + "$id": "747", "kind": "method", "name": "requiredNullableString", "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$ref": "271" + "$ref": "267" }, "location": "Body", "isApiVersion": false, @@ -11324,13 +11290,13 @@ "isExactName": false }, { - "$id": "752", + "$id": "748", "kind": "method", "name": "optionalNullableString", "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$ref": "274" + "$ref": "270" }, "location": "Body", "isApiVersion": false, @@ -11343,7 +11309,7 @@ "isExactName": false }, { - "$id": "753", + "$id": "749", "kind": "method", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", @@ -11362,7 +11328,7 @@ "isExactName": false }, { - "$id": "754", + "$id": "750", "kind": "method", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", @@ -11381,7 +11347,7 @@ "isExactName": false }, { - "$id": "755", + "$id": "751", "kind": "method", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", @@ -11400,19 +11366,19 @@ "isExactName": false }, { - "$id": "756", + "$id": "752", "kind": "method", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "757", + "$id": "753", "kind": "enum", "name": "ThingOptionalLiteralString", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "758", + "$id": "754", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11420,12 +11386,12 @@ }, "values": [ { - "$id": "759", + "$id": "755", "kind": "enumvalue", "name": "reject", "value": "reject", "valueType": { - "$id": "760", + "$id": "756", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -11433,7 +11399,7 @@ "crossLanguageDefinitionId": "TypeSpec.string" }, "enumType": { - "$ref": "757" + "$ref": "753" }, "decorators": [], "isExactName": false @@ -11457,13 +11423,13 @@ "isExactName": false }, { - "$id": "761", + "$id": "757", "kind": "method", "name": "requiredNullableLiteralString", "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$ref": "281" + "$ref": "277" }, "location": "Body", "isApiVersion": false, @@ -11476,19 +11442,19 @@ "isExactName": false }, { - "$id": "762", + "$id": "758", "kind": "method", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "763", + "$id": "759", "kind": "enum", "name": "ThingOptionalLiteralInt", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "764", + "$id": "760", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -11496,12 +11462,12 @@ }, "values": [ { - "$id": "765", + "$id": "761", "kind": "enumvalue", "name": "456", "value": 456, "valueType": { - "$id": "766", + "$id": "762", "kind": "int32", "decorators": [], "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", @@ -11509,7 +11475,7 @@ "crossLanguageDefinitionId": "TypeSpec.int32" }, "enumType": { - "$ref": "763" + "$ref": "759" }, "decorators": [], "isExactName": false @@ -11533,19 +11499,19 @@ "isExactName": false }, { - "$id": "767", + "$id": "763", "kind": "method", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "768", + "$id": "764", "kind": "enum", "name": "ThingOptionalLiteralFloat", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "769", + "$id": "765", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -11553,12 +11519,12 @@ }, "values": [ { - "$id": "770", + "$id": "766", "kind": "enumvalue", "name": "4.56", "value": 4.56, "valueType": { - "$id": "771", + "$id": "767", "kind": "float32", "decorators": [], "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", @@ -11566,7 +11532,7 @@ "crossLanguageDefinitionId": "TypeSpec.float32" }, "enumType": { - "$ref": "768" + "$ref": "764" }, "decorators": [], "isExactName": false @@ -11590,7 +11556,7 @@ "isExactName": false }, { - "$id": "772", + "$id": "768", "kind": "method", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", @@ -11609,13 +11575,13 @@ "isExactName": false }, { - "$id": "773", + "$id": "769", "kind": "method", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "774", + "$id": "770", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11632,13 +11598,13 @@ "isExactName": false }, { - "$id": "775", + "$id": "771", "kind": "method", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$ref": "288" + "$ref": "284" }, "location": "Body", "isApiVersion": false, @@ -11651,13 +11617,13 @@ "isExactName": false }, { - "$id": "776", + "$id": "772", "kind": "method", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$ref": "292" + "$ref": "288" }, "location": "Body", "isApiVersion": false, @@ -11670,13 +11636,13 @@ "isExactName": false }, { - "$id": "777", + "$id": "773", "kind": "method", "name": "propertyWithSpecialDocs", "serializedName": "propertyWithSpecialDocs", "doc": "This tests:\n- Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet points within documentation comments. It should properly indent the wrapped lines.\n- Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting is preserved when the text wraps onto multiple lines in the generated documentation.\n- Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the wrapping and formatting are correctly applied in the output.\n- Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic formatting and is long enough to test the wrapping behavior in such cases.\n- **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how the bold formatting is maintained across wrapped lines.\n- *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that italic formatting is correctly applied even when the text spans multiple lines.", "type": { - "$id": "778", + "$id": "774", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11693,21 +11659,21 @@ "isExactName": false }, { - "$ref": "739" + "$ref": "735" }, { - "$ref": "741" + "$ref": "737" }, { - "$ref": "743" + "$ref": "739" }, { - "$ref": "745" + "$ref": "741" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -11716,7 +11682,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "779", + "$id": "775", "kind": "basic", "name": "friendlyModel", "isExactName": false, @@ -11727,7 +11693,7 @@ ], "doc": "Model can have its friendly name", "operation": { - "$id": "780", + "$id": "776", "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11735,7 +11701,7 @@ "accessibility": "public", "parameters": [ { - "$id": "781", + "$id": "777", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11752,7 +11718,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "782", + "$id": "778", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11774,7 +11740,7 @@ "isExactName": false }, { - "$id": "783", + "$id": "779", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11790,7 +11756,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "784", + "$id": "780", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11811,12 +11777,12 @@ "isExactName": false }, { - "$id": "785", + "$id": "781", "kind": "body", "name": "friend", "serializedName": "friend", "type": { - "$ref": "349" + "$ref": "345" }, "isApiVersion": false, "contentTypes": [ @@ -11830,13 +11796,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", "methodParameterSegments": [ { - "$id": "786", + "$id": "782", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "787", + "$id": "783", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11867,7 +11833,7 @@ 200 ], "bodyType": { - "$ref": "349" + "$ref": "345" }, "headers": [], "isErrorResponse": false, @@ -11896,18 +11862,18 @@ }, "parameters": [ { - "$ref": "786" + "$ref": "782" }, { - "$ref": "782" + "$ref": "778" }, { - "$ref": "784" + "$ref": "780" } ], "response": { "type": { - "$ref": "349" + "$ref": "345" } }, "isOverride": false, @@ -11916,7 +11882,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "788", + "$id": "784", "kind": "basic", "name": "addTimeHeader", "isExactName": false, @@ -11926,24 +11892,24 @@ "2024-08-16-preview" ], "operation": { - "$id": "789", + "$id": "785", "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "790", + "$id": "786", "kind": "header", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "791", + "$id": "787", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "792", + "$id": "788", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11961,17 +11927,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "793", + "$id": "789", "kind": "method", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "794", + "$id": "790", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "795", + "$id": "791", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12016,7 +11982,7 @@ }, "parameters": [ { - "$ref": "793" + "$ref": "789" } ], "response": {}, @@ -12026,7 +11992,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "796", + "$id": "792", "kind": "basic", "name": "projectedNameModel", "isExactName": false, @@ -12037,7 +12003,7 @@ ], "doc": "Model can have its projected name", "operation": { - "$id": "797", + "$id": "793", "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12045,7 +12011,7 @@ "accessibility": "public", "parameters": [ { - "$id": "798", + "$id": "794", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12062,7 +12028,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "799", + "$id": "795", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12084,7 +12050,7 @@ "isExactName": false }, { - "$id": "800", + "$id": "796", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12100,7 +12066,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "801", + "$id": "797", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12121,12 +12087,12 @@ "isExactName": false }, { - "$id": "802", + "$id": "798", "kind": "body", "name": "renamedModel", "serializedName": "renamedModel", "type": { - "$ref": "352" + "$ref": "348" }, "isApiVersion": false, "contentTypes": [ @@ -12140,13 +12106,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "803", + "$id": "799", "kind": "method", "name": "otherName", "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "804", + "$id": "800", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12177,7 +12143,7 @@ 200 ], "bodyType": { - "$ref": "352" + "$ref": "348" }, "headers": [], "isErrorResponse": false, @@ -12206,18 +12172,18 @@ }, "parameters": [ { - "$ref": "803" + "$ref": "799" }, { - "$ref": "799" + "$ref": "795" }, { - "$ref": "801" + "$ref": "797" } ], "response": { "type": { - "$ref": "352" + "$ref": "348" } }, "isOverride": false, @@ -12226,7 +12192,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "805", + "$id": "801", "kind": "basic", "name": "returnsAnonymousModel", "isExactName": false, @@ -12237,7 +12203,7 @@ ], "doc": "return anonymous model", "operation": { - "$id": "806", + "$id": "802", "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12245,7 +12211,7 @@ "accessibility": "public", "parameters": [ { - "$id": "807", + "$id": "803", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12261,7 +12227,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "808", + "$id": "804", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12288,7 +12254,7 @@ 200 ], "bodyType": { - "$ref": "355" + "$ref": "351" }, "headers": [], "isErrorResponse": false, @@ -12314,12 +12280,12 @@ }, "parameters": [ { - "$ref": "808" + "$ref": "804" } ], "response": { "type": { - "$ref": "355" + "$ref": "351" } }, "isOverride": false, @@ -12328,7 +12294,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$id": "809", + "$id": "805", "kind": "basic", "name": "getUnknownValue", "isExactName": false, @@ -12339,7 +12305,7 @@ ], "doc": "get extensible enum", "operation": { - "$id": "810", + "$id": "806", "name": "getUnknownValue", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12347,7 +12313,7 @@ "accessibility": "public", "parameters": [ { - "$id": "811", + "$id": "807", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12363,7 +12329,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "812", + "$id": "808", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12412,7 +12378,7 @@ }, "parameters": [ { - "$ref": "812" + "$ref": "808" } ], "response": { @@ -12426,7 +12392,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "813", + "$id": "809", "kind": "basic", "name": "internalProtocol", "isExactName": false, @@ -12437,7 +12403,7 @@ ], "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "814", + "$id": "810", "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12445,7 +12411,7 @@ "accessibility": "public", "parameters": [ { - "$id": "815", + "$id": "811", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12462,7 +12428,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "816", + "$id": "812", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12484,7 +12450,7 @@ "isExactName": false }, { - "$id": "817", + "$id": "813", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12500,7 +12466,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "818", + "$id": "814", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12521,12 +12487,12 @@ "isExactName": false }, { - "$id": "819", + "$id": "815", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "isApiVersion": false, "contentTypes": [ @@ -12540,12 +12506,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "820", + "$id": "816", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "260" + "$ref": "256" }, "location": "Body", "isApiVersion": false, @@ -12572,7 +12538,7 @@ 200 ], "bodyType": { - "$ref": "260" + "$ref": "256" }, "headers": [], "isErrorResponse": false, @@ -12601,18 +12567,18 @@ }, "parameters": [ { - "$ref": "820" + "$ref": "816" }, { - "$ref": "816" + "$ref": "812" }, { - "$ref": "818" + "$ref": "814" } ], "response": { "type": { - "$ref": "260" + "$ref": "256" } }, "isOverride": false, @@ -12621,7 +12587,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" }, { - "$id": "821", + "$id": "817", "kind": "basic", "name": "stillConvenient", "isExactName": false, @@ -12632,7 +12598,7 @@ ], "doc": "When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one", "operation": { - "$id": "822", + "$id": "818", "name": "stillConvenient", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12667,7 +12633,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" }, { - "$id": "823", + "$id": "819", "kind": "basic", "name": "headAsBoolean", "isExactName": false, @@ -12678,7 +12644,7 @@ ], "doc": "head as boolean.", "operation": { - "$id": "824", + "$id": "820", "name": "headAsBoolean", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12686,12 +12652,12 @@ "accessibility": "public", "parameters": [ { - "$id": "825", + "$id": "821", "kind": "path", "name": "id", "serializedName": "id", "type": { - "$id": "826", + "$id": "822", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12709,12 +12675,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "827", + "$id": "823", "kind": "method", "name": "id", "serializedName": "id", "type": { - "$id": "828", + "$id": "824", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12756,7 +12722,7 @@ }, "parameters": [ { - "$ref": "827" + "$ref": "823" } ], "response": {}, @@ -12766,7 +12732,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "829", + "$id": "825", "kind": "basic", "name": "WithApiVersion", "isExactName": false, @@ -12777,7 +12743,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "830", + "$id": "826", "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12785,12 +12751,12 @@ "accessibility": "public", "parameters": [ { - "$id": "831", + "$id": "827", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "832", + "$id": "828", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12805,12 +12771,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "833", + "$id": "829", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "834", + "$id": "830", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12830,12 +12796,12 @@ "isExactName": false }, { - "$id": "835", + "$id": "831", "kind": "query", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "836", + "$id": "832", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12845,7 +12811,7 @@ "explode": false, "defaultValue": { "type": { - "$id": "837", + "$id": "833", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12859,12 +12825,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "838", + "$id": "834", "kind": "method", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "839", + "$id": "835", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12874,7 +12840,7 @@ "isApiVersion": true, "defaultValue": { "type": { - "$id": "840", + "$id": "836", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12915,7 +12881,7 @@ }, "parameters": [ { - "$ref": "833" + "$ref": "829" } ], "response": {}, @@ -12925,7 +12891,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" }, { - "$id": "841", + "$id": "837", "kind": "paging", "name": "ListWithNextLink", "isExactName": false, @@ -12936,7 +12902,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "842", + "$id": "838", "name": "ListWithNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12944,7 +12910,7 @@ "accessibility": "public", "parameters": [ { - "$id": "843", + "$id": "839", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12960,7 +12926,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "844", + "$id": "840", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12987,7 +12953,7 @@ 200 ], "bodyType": { - "$ref": "356" + "$ref": "352" }, "headers": [], "isErrorResponse": false, @@ -13013,12 +12979,12 @@ }, "parameters": [ { - "$ref": "844" + "$ref": "840" } ], "response": { "type": { - "$ref": "358" + "$ref": "354" }, "resultSegments": [ "things" @@ -13042,7 +13008,7 @@ } }, { - "$id": "845", + "$id": "841", "kind": "paging", "name": "ListWithStringNextLink", "isExactName": false, @@ -13053,7 +13019,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "846", + "$id": "842", "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13061,7 +13027,7 @@ "accessibility": "public", "parameters": [ { - "$id": "847", + "$id": "843", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13077,7 +13043,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "848", + "$id": "844", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13104,7 +13070,7 @@ 200 ], "bodyType": { - "$ref": "361" + "$ref": "357" }, "headers": [], "isErrorResponse": false, @@ -13130,12 +13096,12 @@ }, "parameters": [ { - "$ref": "848" + "$ref": "844" } ], "response": { "type": { - "$ref": "358" + "$ref": "354" }, "resultSegments": [ "things" @@ -13159,7 +13125,7 @@ } }, { - "$id": "849", + "$id": "845", "kind": "paging", "name": "ListWithContinuationToken", "isExactName": false, @@ -13170,7 +13136,7 @@ ], "doc": "List things with continuation token", "operation": { - "$id": "850", + "$id": "846", "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13178,12 +13144,12 @@ "accessibility": "public", "parameters": [ { - "$id": "851", + "$id": "847", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "852", + "$id": "848", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13198,12 +13164,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "853", + "$id": "849", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "854", + "$id": "850", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13223,7 +13189,7 @@ "isExactName": false }, { - "$id": "855", + "$id": "851", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13239,7 +13205,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "856", + "$id": "852", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13266,7 +13232,7 @@ 200 ], "bodyType": { - "$ref": "365" + "$ref": "361" }, "headers": [], "isErrorResponse": false, @@ -13292,15 +13258,15 @@ }, "parameters": [ { - "$ref": "853" + "$ref": "849" }, { - "$ref": "856" + "$ref": "852" } ], "response": { "type": { - "$ref": "358" + "$ref": "354" }, "resultSegments": [ "things" @@ -13316,7 +13282,7 @@ ], "continuationToken": { "parameter": { - "$ref": "851" + "$ref": "847" }, "responseSegments": [ "nextToken" @@ -13327,7 +13293,7 @@ } }, { - "$id": "857", + "$id": "853", "kind": "paging", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, @@ -13338,7 +13304,7 @@ ], "doc": "List things with continuation token header response", "operation": { - "$id": "858", + "$id": "854", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13346,12 +13312,12 @@ "accessibility": "public", "parameters": [ { - "$id": "859", + "$id": "855", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "860", + "$id": "856", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13366,12 +13332,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "861", + "$id": "857", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "862", + "$id": "858", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13391,7 +13357,7 @@ "isExactName": false }, { - "$id": "863", + "$id": "859", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13407,7 +13373,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "864", + "$id": "860", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13434,14 +13400,14 @@ 200 ], "bodyType": { - "$ref": "369" + "$ref": "365" }, "headers": [ { "name": "nextToken", "nameInResponse": "next-token", "type": { - "$id": "865", + "$id": "861", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13472,15 +13438,15 @@ }, "parameters": [ { - "$ref": "861" + "$ref": "857" }, { - "$ref": "864" + "$ref": "860" } ], "response": { "type": { - "$ref": "358" + "$ref": "354" }, "resultSegments": [ "things" @@ -13496,7 +13462,7 @@ ], "continuationToken": { "parameter": { - "$ref": "859" + "$ref": "855" }, "responseSegments": [ "next-token" @@ -13507,7 +13473,7 @@ } }, { - "$id": "866", + "$id": "862", "kind": "paging", "name": "ListWithPaging", "isExactName": false, @@ -13518,7 +13484,7 @@ ], "doc": "List things with paging", "operation": { - "$id": "867", + "$id": "863", "name": "ListWithPaging", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13526,7 +13492,7 @@ "accessibility": "public", "parameters": [ { - "$id": "868", + "$id": "864", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13542,7 +13508,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "869", + "$id": "865", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13569,7 +13535,7 @@ 200 ], "bodyType": { - "$ref": "371" + "$ref": "367" }, "headers": [], "isErrorResponse": false, @@ -13595,12 +13561,12 @@ }, "parameters": [ { - "$ref": "869" + "$ref": "865" } ], "response": { "type": { - "$ref": "358" + "$ref": "354" }, "resultSegments": [ "items" @@ -13618,7 +13584,7 @@ } }, { - "$id": "870", + "$id": "866", "kind": "basic", "name": "EmbeddedParameters", "isExactName": false, @@ -13629,7 +13595,7 @@ ], "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "871", + "$id": "867", "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13637,13 +13603,13 @@ "accessibility": "public", "parameters": [ { - "$id": "872", + "$id": "868", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", "doc": "required header parameter", "type": { - "$id": "873", + "$id": "869", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13658,12 +13624,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "874", + "$id": "870", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "373" + "$ref": "369" }, "location": "Body", "isApiVersion": false, @@ -13676,13 +13642,13 @@ "isExactName": false }, { - "$id": "875", + "$id": "871", "kind": "method", "name": "requiredHeader", "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$ref": "377" + "$ref": "373" }, "location": "", "isApiVersion": false, @@ -13698,13 +13664,13 @@ "isExactName": false }, { - "$id": "876", + "$id": "872", "kind": "header", "name": "optionalHeader", "serializedName": "optional-header", "doc": "optional header parameter", "type": { - "$id": "877", + "$id": "873", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13719,16 +13685,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$ref": "874" + "$ref": "870" }, { - "$id": "878", + "$id": "874", "kind": "method", "name": "optionalHeader", "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$ref": "379" + "$ref": "375" }, "location": "", "isApiVersion": false, @@ -13744,13 +13710,13 @@ "isExactName": false }, { - "$id": "879", + "$id": "875", "kind": "query", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "880", + "$id": "876", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13765,16 +13731,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "874" + "$ref": "870" }, { - "$id": "881", + "$id": "877", "kind": "method", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$ref": "381" + "$ref": "377" }, "location": "", "isApiVersion": false, @@ -13790,13 +13756,13 @@ "isExactName": false }, { - "$id": "882", + "$id": "878", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "883", + "$id": "879", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13811,16 +13777,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "874" + "$ref": "870" }, { - "$id": "884", + "$id": "880", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$ref": "383" + "$ref": "379" }, "location": "", "isApiVersion": false, @@ -13836,7 +13802,7 @@ "isExactName": false }, { - "$id": "885", + "$id": "881", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13853,7 +13819,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "886", + "$id": "882", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13875,12 +13841,12 @@ "isExactName": false }, { - "$id": "887", + "$id": "883", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "373" + "$ref": "369" }, "isApiVersion": false, "contentTypes": [ @@ -13894,7 +13860,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "methodParameterSegments": [ { - "$ref": "874" + "$ref": "870" } ], "isExactName": false, @@ -13930,10 +13896,10 @@ }, "parameters": [ { - "$ref": "874" + "$ref": "870" }, { - "$ref": "886" + "$ref": "882" } ], "response": {}, @@ -13943,7 +13909,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "888", + "$id": "884", "kind": "basic", "name": "DynamicModelOperation", "isExactName": false, @@ -13954,7 +13920,7 @@ ], "doc": "An operation with a dynamic model", "operation": { - "$id": "889", + "$id": "885", "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13962,7 +13928,7 @@ "accessibility": "public", "parameters": [ { - "$id": "890", + "$id": "886", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13979,7 +13945,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "891", + "$id": "887", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14001,12 +13967,12 @@ "isExactName": false }, { - "$id": "892", + "$id": "888", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "384" + "$ref": "380" }, "isApiVersion": false, "contentTypes": [ @@ -14020,12 +13986,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "893", + "$id": "889", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "384" + "$ref": "380" }, "location": "Body", "isApiVersion": false, @@ -14071,10 +14037,10 @@ }, "parameters": [ { - "$ref": "893" + "$ref": "889" }, { - "$ref": "891" + "$ref": "887" } ], "response": {}, @@ -14084,7 +14050,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "894", + "$id": "890", "kind": "basic", "name": "GetXmlAdvancedModel", "isExactName": false, @@ -14095,7 +14061,7 @@ ], "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "895", + "$id": "891", "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14103,7 +14069,7 @@ "accessibility": "public", "parameters": [ { - "$id": "896", + "$id": "892", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14119,7 +14085,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "897", + "$id": "893", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14146,7 +14112,7 @@ 200 ], "bodyType": { - "$ref": "422" + "$ref": "418" }, "headers": [ { @@ -14180,12 +14146,12 @@ }, "parameters": [ { - "$ref": "897" + "$ref": "893" } ], "response": { "type": { - "$ref": "422" + "$ref": "418" } }, "isOverride": false, @@ -14194,7 +14160,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "898", + "$id": "894", "kind": "basic", "name": "UpdateXmlAdvancedModel", "isExactName": false, @@ -14205,7 +14171,7 @@ ], "doc": "Update an advanced XML model with various property types", "operation": { - "$id": "899", + "$id": "895", "name": "UpdateXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14213,7 +14179,7 @@ "accessibility": "public", "parameters": [ { - "$id": "900", + "$id": "896", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14229,7 +14195,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "901", + "$id": "897", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14250,7 +14216,7 @@ "isExactName": false }, { - "$id": "902", + "$id": "898", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14266,7 +14232,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "903", + "$id": "899", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14287,12 +14253,12 @@ "isExactName": false }, { - "$id": "904", + "$id": "900", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "422" + "$ref": "418" }, "isApiVersion": false, "contentTypes": [ @@ -14306,12 +14272,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "905", + "$id": "901", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "422" + "$ref": "418" }, "location": "Body", "isApiVersion": false, @@ -14338,7 +14304,7 @@ 200 ], "bodyType": { - "$ref": "422" + "$ref": "418" }, "headers": [ { @@ -14375,18 +14341,18 @@ }, "parameters": [ { - "$ref": "905" + "$ref": "901" }, { - "$ref": "901" + "$ref": "897" }, { - "$ref": "903" + "$ref": "899" } ], "response": { "type": { - "$ref": "422" + "$ref": "418" } }, "isOverride": false, @@ -14395,7 +14361,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, { - "$id": "906", + "$id": "902", "kind": "basic", "name": "uploadCat", "isExactName": false, @@ -14405,14 +14371,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "907", + "$id": "903", "name": "uploadCat", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "908", + "$id": "904", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14428,7 +14394,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "methodParameterSegments": [ { - "$id": "909", + "$id": "905", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14449,12 +14415,12 @@ "isExactName": false }, { - "$id": "910", + "$id": "906", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "518" + "$ref": "514" }, "isApiVersion": false, "contentTypes": [ @@ -14468,12 +14434,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "methodParameterSegments": [ { - "$id": "911", + "$id": "907", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "518" + "$ref": "514" }, "location": "Body", "isApiVersion": false, @@ -14515,10 +14481,10 @@ }, "parameters": [ { - "$ref": "909" + "$ref": "905" }, { - "$ref": "911" + "$ref": "907" } ], "response": {}, @@ -14528,7 +14494,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" }, { - "$id": "912", + "$id": "908", "kind": "basic", "name": "sendJsonLines", "isExactName": false, @@ -14538,14 +14504,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "913", + "$id": "909", "name": "sendJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "914", + "$id": "910", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14561,16 +14527,16 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "methodParameterSegments": [ { - "$id": "915", + "$id": "911", "kind": "method", "name": "stream", "serializedName": "stream", "type": { - "$id": "916", + "$id": "912", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "559" }, "streamKind": "jsonl", "contentTypes": [ @@ -14589,7 +14555,7 @@ "isExactName": false }, { - "$id": "917", + "$id": "913", "kind": "method", "name": "contentType", "serializedName": "contentType", @@ -14610,16 +14576,16 @@ "isExactName": false }, { - "$id": "918", + "$id": "914", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$id": "919", + "$id": "915", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "559" }, "streamKind": "jsonl", "contentTypes": [ @@ -14639,15 +14605,15 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "methodParameterSegments": [ { - "$ref": "915" + "$ref": "911" }, { - "$id": "920", + "$id": "916", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "643" + "$ref": "639" }, "location": "", "isApiVersion": false, @@ -14693,7 +14659,7 @@ }, "parameters": [ { - "$ref": "915" + "$ref": "911" } ], "response": {}, @@ -14703,7 +14669,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "921", + "$id": "917", "kind": "basic", "name": "receiveJsonLines", "isExactName": false, @@ -14713,14 +14679,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "922", + "$id": "918", "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "923", + "$id": "919", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14736,7 +14702,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "924", + "$id": "920", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14763,11 +14729,11 @@ 200 ], "bodyType": { - "$id": "925", + "$id": "921", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "559" }, "streamKind": "jsonl", "contentTypes": [ @@ -14807,16 +14773,16 @@ }, "parameters": [ { - "$ref": "924" + "$ref": "920" } ], "response": { "type": { - "$id": "926", + "$id": "922", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "563" + "$ref": "559" }, "streamKind": "jsonl", "contentTypes": [ @@ -14831,7 +14797,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "927", + "$id": "923", "kind": "basic", "name": "receiveSse", "isExactName": false, @@ -14841,14 +14807,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "928", + "$id": "924", "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "929", + "$id": "925", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14864,7 +14830,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "930", + "$id": "926", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14891,16 +14857,16 @@ 200 ], "bodyType": { - "$id": "931", + "$id": "927", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$id": "932", + "$id": "928", "kind": "union", "name": "SampleEvents", "variantTypes": [ { - "$ref": "563" + "$ref": "559" }, { "$ref": "204" @@ -14945,16 +14911,16 @@ }, "parameters": [ { - "$ref": "930" + "$ref": "926" } ], "response": { "type": { - "$id": "933", + "$id": "929", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$ref": "932" + "$ref": "928" }, "streamKind": "sse", "contentTypes": [ @@ -14968,130 +14934,16 @@ "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" - }, - { - "$id": "934", - "kind": "basic", - "name": "getJsonInt32", - "isExactName": false, - "accessibility": "public", - "apiVersions": [ - "2024-07-16-preview", - "2024-08-16-preview" - ], - "doc": "get JSON int32", - "operation": { - "$id": "935", - "name": "getJsonInt32", - "isExactName": false, - "resourceName": "SampleTypeSpec", - "doc": "get JSON int32", - "accessibility": "public", - "parameters": [ - { - "$id": "936", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "208" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", - "methodParameterSegments": [ - { - "$id": "937", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "208" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32.accept", - "readOnly": false, - "access": "public", - "decorators": [], - "isExactName": false - } - ], - "isExactName": false - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$id": "938", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "headers": [ - { - "name": "contentType", - "nameInResponse": "content-type", - "type": { - "$ref": "210" - } - } - ], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ], - "serializationOptions": { - "json": { - "name": "" - } - } - } - ], - "httpMethod": "GET", - "uri": "{sampleTypeSpecUrl}", - "path": "/json-int32", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32", - "decorators": [], - "namespace": "SampleTypeSpec" - }, - "parameters": [ - { - "$ref": "937" - } - ], - "response": { - "type": { - "$ref": "938" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "SampleTypeSpec.getJsonInt32" } ], "parameters": [ { - "$id": "939", + "$id": "930", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "940", + "$id": "931", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15107,7 +14959,7 @@ "isExactName": false }, { - "$ref": "838" + "$ref": "834" } ], "initializedBy": 1, @@ -15119,14 +14971,14 @@ ], "children": [ { - "$id": "941", + "$id": "932", "kind": "client", "name": "AnimalOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "942", + "$id": "933", "kind": "basic", "name": "updatePetAsAnimal", "isExactName": false, @@ -15137,7 +14989,7 @@ ], "doc": "Update a pet as an animal", "operation": { - "$id": "943", + "$id": "934", "name": "updatePetAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15145,13 +14997,13 @@ "accessibility": "public", "parameters": [ { - "$id": "944", + "$id": "935", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "208" }, "isApiVersion": false, "optional": false, @@ -15162,13 +15014,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "945", + "$id": "936", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "208" }, "location": "Header", "isApiVersion": false, @@ -15184,12 +15036,12 @@ "isExactName": false }, { - "$id": "946", + "$id": "937", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "210" }, "isApiVersion": false, "optional": false, @@ -15200,12 +15052,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "947", + "$id": "938", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "210" }, "location": "Header", "isApiVersion": false, @@ -15221,12 +15073,12 @@ "isExactName": false }, { - "$id": "948", + "$id": "939", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "562" }, "isApiVersion": false, "contentTypes": [ @@ -15240,12 +15092,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", "methodParameterSegments": [ { - "$id": "949", + "$id": "940", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "562" }, "location": "Body", "isApiVersion": false, @@ -15272,7 +15124,7 @@ 200 ], "bodyType": { - "$ref": "566" + "$ref": "562" }, "headers": [], "isErrorResponse": false, @@ -15301,18 +15153,18 @@ }, "parameters": [ { - "$ref": "949" + "$ref": "940" }, { - "$ref": "945" + "$ref": "936" }, { - "$ref": "947" + "$ref": "938" } ], "response": { "type": { - "$ref": "566" + "$ref": "562" } }, "isOverride": false, @@ -15321,7 +15173,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "950", + "$id": "941", "kind": "basic", "name": "updateDogAsAnimal", "isExactName": false, @@ -15332,7 +15184,7 @@ ], "doc": "Update a dog as an animal", "operation": { - "$id": "951", + "$id": "942", "name": "updateDogAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15340,13 +15192,13 @@ "accessibility": "public", "parameters": [ { - "$id": "952", + "$id": "943", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "212" }, "isApiVersion": false, "optional": false, @@ -15357,13 +15209,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "953", + "$id": "944", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "212" }, "location": "Header", "isApiVersion": false, @@ -15379,12 +15231,12 @@ "isExactName": false }, { - "$id": "954", + "$id": "945", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "214" }, "isApiVersion": false, "optional": false, @@ -15395,12 +15247,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "955", + "$id": "946", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "214" }, "location": "Header", "isApiVersion": false, @@ -15416,12 +15268,12 @@ "isExactName": false }, { - "$id": "956", + "$id": "947", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "562" }, "isApiVersion": false, "contentTypes": [ @@ -15435,12 +15287,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", "methodParameterSegments": [ { - "$id": "957", + "$id": "948", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "566" + "$ref": "562" }, "location": "Body", "isApiVersion": false, @@ -15467,7 +15319,7 @@ 200 ], "bodyType": { - "$ref": "566" + "$ref": "562" }, "headers": [], "isErrorResponse": false, @@ -15496,18 +15348,18 @@ }, "parameters": [ { - "$ref": "957" + "$ref": "948" }, { - "$ref": "953" + "$ref": "944" }, { - "$ref": "955" + "$ref": "946" } ], "response": { "type": { - "$ref": "566" + "$ref": "562" } }, "isOverride": false, @@ -15518,12 +15370,12 @@ ], "parameters": [ { - "$id": "958", + "$id": "949", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "959", + "$id": "950", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15547,19 +15399,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false }, { - "$id": "960", + "$id": "951", "kind": "client", "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "961", + "$id": "952", "kind": "basic", "name": "updatePetAsPet", "isExactName": false, @@ -15570,7 +15422,7 @@ ], "doc": "Update a pet as a pet", "operation": { - "$id": "962", + "$id": "953", "name": "updatePetAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15578,13 +15430,13 @@ "accessibility": "public", "parameters": [ { - "$id": "963", + "$id": "954", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -15595,13 +15447,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", "methodParameterSegments": [ { - "$id": "964", + "$id": "955", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "216" }, "location": "Header", "isApiVersion": false, @@ -15617,12 +15469,12 @@ "isExactName": false }, { - "$id": "965", + "$id": "956", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "218" }, "isApiVersion": false, "optional": false, @@ -15633,12 +15485,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "966", + "$id": "957", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "218" }, "location": "Header", "isApiVersion": false, @@ -15654,12 +15506,12 @@ "isExactName": false }, { - "$id": "967", + "$id": "958", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "567" }, "isApiVersion": false, "contentTypes": [ @@ -15673,12 +15525,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "968", + "$id": "959", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "567" }, "location": "Body", "isApiVersion": false, @@ -15705,7 +15557,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "567" }, "headers": [], "isErrorResponse": false, @@ -15734,18 +15586,18 @@ }, "parameters": [ { - "$ref": "968" + "$ref": "959" }, { - "$ref": "964" + "$ref": "955" }, { - "$ref": "966" + "$ref": "957" } ], "response": { "type": { - "$ref": "571" + "$ref": "567" } }, "isOverride": false, @@ -15754,7 +15606,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "969", + "$id": "960", "kind": "basic", "name": "updateDogAsPet", "isExactName": false, @@ -15765,7 +15617,7 @@ ], "doc": "Update a dog as a pet", "operation": { - "$id": "970", + "$id": "961", "name": "updateDogAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15773,13 +15625,13 @@ "accessibility": "public", "parameters": [ { - "$id": "971", + "$id": "962", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "220" }, "isApiVersion": false, "optional": false, @@ -15790,13 +15642,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "972", + "$id": "963", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "220" }, "location": "Header", "isApiVersion": false, @@ -15812,12 +15664,12 @@ "isExactName": false }, { - "$id": "973", + "$id": "964", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "222" }, "isApiVersion": false, "optional": false, @@ -15828,12 +15680,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "methodParameterSegments": [ { - "$id": "974", + "$id": "965", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "222" }, "location": "Header", "isApiVersion": false, @@ -15849,12 +15701,12 @@ "isExactName": false }, { - "$id": "975", + "$id": "966", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "567" }, "isApiVersion": false, "contentTypes": [ @@ -15868,12 +15720,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "976", + "$id": "967", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "571" + "$ref": "567" }, "location": "Body", "isApiVersion": false, @@ -15900,7 +15752,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "567" }, "headers": [], "isErrorResponse": false, @@ -15929,18 +15781,18 @@ }, "parameters": [ { - "$ref": "976" + "$ref": "967" }, { - "$ref": "972" + "$ref": "963" }, { - "$ref": "974" + "$ref": "965" } ], "response": { "type": { - "$ref": "571" + "$ref": "567" } }, "isOverride": false, @@ -15951,12 +15803,12 @@ ], "parameters": [ { - "$id": "977", + "$id": "968", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "978", + "$id": "969", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15980,19 +15832,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false }, { - "$id": "979", + "$id": "970", "kind": "client", "name": "DogOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "980", + "$id": "971", "kind": "basic", "name": "updateDogAsDog", "isExactName": false, @@ -16003,7 +15855,7 @@ ], "doc": "Update a dog as a dog", "operation": { - "$id": "981", + "$id": "972", "name": "updateDogAsDog", "isExactName": false, "resourceName": "DogOperations", @@ -16011,13 +15863,13 @@ "accessibility": "public", "parameters": [ { - "$id": "982", + "$id": "973", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "224" }, "isApiVersion": false, "optional": false, @@ -16028,13 +15880,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "983", + "$id": "974", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "228" + "$ref": "224" }, "location": "Header", "isApiVersion": false, @@ -16050,12 +15902,12 @@ "isExactName": false }, { - "$id": "984", + "$id": "975", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "226" }, "isApiVersion": false, "optional": false, @@ -16066,12 +15918,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "985", + "$id": "976", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "230" + "$ref": "226" }, "location": "Header", "isApiVersion": false, @@ -16087,12 +15939,12 @@ "isExactName": false }, { - "$id": "986", + "$id": "977", "kind": "body", "name": "dog", "serializedName": "dog", "type": { - "$ref": "575" + "$ref": "571" }, "isApiVersion": false, "contentTypes": [ @@ -16106,12 +15958,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", "methodParameterSegments": [ { - "$id": "987", + "$id": "978", "kind": "method", "name": "dog", "serializedName": "dog", "type": { - "$ref": "575" + "$ref": "571" }, "location": "Body", "isApiVersion": false, @@ -16138,7 +15990,7 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "571" }, "headers": [], "isErrorResponse": false, @@ -16167,18 +16019,18 @@ }, "parameters": [ { - "$ref": "987" + "$ref": "978" }, { - "$ref": "983" + "$ref": "974" }, { - "$ref": "985" + "$ref": "976" } ], "response": { "type": { - "$ref": "575" + "$ref": "571" } }, "isOverride": false, @@ -16189,12 +16041,12 @@ ], "parameters": [ { - "$id": "988", + "$id": "979", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "989", + "$id": "980", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16218,19 +16070,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false }, { - "$id": "990", + "$id": "981", "kind": "client", "name": "PlantOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "991", + "$id": "982", "kind": "basic", "name": "getTree", "isExactName": false, @@ -16241,7 +16093,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "992", + "$id": "983", "name": "getTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16249,12 +16101,12 @@ "accessibility": "public", "parameters": [ { - "$id": "993", + "$id": "984", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -16265,12 +16117,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "994", + "$id": "985", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "228" }, "location": "Header", "isApiVersion": false, @@ -16292,14 +16144,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "575" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "234" + "$ref": "230" } } ], @@ -16326,12 +16178,12 @@ }, "parameters": [ { - "$ref": "994" + "$ref": "985" } ], "response": { "type": { - "$ref": "579" + "$ref": "575" } }, "isOverride": false, @@ -16340,7 +16192,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "995", + "$id": "986", "kind": "basic", "name": "getTreeAsJson", "isExactName": false, @@ -16351,7 +16203,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "996", + "$id": "987", "name": "getTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16359,12 +16211,12 @@ "accessibility": "public", "parameters": [ { - "$id": "997", + "$id": "988", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "232" }, "isApiVersion": false, "optional": false, @@ -16375,12 +16227,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "998", + "$id": "989", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "236" + "$ref": "232" }, "location": "Header", "isApiVersion": false, @@ -16402,14 +16254,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "575" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "238" + "$ref": "234" } } ], @@ -16436,12 +16288,12 @@ }, "parameters": [ { - "$ref": "998" + "$ref": "989" } ], "response": { "type": { - "$ref": "579" + "$ref": "575" } }, "isOverride": false, @@ -16450,7 +16302,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" }, { - "$id": "999", + "$id": "990", "kind": "basic", "name": "updateTree", "isExactName": false, @@ -16461,7 +16313,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1000", + "$id": "991", "name": "updateTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16469,12 +16321,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1001", + "$id": "992", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "240" + "$ref": "236" }, "isApiVersion": false, "optional": false, @@ -16485,12 +16337,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "1002", + "$id": "993", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "240" + "$ref": "236" }, "location": "Header", "isApiVersion": false, @@ -16506,12 +16358,12 @@ "isExactName": false }, { - "$id": "1003", + "$id": "994", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "240" }, "isApiVersion": false, "optional": false, @@ -16522,12 +16374,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "methodParameterSegments": [ { - "$id": "1004", + "$id": "995", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "244" + "$ref": "240" }, "location": "Header", "isApiVersion": false, @@ -16543,12 +16395,12 @@ "isExactName": false }, { - "$id": "1005", + "$id": "996", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -16562,12 +16414,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "1006", + "$id": "997", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -16594,14 +16446,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "575" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "246" + "$ref": "242" } } ], @@ -16631,18 +16483,18 @@ }, "parameters": [ { - "$ref": "1006" + "$ref": "997" }, { - "$ref": "1002" + "$ref": "993" }, { - "$ref": "1004" + "$ref": "995" } ], "response": { "type": { - "$ref": "579" + "$ref": "575" } }, "isOverride": false, @@ -16651,7 +16503,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "1007", + "$id": "998", "kind": "basic", "name": "updateTreeAsJson", "isExactName": false, @@ -16662,7 +16514,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "1008", + "$id": "999", "name": "updateTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16670,12 +16522,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1009", + "$id": "1000", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "248" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -16686,12 +16538,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1010", + "$id": "1001", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "248" + "$ref": "244" }, "location": "Header", "isApiVersion": false, @@ -16707,12 +16559,12 @@ "isExactName": false }, { - "$id": "1011", + "$id": "1002", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -16723,12 +16575,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1012", + "$id": "1003", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "248" }, "location": "Header", "isApiVersion": false, @@ -16744,12 +16596,12 @@ "isExactName": false }, { - "$id": "1013", + "$id": "1004", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -16763,12 +16615,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1014", + "$id": "1005", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "579" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -16795,14 +16647,14 @@ 200 ], "bodyType": { - "$ref": "579" + "$ref": "575" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "254" + "$ref": "250" } } ], @@ -16832,18 +16684,18 @@ }, "parameters": [ { - "$ref": "1014" + "$ref": "1005" }, { - "$ref": "1010" + "$ref": "1001" }, { - "$ref": "1012" + "$ref": "1003" } ], "response": { "type": { - "$ref": "579" + "$ref": "575" } }, "isOverride": false, @@ -16854,12 +16706,12 @@ ], "parameters": [ { - "$id": "1015", + "$id": "1006", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1016", + "$id": "1007", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16883,19 +16735,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false }, { - "$id": "1017", + "$id": "1008", "kind": "client", "name": "Metrics", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1018", + "$id": "1009", "kind": "basic", "name": "getWidgetMetrics", "isExactName": false, @@ -16906,7 +16758,7 @@ ], "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1019", + "$id": "1010", "name": "getWidgetMetrics", "isExactName": false, "resourceName": "Metrics", @@ -16914,12 +16766,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1020", + "$id": "1011", "kind": "path", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1021", + "$id": "1012", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16937,12 +16789,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", "methodParameterSegments": [ { - "$id": "1022", + "$id": "1013", "kind": "method", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1023", + "$id": "1014", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16962,7 +16814,7 @@ "isExactName": false }, { - "$id": "1024", + "$id": "1015", "kind": "path", "name": "day", "serializedName": "day", @@ -16981,7 +16833,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1025", + "$id": "1016", "kind": "method", "name": "day", "serializedName": "day", @@ -17002,12 +16854,12 @@ "isExactName": false }, { - "$id": "1026", + "$id": "1017", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -17018,12 +16870,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1027", + "$id": "1018", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "256" + "$ref": "252" }, "location": "Header", "isApiVersion": false, @@ -17045,7 +16897,7 @@ 200 ], "bodyType": { - "$ref": "590" + "$ref": "586" }, "headers": [], "isErrorResponse": false, @@ -17071,15 +16923,15 @@ }, "parameters": [ { - "$ref": "1025" + "$ref": "1016" }, { - "$ref": "1027" + "$ref": "1018" } ], "response": { "type": { - "$ref": "590" + "$ref": "586" } }, "isOverride": false, @@ -17090,12 +16942,12 @@ ], "parameters": [ { - "$id": "1028", + "$id": "1019", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1029", + "$id": "1020", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17111,7 +16963,7 @@ "isExactName": false }, { - "$ref": "1022" + "$ref": "1013" } ], "initializedBy": 3, @@ -17122,19 +16974,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false }, { - "$id": "1030", + "$id": "1021", "kind": "client", "name": "Notebooks", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1031", + "$id": "1022", "kind": "basic", "name": "getNotebook", "isExactName": false, @@ -17145,7 +16997,7 @@ ], "doc": "Get a notebook by name", "operation": { - "$id": "1032", + "$id": "1023", "name": "getNotebook", "isExactName": false, "resourceName": "Notebooks", @@ -17153,12 +17005,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1033", + "$id": "1024", "kind": "path", "name": "notebookName", "serializedName": "notebookName", "type": { - "$id": "1034", + "$id": "1025", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17176,12 +17028,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1035", + "$id": "1026", "kind": "method", "name": "notebook", "serializedName": "notebook", "type": { - "$id": "1036", + "$id": "1027", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17202,12 +17054,12 @@ "isExactName": false }, { - "$id": "1037", + "$id": "1028", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "258" + "$ref": "254" }, "isApiVersion": false, "optional": false, @@ -17218,12 +17070,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1038", + "$id": "1029", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "258" + "$ref": "254" }, "location": "Header", "isApiVersion": false, @@ -17245,7 +17097,7 @@ 200 ], "bodyType": { - "$ref": "595" + "$ref": "591" }, "headers": [], "isErrorResponse": false, @@ -17271,12 +17123,12 @@ }, "parameters": [ { - "$ref": "1038" + "$ref": "1029" } ], "response": { "type": { - "$ref": "595" + "$ref": "591" } }, "isOverride": false, @@ -17287,12 +17139,12 @@ ], "parameters": [ { - "$id": "1039", + "$id": "1030", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1040", + "$id": "1031", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17308,7 +17160,7 @@ "isExactName": false }, { - "$ref": "1035" + "$ref": "1026" } ], "initializedBy": 3, @@ -17319,7 +17171,7 @@ "2024-08-16-preview" ], "parent": { - "$ref": "644" + "$ref": "640" }, "isMultiServiceClient": false } From 94acf3eaeef6fa103c7895b1858b54207be6d589 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 17:55:36 +0000 Subject: [PATCH 44/47] fix(http-client-csharp): avoid duration diagnostics for numeric formats Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 45 ++++++++++--------- .../ScmMethodProviderCollectionTests.cs | 9 +++- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index ebfe39c85d2..5137e00f4aa 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -964,6 +964,27 @@ private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, ValueExpression invariantCulture) { var format = GetResponseSerializationFormat(); + switch (format) + { + case SerializationFormat.Duration_Seconds: + return TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)); + case SerializationFormat.Duration_Seconds_Int64: + return TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)); + case SerializationFormat.Duration_Seconds_Float: + case SerializationFormat.Duration_Seconds_Double: + // Float and Double wire encodings are intentionally collapsed to a single double.Parse, + // matching MrwSerializationTypeDefinition's JSON path, which uses GetDouble() for both. + return TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)); + case SerializationFormat.Duration_Milliseconds: + return TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)); + case SerializationFormat.Duration_Milliseconds_Int64: + return TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)); + case SerializationFormat.Duration_Milliseconds_Float: + case SerializationFormat.Duration_Milliseconds_Double: + // See the Duration_Seconds_Float/Double comment above. + return TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)); + } + var formatSpecifier = format.ToFormatSpecifier(); if (formatSpecifier is null) { @@ -971,29 +992,11 @@ private ValueExpression GetPlainTextTimeSpanConversion(ValueExpression content, DiagnosticCodes.UnsupportedSerialization, $"Unsupported duration serialization format: {format}. Falling back to constant duration format.", ServiceMethod.Operation.CrossLanguageDefinitionId); - formatSpecifier = SerializationFormat.Duration_Constant.ToFormatSpecifier(); + formatSpecifier = SerializationFormat.Duration_Constant.ToFormatSpecifier()!; } - return format switch - { - SerializationFormat.Duration_Seconds => - TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), - SerializationFormat.Duration_Seconds_Int64 => - TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), - SerializationFormat.Duration_Seconds_Float or SerializationFormat.Duration_Seconds_Double => - // Float and Double wire encodings are intentionally collapsed to a single double.Parse, - // matching MrwSerializationTypeDefinition's JSON path, which uses GetDouble() for both. - TimeSpanSnippets.FromSeconds(ParseNumeric(content, invariantCulture)), - SerializationFormat.Duration_Milliseconds => - TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - SerializationFormat.Duration_Milliseconds_Int64 => - TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - SerializationFormat.Duration_Milliseconds_Float or SerializationFormat.Duration_Milliseconds_Double => - // See the Duration_Seconds_Float/Double comment above. - TimeSpanSnippets.FromMilliseconds(ParseNumeric(content, invariantCulture)), - // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. - _ => content.As().ParseTimeSpan(Literal(formatSpecifier)) - }; + // ISO 8601 ("P"), constant ("c") and plain time ("T") encodings all parse the content directly. + return content.As().ParseTimeSpan(Literal(formatSpecifier)); } /// diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 52400cd9774..675a6d63be2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1767,7 +1767,10 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextDuration", operation); var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); - MockHelpers.LoadMockGenerator(); + using var output = new MemoryStream(); + using var emitter = new Emitter(output); + var mockGenerator = MockHelpers.LoadMockGenerator(); + mockGenerator.SetupGet(p => p.Emitter).Returns(emitter); var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); var method = new ScmMethodProviderCollection(serviceMethod, client!) .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextDuration"); @@ -1776,6 +1779,10 @@ public void PlainTextDurationReturnTypeMethods(string encoding, InputPrimitiveTy writer.WriteMethod(method); var baselineName = (wireKind is { } k ? $"{encoding}{k}" : encoding) + (isNullable ? "Nullable" : string.Empty); Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); + + output.Position = 0; + using var reader = new StreamReader(output, Encoding.UTF8); + Assert.AreEqual(string.Empty, reader.ReadToEnd()); } [Test] From 9b2f4e24f269021008b34d61f1cab9fc7369af4d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:02:17 +0000 Subject: [PATCH 45/47] fix(http-client-csharp): match text plain media types loosely Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 2 +- .../ScmMethodProviderCollectionTests.cs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 5137e00f4aa..183c6c1e700 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -1058,7 +1058,7 @@ private bool HasOnlyPlainTextContentType() var contentTypes = ServiceMethod.Operation.Responses .Where(r => r.IsErrorResponse is false) .SelectMany(r => r.ContentTypes); - return contentTypes.Any() && contentTypes.All(contentType => contentType == "text/plain"); + return contentTypes.Any() && contentTypes.All(contentType => contentType.Contains("text/plain", StringComparison.OrdinalIgnoreCase)); } private SerializationFormat GetResponseSerializationFormat() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 675a6d63be2..508122436e0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1723,6 +1723,25 @@ public void PlainTextScalarReturnTypeMethods(Type type) Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); } + [TestCase("Text/Plain")] + [TestCase("text/plain; charset=utf-8")] + public void PlainTextScalarReturnTypeMethodsHandlesTextPlainMediaTypeVariants(string contentType) + { + var operation = InputFactory.Operation("GetPlainTextScalar", responses: + [InputFactory.OperationResponse([200], InputPrimitiveType.Int32, contentTypes: [contentType])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetPlainTextScalar", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetPlainTextScalar"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile("Int32", nameof(PlainTextScalarReturnTypeMethods)), writer.ToString(false)); + } + [TestCase("Iso8601", null, false)] [TestCase("Constant", null, false)] [TestCase("Seconds", InputPrimitiveTypeKind.Int32, false)] From 9c05f25abdd315ad136ee8af1368d56eefbfad6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:29:57 +0000 Subject: [PATCH 46/47] fix(http-client-csharp): match exact plain-text media types Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../Providers/ScmMethodProviderCollection.cs | 7 ++++++- .../ScmMethodProviderCollectionTests.cs | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 183c6c1e700..a18353be490 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -1058,7 +1058,12 @@ private bool HasOnlyPlainTextContentType() var contentTypes = ServiceMethod.Operation.Responses .Where(r => r.IsErrorResponse is false) .SelectMany(r => r.ContentTypes); - return contentTypes.Any() && contentTypes.All(contentType => contentType.Contains("text/plain", StringComparison.OrdinalIgnoreCase)); + return contentTypes.Any() && contentTypes.All(IsPlainTextContentType); + } + + private static bool IsPlainTextContentType(string contentType) + { + return contentType.Split(';')[0].Trim().Equals("text/plain", StringComparison.OrdinalIgnoreCase); } private SerializationFormat GetResponseSerializationFormat() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs index 508122436e0..7262aeb6c97 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs @@ -1742,6 +1742,24 @@ public void PlainTextScalarReturnTypeMethodsHandlesTextPlainMediaTypeVariants(st Assert.AreEqual(Helpers.GetExpectedFromFile("Int32", nameof(PlainTextScalarReturnTypeMethods)), writer.ToString(false)); } + [Test] + public void JsonScalarReturnTypeMethodsDoNotMatchTextPlainMediaTypeParameter() + { + var operation = InputFactory.Operation("GetScalar", responses: + [InputFactory.OperationResponse([200], InputPrimitiveType.Int32, contentTypes: ["application/json; profile=\"text/plain\""])]); + var serviceMethod = InputFactory.BasicServiceMethod("GetScalar", operation); + var inputClient = InputFactory.Client("TestClient", methods: [serviceMethod]); + + MockHelpers.LoadMockGenerator(); + var client = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + var method = new ScmMethodProviderCollection(serviceMethod, client!) + .Single(m => m.Kind == ScmMethodKind.Convenience && m.Signature.Name == "GetScalar"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile("Int32", nameof(ScalarReturnTypeMethods)), writer.ToString(false)); + } + [TestCase("Iso8601", null, false)] [TestCase("Constant", null, false)] [TestCase("Seconds", InputPrimitiveTypeKind.Int32, false)] From 9a84ed9389e7e0eb84eb0d13d768e6ec22104065 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:55:15 +0000 Subject: [PATCH 47/47] fix(http-client-csharp): remove BOM response handling Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../src/Providers/ScmMethodProviderCollection.cs | 15 +++------------ ...ibility_BothMethodsParamOrderChanged(Async).cs | 5 ++--- ...tibility_BothMethodsParamOrderChanged(Sync).cs | 5 ++--- ...y_ConvenienceMethodParamOrderChanged(Async).cs | 5 ++--- ...ty_ConvenienceMethodParamOrderChanged(Sync).cs | 5 ++--- ...y_MultipleNewOptionalNonBodyParametersAdded.cs | 8 +++----- ...alBodyParameterDoesNotAddBackCompatOverload.cs | 8 +++----- ...patibility_NewOptionalNonBodyParameterAdded.cs | 8 +++----- ...wOptionalNonBodyParameterAddedWithModelBody.cs | 8 +++----- ...dyParameterAddedWithPathAndHeaderParameters.cs | 8 +++----- ...bility_NewOptionalParameterWithReservedName.cs | 8 +++----- ...quiredParameterDoesNotAddBackCompatOverload.cs | 8 +++----- .../EnumReturnTypeMethods(False,False,False).cs | 5 ++--- .../EnumReturnTypeMethods(False,False,True).cs | 5 ++--- .../EnumReturnTypeMethods(False,True,False).cs | 5 ++--- .../EnumReturnTypeMethods(False,True,True).cs | 5 ++--- .../EnumReturnTypeMethods(True,False,False).cs | 5 ++--- .../EnumReturnTypeMethods(True,False,True).cs | 5 ++--- .../EnumReturnTypeMethods(True,True,False).cs | 5 ++--- .../EnumReturnTypeMethods(True,True,True).cs | 5 ++--- ...ContentTypeScalarResponseUsesJsonConversion.cs | 5 ++--- ...lainTextDurationReturnTypeMethods(Constant).cs | 5 ++--- ...DurationReturnTypeMethods(ConstantNullable).cs | 5 ++--- ...PlainTextDurationReturnTypeMethods(Iso8601).cs | 5 ++--- ...tDurationReturnTypeMethods(Iso8601Nullable).cs | 5 ++--- ...ationReturnTypeMethods(MillisecondsFloat32).cs | 5 ++--- ...urnTypeMethods(MillisecondsFloat32Nullable).cs | 5 ++--- ...ationReturnTypeMethods(MillisecondsFloat64).cs | 5 ++--- ...urnTypeMethods(MillisecondsFloat64Nullable).cs | 5 ++--- ...urationReturnTypeMethods(MillisecondsInt32).cs | 5 ++--- ...eturnTypeMethods(MillisecondsInt32Nullable).cs | 5 ++--- ...urationReturnTypeMethods(MillisecondsInt64).cs | 5 ++--- ...eturnTypeMethods(MillisecondsInt64Nullable).cs | 5 ++--- ...xtDurationReturnTypeMethods(SecondsFloat32).cs | 5 ++--- ...onReturnTypeMethods(SecondsFloat32Nullable).cs | 5 ++--- ...xtDurationReturnTypeMethods(SecondsFloat64).cs | 5 ++--- ...onReturnTypeMethods(SecondsFloat64Nullable).cs | 5 ++--- ...TextDurationReturnTypeMethods(SecondsInt32).cs | 5 ++--- ...tionReturnTypeMethods(SecondsInt32Nullable).cs | 5 ++--- ...TextDurationReturnTypeMethods(SecondsInt64).cs | 5 ++--- ...tionReturnTypeMethods(SecondsInt64Nullable).cs | 5 ++--- ...peMethodsReportsUnsupportedEncoding(Custom).cs | 5 ++--- ...extEnumReturnTypeMethods(False,False,False).cs | 5 ++--- ...TextEnumReturnTypeMethods(False,False,True).cs | 5 ++--- ...TextEnumReturnTypeMethods(False,True,False).cs | 5 ++--- ...nTextEnumReturnTypeMethods(False,True,True).cs | 5 ++--- ...TextEnumReturnTypeMethods(True,False,False).cs | 5 ++--- ...nTextEnumReturnTypeMethods(True,False,True).cs | 5 ++--- ...nTextEnumReturnTypeMethods(True,True,False).cs | 5 ++--- ...inTextEnumReturnTypeMethods(True,True,True).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(Boolean).cs | 5 ++--- ...extScalarReturnTypeMethods(BooleanNullable).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(Byte).cs | 5 ++--- ...TextScalarReturnTypeMethods(DateTimeOffset).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(Int32).cs | 5 ++--- ...nTextScalarReturnTypeMethods(Int32Nullable).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(SByte).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(TimeSpan).cs | 5 ++--- ...xtScalarReturnTypeMethods(TimeSpanNullable).cs | 5 ++--- .../PlainTextScalarReturnTypeMethods(Uri).cs | 5 ++--- .../ScalarReturnTypeMethods(Boolean).cs | 3 +-- .../ScalarReturnTypeMethods(BooleanNullable).cs | 5 ++--- .../ScalarReturnTypeMethods(Byte).cs | 3 +-- .../ScalarReturnTypeMethods(DateTimeOffset).cs | 3 +-- .../ScalarReturnTypeMethods(Decimal).cs | 5 ++--- .../ScalarReturnTypeMethods(Double).cs | 3 +-- .../ScalarReturnTypeMethods(Int32).cs | 3 +-- .../ScalarReturnTypeMethods(Int32Async).cs | 5 ++--- .../ScalarReturnTypeMethods(Int32Nullable).cs | 5 ++--- ...ScalarReturnTypeMethods(Int32NullableAsync).cs | 5 ++--- .../ScalarReturnTypeMethods(Int64).cs | 3 +-- .../ScalarReturnTypeMethods(SByte).cs | 3 +-- .../ScalarReturnTypeMethods(Single).cs | 3 +-- .../ScalarReturnTypeMethods(String).cs | 3 +-- .../ScalarReturnTypeMethods(TimeSpan).cs | 3 +-- .../ScalarReturnTypeMethods(TimeSpanNullable).cs | 5 ++--- .../ScalarReturnTypeMethods(Uri).cs | 3 +-- .../Local.Tests/ExtensibleEnumTests.cs | 12 ++++-------- .../src/Generated/SampleTypeSpecClient.cs | 6 ++---- 79 files changed, 157 insertions(+), 255 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index a18353be490..e5fd808282a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// cspell:ignore FEFF - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -304,10 +302,7 @@ .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, new[] { Declare("data", result.GetRawResponse().Content(), out var data), - // JsonDocument.Parse(BinaryData) does not strip a leading UTF-8 BOM, so trim it - // from the content string before parsing (mirroring the primitive/enum path above). - Declare("responseContent", typeof(string), data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(), out var responseContent), - UsingDeclare("document", JsonDocumentSnippets.Parse(responseContent), out var jsonDocument), + UsingDeclare("document", data.Parse(), out var jsonDocument), Declare("element", jsonDocument.RootElement(), out var jsonElement), Return(result.FromValue( ScmCodeModelGenerator.Instance.TypeFactory.DeserializeJsonValue( @@ -647,11 +642,9 @@ private IEnumerable GetStackVariablesForReturnValueConversi && !HasOnlyPlainTextContentType()) { var data = result.GetRawResponse().Content(); - var contentExpression = data.InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); var statements = new MethodBodyStatement[] { - Declare("responseContent", typeof(string), contentExpression, out var responseContent), - UsingDeclare("document", JsonDocumentSnippets.Parse(responseContent), out var document) + UsingDeclare("document", data.Parse(), out var document) }; declarations["data"] = data; declarations["document"] = document; @@ -866,11 +859,9 @@ private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi re var plainTextParseType = GetPlainTextParseType(responseBodyType, out var enumType); if (!responseBodyType.Equals(typeof(string)) && plainTextParseType is not null && HasOnlyPlainTextContentType()) { - var contentExpression = response.Content().InvokeToString().Invoke(nameof(string.TrimStart), Literal('\uFEFF')).As(); return [ - Declare("responseContent", typeof(string), contentExpression, out var responseContent), - Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, plainTextParseType, enumType, responseContent), out var value), + Declare("value", responseBodyType, GetPlainTextValueConversion(responseBodyType, plainTextParseType, enumType, response.Content().InvokeToString()), out var value), Return(result.FromValue(value, response)) ]; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs index 92adcc3f6f6..c729f869898 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -1,11 +1,10 @@ -public virtual async global::System.Threading.Tasks.Task> UpdateResourceAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +public virtual async global::System.Threading.Tasks.Task> UpdateResourceAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) { global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.UpdateResourceAsync(content, param2, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs index 3e6f145c10a..2eaf6ad9f42 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -1,11 +1,10 @@ -public virtual global::System.ClientModel.ClientResult UpdateResource(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult UpdateResource(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) { global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.UpdateResource(content, param2, param3, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs index 6f0362c208c..c1844f8cfd1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -1,11 +1,10 @@ -public virtual async global::System.Threading.Tasks.Task> GetDataAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +public virtual async global::System.Threading.Tasks.Task> GetDataAsync(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) { global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param3, param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs index a1c9db2f9a3..4280587f377 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -1,11 +1,10 @@ -public virtual global::System.ClientModel.ClientResult GetData(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetData(string param1, int param2, bool param3, global::System.Threading.CancellationToken cancellationToken = default) { global::Sample.Argument.AssertNotNullOrEmpty(param1, nameof(param1)); using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param3, param2, content, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs index d8eee1177b1..aa2f0e6461a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_MultipleNewOptionalNonBodyParametersAdded.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -36,8 +36,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, param4, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +47,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, param4, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs index 0a030549b66..5e74787430c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalBodyParameterDoesNotAddBackCompatOverload.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -29,8 +29,7 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, content, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -39,8 +38,7 @@ public partial class TestClient { using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs index 3eb5badd2fe..a2bdfe6ff93 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAdded.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -36,8 +36,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = this.GetData(param1, content, param3, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +47,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param2)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs index 33e7cfd26fb..9e9679f33bf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithModelBody.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -35,8 +35,7 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = this.GetData(param1, body, param3, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -46,8 +45,7 @@ public partial class TestClient global::Sample.Argument.AssertNotNull(body, nameof(body)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, body, param3, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs index 05454974818..f88b0b9a854 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalNonBodyParameterAddedWithPathAndHeaderParameters.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -37,8 +37,7 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = this.GetData(itemId, filter, region, sort, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -49,8 +48,7 @@ public partial class TestClient global::Sample.Argument.AssertNotNullOrEmpty(region, nameof(region)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(itemId, filter, region, sort, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs index ef9d1060e4e..7f6dc185754 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewOptionalParameterWithReservedName.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -36,8 +36,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = this.GetData(param1, content0, @select, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -48,8 +47,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content0 = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(content)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param1, content0, @select, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs index a7d8a296a63..5211ba5197d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_NewRequiredParameterDoesNotAddBackCompatOverload.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -35,8 +35,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = this.GetData(param2, param3, content, cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } @@ -47,8 +46,7 @@ public partial class TestClient using global::System.ClientModel.BinaryContent content = global::System.ClientModel.BinaryContent.Create(global::System.BinaryData.FromString(param1)); global::System.ClientModel.ClientResult result = await this.GetDataAsync(param2, param3, content, cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs index 76c675d5e6b..832392216ab 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum value = document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs index b8babbb504c..4ccce563a1c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,True).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetInt32().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs index 83ecbb8d0a8..bcad1492035 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs index 0f9138ef66b..ef95fe3d8b8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,True).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetInt32()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs index 8937191ff31..13e2c62aba1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum value = document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs index a2e643750d1..a52f2c56f0a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,True).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : document.RootElement.GetString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs index 6ad649b8de1..29554182046 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs index 6550046d59d..f90bec4edca 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,True).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::Sample.Models.TestEnum? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(document.RootElement.GetString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs index a79117abb00..f74bcf62f77 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/MixedContentTypeScalarResponseUsesJsonConversion.cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs index fa3e9b99eec..31948d34930 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Constant).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs index d0472ddb0da..4fd4de600a8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(ConstantNullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs index e540b2194df..10cd828377f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "P"); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "P"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs index 43df82093b5..684057a69d7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(Iso8601Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "P"); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "P"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs index c989740a7fb..8af31802799 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs index bc00e8878fe..8d3a055fd56 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat32Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs index c989740a7fb..8af31802799 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs index bc00e8878fe..8d3a055fd56 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsFloat64Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs index 24f12e738d6..ea0374f921c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs index 7cea97aa7b2..836f9ff9e8a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs index df1cc8872f3..f267d6110c6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromMilliseconds(long.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs index af446fc2ac6..633fefa5671 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt64Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromMilliseconds(long.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs index 5a51537a96e..2a40fa9746d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs index 0f3ec66fef1..59035730cd0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat32Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs index 5a51537a96e..2a40fa9746d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs index 0f3ec66fef1..59035730cd0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsFloat64Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(double.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs index 4dc2b1d12bf..b266a987ede 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs index 9576b3d43eb..085552346c9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs index d75bf80ef53..1141f80e2a9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan value = global::System.TimeSpan.FromSeconds(long.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs index a2d1a971259..fba9b6ecf21 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt64Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(long.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::System.TimeSpan.FromSeconds(long.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs index fa3e9b99eec..31948d34930 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding(Custom).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextDuration(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextDuration(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "c"); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs index 8af61cdb4f1..16f1513d957 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + global::Sample.Models.TestEnum value = int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs index 24c555b35bb..2261133f28a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture).ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs index 70aaf2a1eab..cffbb91ac8a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs index a964515b28a..2287c802558 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture)); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture)); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs index f88b306e31e..055da862dae 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = responseContent.ToTestEnum(); + global::Sample.Models.TestEnum value = result.GetRawResponse().Content.ToString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs index ee7da3bdb11..66cbe3bd949 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : responseContent.ToTestEnum(); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : result.GetRawResponse().Content.ToString().ToTestEnum(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs index fce15f31fdf..c7346c5252b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(responseContent); + global::Sample.Models.TestEnum value = new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs index cdd51459e22..c1461d8a36b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextEnum(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextEnum(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::Sample.Models.TestEnum? value = (responseContent.Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(responseContent); + global::Sample.Models.TestEnum? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::Sample.Models.TestEnum?)null) : new global::Sample.Models.TestEnum(result.GetRawResponse().Content.ToString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs index 8af52b6f272..7f3da3146bb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - bool value = bool.Parse(responseContent); + bool value = bool.Parse(result.GetRawResponse().Content.ToString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs index f7157d25b4a..eaa8edcdbfe 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - bool? value = (responseContent.Trim() == "null") ? ((bool?)null) : bool.Parse(responseContent); + bool? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((bool?)null) : bool.Parse(result.GetRawResponse().Content.ToString()); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs index 2cb8ae9f1fa..74cb6f79e6e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Byte).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - byte value = byte.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); + byte value = byte.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs index 540edacf26e..216026abda2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(responseContent, "D"); + global::System.DateTimeOffset value = global::Sample.TypeFormatters.ParseDateTimeOffset(result.GetRawResponse().Content.ToString(), "D"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs index 3552596ea3a..13d3ccecf4d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - int value = int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); + int value = int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs index 417bd715874..2b632b0d293 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - int? value = (responseContent.Trim() == "null") ? ((int?)null) : int.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); + int? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((int?)null) : int.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs index 9df44570c5f..52064786a8c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(SByte).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - sbyte value = sbyte.Parse(responseContent, global::System.Globalization.CultureInfo.InvariantCulture); + sbyte value = sbyte.Parse(result.GetRawResponse().Content.ToString(), global::System.Globalization.CultureInfo.InvariantCulture); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs index f376fd91ae7..7fa72748f9f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "T"); + global::System.TimeSpan value = global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs index 3c9abe5c949..5c02cd85b6b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.TimeSpan? value = (responseContent.Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(responseContent, "T"); + global::System.TimeSpan? value = (result.GetRawResponse().Content.ToString().Trim() == "null") ? ((global::System.TimeSpan?)null) : global::Sample.TypeFormatters.ParseTimeSpan(result.GetRawResponse().Content.ToString(), "T"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs index 33ac4138f24..300e3802ab8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Uri).cs @@ -1,7 +1,6 @@ -public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetPlainTextScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetPlainTextScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - global::System.Uri value = new global::System.Uri(responseContent, global::System.UriKind.RelativeOrAbsolute); + global::System.Uri value = new global::System.Uri(result.GetRawResponse().Content.ToString(), global::System.UriKind.RelativeOrAbsolute); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs index 64efc8b63b8..f63132d6c5b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Boolean).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); bool value = document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs index d195b47e755..ea4ec45fb30 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); bool? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((bool?)null) : document.RootElement.GetBoolean(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs index 14f1dfdcc07..547644c070e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Byte).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); byte value = document.RootElement.GetByte(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index d2093f1da79..87a71809421 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::System.DateTimeOffset value = document.RootElement.GetDateTimeOffset(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs index 805b2536a73..730ef745679 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); decimal value = document.RootElement.GetDecimal(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs index 969f7115a27..7651c3d213f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Double).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); double value = document.RootElement.GetDouble(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs index fabc6864f25..f74bcf62f77 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs index e70666393ba..ec5d20e2a31 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -1,8 +1,7 @@ -public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) +public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); int value = document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs index 32d4a8bc966..2514bcd7e46 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs index abccb3207b7..f1e37ab2e4b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -1,8 +1,7 @@ -public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) +public virtual async global::System.Threading.Tasks.Task> GetScalarAsync(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = await this.GetScalarAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); int? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((int?)null) : document.RootElement.GetInt32(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs index e3a6750d45f..4a044c38e5c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int64).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); long value = document.RootElement.GetInt64(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs index aaa5edd149e..8ecf52e4e9f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(SByte).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); sbyte value = document.RootElement.GetSByte(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index b1665f28222..5609e7604ca 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); float value = document.RootElement.GetSingle(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs index 2ef5985a49f..196feb5e4c4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(String).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); string value = document.RootElement.GetString(); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs index 01bcb5abce3..3196af47bea 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpan).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::System.TimeSpan value = document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs index de29b05007d..ee7791725a9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).cs @@ -1,8 +1,7 @@ -public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) +public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::System.TimeSpan? value = (document.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Null) ? ((global::System.TimeSpan?)null) : document.RootElement.GetTimeSpan("c"); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs index 132ea56216e..04e2feca393 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Uri).cs @@ -1,8 +1,7 @@ public virtual global::System.ClientModel.ClientResult GetScalar(global::System.Threading.CancellationToken cancellationToken = default) { global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(responseContent); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(result.GetRawResponse().Content); global::System.Uri value = new global::System.Uri(document.RootElement.GetString(), global::System.UriKind.RelativeOrAbsolute); return global::System.ClientModel.ClientResult.FromValue(value, result.GetRawResponse()); } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs index 6874e0fdbd4..09ad1945975 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/ExtensibleEnumTests.cs @@ -7,7 +7,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Text; using System.Threading.Tasks; using Moq; using NUnit.Framework; @@ -17,14 +16,11 @@ namespace TestProjects.Local.Tests { public class ExtensibleEnumTests { - [TestCase(false, false)] - [TestCase(false, true)] - [TestCase(true, false)] - [TestCase(true, true)] - public async Task EnumResponseDeserialization(bool hasBom, bool isAsync) + [TestCase(false)] + [TestCase(true)] + public async Task EnumResponseDeserialization(bool isAsync) { - var bom = hasBom ? Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) : string.Empty; - var content = BinaryData.FromString(bom + "Monday"); + var content = BinaryData.FromString("Monday"); var response = new Mock(); response.SetupGet(r => r.Content).Returns(content); var protocolResult = ClientResult.FromResponse(response.Object); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 792f8625d5e..f9f6970f13a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -1086,8 +1086,7 @@ public virtual async Task GetUnknownValueAsync(RequestOptions opti public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) { ClientResult result = GetUnknownValue(cancellationToken.ToRequestOptions()); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(responseContent); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString()); return ClientResult.FromValue(value, result.GetRawResponse()); } @@ -1097,8 +1096,7 @@ public virtual ClientResult GetUnknownValue(Cancellati public virtual async Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) { ClientResult result = await GetUnknownValueAsync(cancellationToken.ToRequestOptions()).ConfigureAwait(false); - string responseContent = result.GetRawResponse().Content.ToString().TrimStart(''); - DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(responseContent); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(result.GetRawResponse().Content.ToString()); return ClientResult.FromValue(value, result.GetRawResponse()); }