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..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 @@ -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; @@ -294,13 +297,19 @@ .. 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) - ? Return(result.FromValue(GetResultConversion(result, result.GetRawResponse(), responseBodyType, resultDeclarations), result.GetRawResponse())) + || IsPlainTextParsableType(responseBodyType) + ? GetResultConversionStatements(result, result.GetRawResponse(), responseBodyType, resultDeclarations) : 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( @@ -634,6 +643,23 @@ private IEnumerable GetStackVariablesForReturnValueConversi out declarations); } + if ((IsConvertibleFromBinaryData(responseBodyType) || IsPlainTextParsableType(responseBodyType)) + && (responseBodyType.IsFrameworkType || responseBodyType.IsEnum) + && !responseBodyType.Equals(typeof(BinaryData)) + && !HasOnlyPlainTextContentType()) + { + var data = result.GetRawResponse().Content(); + 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) + }; + declarations["data"] = data; + declarations["document"] = document; + return statements; + } + return []; } @@ -837,6 +863,49 @@ private MethodBodyStatement AddElement(ValueExpression? dictKey, ValueExpression return scopedApi.Add(element); } + private MethodBodyStatement[] GetResultConversionStatements(ClientResponseApi result, HttpResponseApi response, CSharpType responseBodyType, Dictionary declarations) + { + 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("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)) + || responseBodyType.IsCollection + || (responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()); + + 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))) @@ -855,19 +924,152 @@ 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 (responseBodyType.Equals(typeof(string)) && HasOnlyPlainTextContentType()) { return response.Content().InvokeToString(); } - if (responseBodyType.IsFrameworkType) + return result.CastTo(responseBodyType); + } + + private ValueExpression GetPlainTextValueConversion(CSharpType responseBodyType, Type parseType, CSharpType? enumType, ValueExpression content) + { + var invariantCulture = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); + var deserializedValue = parseType 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(content, FrameworkEnumValue(UriKind.RelativeOrAbsolute)), + 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) + }; + + if (enumType is not null) { - return response.Content().ToObjectFromJson(responseBodyType); + deserializedValue = enumType.ToEnum(deserializedValue); } - if (responseBodyType.IsEnum) + + return responseBodyType.IsNullable + ? new TernaryConditionalExpression(content.As().Trim().Equal(Literal("null")), Null.CastTo(responseBodyType), deserializedValue) + : 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(); + 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 => + 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)) + }; + } + + /// + /// Builds a T.Parse(content, invariantCulture) invocation for the given numeric . + /// + 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(); + } + + 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 }) { - return responseBodyType.ToEnum(response.Content().ToObjectFromJson(responseBodyType.UnderlyingEnumType)); + enumType = typeToParse; + typeToParse = underlyingEnumType; } - return result.CastTo(responseBodyType); + + 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 + .Where(r => r.IsErrorResponse is false) + .SelectMany(r => r.ContentTypes); + return contentTypes.Any() && contentTypes.All(contentType => contentType == "text/plain"); + } + + 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) 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..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,13 +3049,9 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() var body = syncConvenienceMethod!.BodyStatements; 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); + 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)); @@ -3064,13 +3060,9 @@ public async Task BackCompatibility_ConvenienceMethodParamOrderChanged() body = asyncConvenienceMethod!.BodyStatements; 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); + using var asyncWriter = new CodeWriter(); + asyncWriter.WriteMethod(asyncConvenienceMethod); + Assert.AreEqual(Helpers.GetExpectedFromFile("Async"), asyncWriter.ToString(false)); } [Test] @@ -3146,13 +3138,9 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() var body = syncConvenienceMethod!.BodyStatements; 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); + 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)); @@ -3161,13 +3149,9 @@ public async Task BackCompatibility_BothMethodsParamOrderChanged() body = asyncConvenienceMethod!.BodyStatements; 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); + 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 new file mode 100644 index 00000000000..9de15e41fea --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Async).cs @@ -0,0 +1,11 @@ +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 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 new file mode 100644 index 00000000000..d1964fb2048 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_BothMethodsParamOrderChanged(Sync).cs @@ -0,0 +1,11 @@ +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 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 new file mode 100644 index 00000000000..d455517fc1d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Async).cs @@ -0,0 +1,11 @@ +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 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 new file mode 100644 index 00000000000..a91fdb1c1af --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/BackCompatibility_ConvenienceMethodParamOrderChanged(Sync).cs @@ -0,0 +1,11 @@ +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 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 ecd8a142b0c..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,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,10 @@ 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()); + 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()); } 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 +48,10 @@ 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()); + 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()); } #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..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,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,20 @@ 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()); + 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()); } 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()); + 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 dec0cb1513e..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,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,10 @@ 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()); + 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()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string param2, bool? param3 = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -44,7 +48,10 @@ 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()); + 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()); } #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..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,6 +5,7 @@ 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 +35,10 @@ 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()); + 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()); } 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,10 @@ 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()); + 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()); } #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..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,6 +5,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -36,7 +37,10 @@ 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()); + 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()); } 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,10 @@ 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()); + 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()); } #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..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,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,10 @@ 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()); + 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()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param1, string content, string @select = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -44,7 +48,10 @@ 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()); + 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()); } [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..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,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,10 @@ 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()); + 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()); } public virtual async global::System.Threading.Tasks.Task> GetDataAsync(int param2, bool param3, string param1, global::System.Threading.CancellationToken cancellationToken = default) @@ -43,7 +47,10 @@ 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()); + 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 6aadbf6d2f5..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; @@ -909,7 +912,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 +1562,31 @@ 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(byte))] + [TestCase(typeof(sbyte))] [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, @@ -1581,10 +1594,17 @@ public void ScalarReturnTypeMethods(Type type) { } 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 }; + if (underlyingType != null) + { + inputType = new InputNullableType(inputType!); + } + var inputOperation = InputFactory.Operation( "GetScalar", responses: [InputFactory.OperationResponse([200], inputType!)]); @@ -1600,9 +1620,275 @@ 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; + using var writer = new CodeWriter(); + writer.WriteMethod(convenienceMethod!); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{baselineName}{(isAsync ? "Async" : "")}"), writer.ToString(false)); + } + + [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 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"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile($"{isString},{isExtensible},{isNullable}"), writer.ToString(false)); + } + + [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"); + + using var writer = new CodeWriter(); + writer.WriteMethod(method); + Assert.AreEqual(Helpers.GetExpectedFromFile(), writer.ToString(false)); + } + + [TestCase(typeof(int))] + [TestCase(typeof(int?))] + [TestCase(typeof(bool))] + [TestCase(typeof(bool?))] + [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); + 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, + { } 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) + { + inputType = new InputNullableType(inputType); + } + + 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); + var baselineName = underlyingType != null ? $"{underlyingType.Name}Nullable" : type.Name; + Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); + } + + [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("Iso8601", null, true)] + [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) + { + DurationKnownEncoding durationEncoding = encoding switch + { + "Iso8601" => DurationKnownEncoding.Iso8601, + "Constant" => DurationKnownEncoding.Constant, + "Seconds" => DurationKnownEncoding.Seconds, + "Milliseconds" => DurationKnownEncoding.Milliseconds, + _ => throw new NotSupportedException() + }; + 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); + if (isNullable) + { + inputType = new InputNullableType(inputType); + } + + 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); + var baselineName = (wireKind is { } k ? $"{encoding}{k}" : encoding) + (isNullable ? "Nullable" : string.Empty); + Assert.AreEqual(Helpers.GetExpectedFromFile(baselineName), writer.ToString(false)); + } + + [Test] + public void PlainTextDurationReturnTypeMethodsReportsUnsupportedEncoding() + { + 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]); + + 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 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); + 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)] + [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"])]); + 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},{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() + { + // 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] 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..852aebbba1e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,False,False).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()); + 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 new file mode 100644 index 00000000000..436e4b9279f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,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()); + 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 new file mode 100644 index 00000000000..69683a932f8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(False,True,False).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()); + 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 new file mode 100644 index 00000000000..e004129df37 --- /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()); + 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 new file mode 100644 index 00000000000..be09c28980b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,False,False).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()); + 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 new file mode 100644 index 00000000000..5ce2e23099b --- /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()); + 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 new file mode 100644 index 00000000000..1cf3ed795da --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,True,False).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()); + 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 new file mode 100644 index 00000000000..057ea1ef413 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/EnumReturnTypeMethods(True,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()); + 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 new file mode 100644 index 00000000000..31b82c8fc16 --- /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()); + 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/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(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(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(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()); +} 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(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(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(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(MillisecondsInt32).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(MillisecondsInt32).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(MillisecondsInt32).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(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(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(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(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(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(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(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()); +} 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 new file mode 100644 index 00000000000..1effae407a0 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextDurationReturnTypeMethods(SecondsInt32).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/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()); +} 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()); +} 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()); +} 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/PlainTextEnumReturnTypeMethods(False,False,False).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs new file mode 100644 index 00000000000..e3de8f298ee --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,False).cs @@ -0,0 +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(); + return 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 new file mode 100644 index 00000000000..972e902f810 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,False,True).cs @@ -0,0 +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(); + return 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 new file mode 100644 index 00000000000..6076a3a76f8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,False).cs @@ -0,0 +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)); + return 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 new file mode 100644 index 00000000000..3fadb9f4cc3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(False,True,True).cs @@ -0,0 +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)); + return 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 new file mode 100644 index 00000000000..5db2345600e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,False).cs @@ -0,0 +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(); + return 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 new file mode 100644 index 00000000000..32773d0b10c --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,False,True).cs @@ -0,0 +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(); + return 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 new file mode 100644 index 00000000000..c2384e9e4a1 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,False).cs @@ -0,0 +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); + return 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 new file mode 100644 index 00000000000..99ffd919910 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextEnumReturnTypeMethods(True,True,True).cs @@ -0,0 +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); + return global::System.ClientModel.ClientResult.FromValue(value, 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..95920e5f6ba --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextReturnTypeMethods.cs @@ -0,0 +1,5 @@ +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/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..e60aa9f8da9 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Boolean).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(''); + 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 new file mode 100644 index 00000000000..99144f3d66d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(BooleanNullable).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(''); + 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(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(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..2096ab0828b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(DateTimeOffset).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.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 new file mode 100644 index 00000000000..5830cf55741 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32).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(''); + 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 new file mode 100644 index 00000000000..19ce9ffe81b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(Int32Nullable).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(''); + 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(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(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..f8786805243 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpan).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.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 new file mode 100644 index 00000000000..a3debf5c6f5 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/PlainTextScalarReturnTypeMethods(TimeSpanNullable).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.TimeSpan? value = (content.Trim() == "null") ? ((global::System.TimeSpan?)null) : 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(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..e657b2b0bb5 --- /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, 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/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()); +} 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 a418e708844..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 new file mode 100644 index 00000000000..bd688db8f2d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(BooleanNullable).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); + 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 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(DateTimeOffset).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(DateTimeOffset).cs index dd967f8292f..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 new file mode 100644 index 00000000000..9fe273cc03b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Decimal).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); + 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 b6d44cd9c10..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 cb0644c9c72..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 new file mode 100644 index 00000000000..c27126bbfa8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Async).cs @@ -0,0 +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); + 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 new file mode 100644 index 00000000000..22b846f5be7 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32Nullable).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); + 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 new file mode 100644 index 00000000000..50fc187fe0b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Int32NullableAsync).cs @@ -0,0 +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); + 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 558d73a47ea..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 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(Single).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(Single).cs index df2eb3be24c..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 1cf02c42f1e..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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 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 9012ebf182c..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,2 +1,8 @@ -global::System.ClientModel.ClientResult result = this.GetScalar(cancellationToken.ToRequestOptions()); -return global::System.ClientModel.ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse()); +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); + 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 new file mode 100644 index 00000000000..bf91854b34f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ScmMethodProviderCollectionTests/ScalarReturnTypeMethods(TimeSpanNullable).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); + 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 3a0a7cfdd2e..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,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()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + using global::System.Text.Json.JsonDocument document = global::System.Text.Json.JsonDocument.Parse(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/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); 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..6874e0fdbd4 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,14 @@ // 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.Text; +using System.Threading.Tasks; +using Moq; using NUnit.Framework; using SampleTypeSpec; @@ -12,6 +17,30 @@ 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 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); + 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.Tests/PrimitiveResponseTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs new file mode 100644 index 00000000000..a18c819431c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/PrimitiveResponseTests.cs @@ -0,0 +1,65 @@ +// 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); + } + + [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 7daa3c98cff..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 @@ -947,3 +947,19 @@ 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"; +}; + +@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 23707366819..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 @@ -499,5 +499,29 @@ 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; + } + + 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 9e3d6da09ad..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 @@ -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()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); + return ClientResult.FromValue(value, 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()); + string content = result.GetRawResponse().Content.ToString().TrimStart(''); + DaysOfWeekExtensibleEnum value = new DaysOfWeekExtensibleEnum(content); + return ClientResult.FromValue(value, result.GetRawResponse()); } /// @@ -2059,6 +2064,122 @@ 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()); + } + + /// + /// [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 c9dfa4e0ea7..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 @@ -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": "GetJsonInt32ResponseContentType40", "namespace": "", "usage": "None", "valueType": { @@ -2288,7 +2288,7 @@ { "$id": "234", "kind": "constant", - "name": "GetTreeAsJsonResponseContentType39", + "name": "GetJsonInt32ResponseContentType41", "namespace": "", "usage": "None", "valueType": { @@ -2305,7 +2305,7 @@ { "$id": "236", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType8", + "name": "GetXmlAdvancedModelResponseContentType6", "namespace": "", "usage": "None", "valueType": { @@ -2322,7 +2322,7 @@ { "$id": "238", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType9", + "name": "GetXmlAdvancedModelResponseContentType7", "namespace": "", "usage": "None", "valueType": { @@ -2339,7 +2339,7 @@ { "$id": "240", "kind": "constant", - "name": "GetXmlAdvancedModelResponseContentType10", + "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": "GetXmlAdvancedModelResponseContentType11", + "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": "GetTreeAsJsonResponseContentType40", + "name": "GetXmlAdvancedModelResponseContentType8", "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": "GetXmlAdvancedModelResponseContentType9", "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": "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": "GetTreeAsJsonResponseContentType43", + "name": "GetXmlAdvancedModelResponseContentType11", "namespace": "", "usage": "None", "valueType": { @@ -2434,14 +2434,14 @@ "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, - "value": "application/json", + "value": "application/xml", "decorators": [], "isExactName": false }, { "$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,79 @@ "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 + }, + { + "$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": "256", + "$id": "264", "kind": "model", "name": "Thing", "apiVersions": [ @@ -2495,7 +2563,7 @@ "isExactName": false, "properties": [ { - "$id": "257", + "$id": "265", "kind": "property", "name": "name", "apiVersions": [ @@ -2505,7 +2573,7 @@ "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "258", + "$id": "266", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2526,7 +2594,7 @@ "isExactName": false }, { - "$id": "259", + "$id": "267", "kind": "property", "name": "requiredUnion", "apiVersions": [ @@ -2536,23 +2604,23 @@ "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$id": "260", + "$id": "268", "kind": "union", "name": "ThingRequiredUnion", "variantTypes": [ { - "$id": "261", + "$id": "269", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, { - "$id": "262", + "$id": "270", "kind": "array", "name": "Array", "valueType": { - "$id": "263", + "$id": "271", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2562,7 +2630,7 @@ "decorators": [] }, { - "$id": "264", + "$id": "272", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2588,7 +2656,7 @@ "isExactName": false }, { - "$id": "265", + "$id": "273", "kind": "property", "name": "requiredLiteralString", "apiVersions": [ @@ -2615,7 +2683,7 @@ "isExactName": false }, { - "$id": "266", + "$id": "274", "kind": "property", "name": "requiredNullableString", "apiVersions": [ @@ -2625,10 +2693,10 @@ "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$id": "267", + "$id": "275", "kind": "nullable", "type": { - "$id": "268", + "$id": "276", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2651,7 +2719,7 @@ "isExactName": false }, { - "$id": "269", + "$id": "277", "kind": "property", "name": "optionalNullableString", "apiVersions": [ @@ -2661,10 +2729,10 @@ "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$id": "270", + "$id": "278", "kind": "nullable", "type": { - "$id": "271", + "$id": "279", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2687,7 +2755,7 @@ "isExactName": false }, { - "$id": "272", + "$id": "280", "kind": "property", "name": "requiredLiteralInt", "apiVersions": [ @@ -2714,7 +2782,7 @@ "isExactName": false }, { - "$id": "273", + "$id": "281", "kind": "property", "name": "requiredLiteralFloat", "apiVersions": [ @@ -2741,7 +2809,7 @@ "isExactName": false }, { - "$id": "274", + "$id": "282", "kind": "property", "name": "requiredLiteralBool", "apiVersions": [ @@ -2768,7 +2836,7 @@ "isExactName": false }, { - "$id": "275", + "$id": "283", "kind": "property", "name": "optionalLiteralString", "apiVersions": [ @@ -2795,7 +2863,7 @@ "isExactName": false }, { - "$id": "276", + "$id": "284", "kind": "property", "name": "requiredNullableLiteralString", "apiVersions": [ @@ -2805,7 +2873,7 @@ "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$id": "277", + "$id": "285", "kind": "nullable", "type": { "$ref": "5" @@ -2827,7 +2895,7 @@ "isExactName": false }, { - "$id": "278", + "$id": "286", "kind": "property", "name": "optionalLiteralInt", "apiVersions": [ @@ -2854,7 +2922,7 @@ "isExactName": false }, { - "$id": "279", + "$id": "287", "kind": "property", "name": "optionalLiteralFloat", "apiVersions": [ @@ -2881,7 +2949,7 @@ "isExactName": false }, { - "$id": "280", + "$id": "288", "kind": "property", "name": "optionalLiteralBool", "apiVersions": [ @@ -2908,7 +2976,7 @@ "isExactName": false }, { - "$id": "281", + "$id": "289", "kind": "property", "name": "requiredBadDescription", "apiVersions": [ @@ -2918,7 +2986,7 @@ "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "282", + "$id": "290", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2939,7 +3007,7 @@ "isExactName": false }, { - "$id": "283", + "$id": "291", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -2949,14 +3017,14 @@ "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$id": "284", + "$id": "292", "kind": "nullable", "type": { - "$id": "285", + "$id": "293", "kind": "array", "name": "Array1", "valueType": { - "$id": "286", + "$id": "294", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -2982,7 +3050,7 @@ "isExactName": false }, { - "$id": "287", + "$id": "295", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -2992,10 +3060,10 @@ "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$id": "288", + "$id": "296", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -3014,7 +3082,7 @@ "isExactName": false }, { - "$id": "289", + "$id": "297", "kind": "property", "name": "propertyWithSpecialDocs", "apiVersions": [ @@ -3024,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": "290", + "$id": "298", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3047,7 +3115,7 @@ ] }, { - "$id": "291", + "$id": "299", "kind": "model", "name": "RoundTripModel", "apiVersions": [ @@ -3067,7 +3135,7 @@ "isExactName": false, "properties": [ { - "$id": "292", + "$id": "300", "kind": "property", "name": "requiredString", "apiVersions": [ @@ -3077,7 +3145,7 @@ "serializedName": "requiredString", "doc": "Required string, illustrating a reference type property.", "type": { - "$id": "293", + "$id": "301", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3098,7 +3166,7 @@ "isExactName": false }, { - "$id": "294", + "$id": "302", "kind": "property", "name": "requiredInt", "apiVersions": [ @@ -3108,7 +3176,7 @@ "serializedName": "requiredInt", "doc": "Required int, illustrating a value type property.", "type": { - "$id": "295", + "$id": "303", "kind": "int32", "name": "int32", "encode": "string", @@ -3130,7 +3198,7 @@ "isExactName": false }, { - "$id": "296", + "$id": "304", "kind": "property", "name": "requiredCollection", "apiVersions": [ @@ -3140,7 +3208,7 @@ "serializedName": "requiredCollection", "doc": "Required collection of enums", "type": { - "$id": "297", + "$id": "305", "kind": "array", "name": "ArrayStringFixedEnum", "valueType": { @@ -3164,7 +3232,7 @@ "isExactName": false }, { - "$id": "298", + "$id": "306", "kind": "property", "name": "requiredDictionary", "apiVersions": [ @@ -3174,10 +3242,10 @@ "serializedName": "requiredDictionary", "doc": "Required dictionary of enums", "type": { - "$id": "299", + "$id": "307", "kind": "dict", "keyType": { - "$id": "300", + "$id": "308", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3203,7 +3271,7 @@ "isExactName": false }, { - "$id": "301", + "$id": "309", "kind": "property", "name": "requiredModel", "apiVersions": [ @@ -3213,7 +3281,7 @@ "serializedName": "requiredModel", "doc": "Required model", "type": { - "$ref": "256" + "$ref": "264" }, "optional": false, "readOnly": false, @@ -3230,7 +3298,7 @@ "isExactName": false }, { - "$id": "302", + "$id": "310", "kind": "property", "name": "intExtensibleEnum", "apiVersions": [ @@ -3257,7 +3325,7 @@ "isExactName": false }, { - "$id": "303", + "$id": "311", "kind": "property", "name": "intExtensibleEnumCollection", "apiVersions": [ @@ -3267,7 +3335,7 @@ "serializedName": "intExtensibleEnumCollection", "doc": "this is a collection of int based extensible enum", "type": { - "$id": "304", + "$id": "312", "kind": "array", "name": "ArrayIntExtensibleEnum", "valueType": { @@ -3291,7 +3359,7 @@ "isExactName": false }, { - "$id": "305", + "$id": "313", "kind": "property", "name": "floatExtensibleEnum", "apiVersions": [ @@ -3318,7 +3386,7 @@ "isExactName": false }, { - "$id": "306", + "$id": "314", "kind": "property", "name": "floatExtensibleEnumWithIntValue", "apiVersions": [ @@ -3345,7 +3413,7 @@ "isExactName": false }, { - "$id": "307", + "$id": "315", "kind": "property", "name": "floatExtensibleEnumCollection", "apiVersions": [ @@ -3355,7 +3423,7 @@ "serializedName": "floatExtensibleEnumCollection", "doc": "this is a collection of float based extensible enum", "type": { - "$id": "308", + "$id": "316", "kind": "array", "name": "ArrayFloatExtensibleEnum", "valueType": { @@ -3379,7 +3447,7 @@ "isExactName": false }, { - "$id": "309", + "$id": "317", "kind": "property", "name": "floatFixedEnum", "apiVersions": [ @@ -3406,7 +3474,7 @@ "isExactName": false }, { - "$id": "310", + "$id": "318", "kind": "property", "name": "floatFixedEnumWithIntValue", "apiVersions": [ @@ -3433,7 +3501,7 @@ "isExactName": false }, { - "$id": "311", + "$id": "319", "kind": "property", "name": "floatFixedEnumCollection", "apiVersions": [ @@ -3443,7 +3511,7 @@ "serializedName": "floatFixedEnumCollection", "doc": "this is a collection of float based fixed enum", "type": { - "$id": "312", + "$id": "320", "kind": "array", "name": "ArrayFloatFixedEnum", "valueType": { @@ -3467,7 +3535,7 @@ "isExactName": false }, { - "$id": "313", + "$id": "321", "kind": "property", "name": "intFixedEnum", "apiVersions": [ @@ -3494,7 +3562,7 @@ "isExactName": false }, { - "$id": "314", + "$id": "322", "kind": "property", "name": "intFixedEnumCollection", "apiVersions": [ @@ -3504,7 +3572,7 @@ "serializedName": "intFixedEnumCollection", "doc": "this is a collection of int based fixed enum", "type": { - "$id": "315", + "$id": "323", "kind": "array", "name": "ArrayIntFixedEnum", "valueType": { @@ -3528,7 +3596,7 @@ "isExactName": false }, { - "$id": "316", + "$id": "324", "kind": "property", "name": "stringFixedEnum", "apiVersions": [ @@ -3555,7 +3623,7 @@ "isExactName": false }, { - "$id": "317", + "$id": "325", "kind": "property", "name": "requiredUnknown", "apiVersions": [ @@ -3565,7 +3633,7 @@ "serializedName": "requiredUnknown", "doc": "required unknown", "type": { - "$id": "318", + "$id": "326", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3586,7 +3654,7 @@ "isExactName": false }, { - "$id": "319", + "$id": "327", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -3596,7 +3664,7 @@ "serializedName": "optionalUnknown", "doc": "optional unknown", "type": { - "$id": "320", + "$id": "328", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3617,7 +3685,7 @@ "isExactName": false }, { - "$id": "321", + "$id": "329", "kind": "property", "name": "requiredRecordUnknown", "apiVersions": [ @@ -3627,17 +3695,17 @@ "serializedName": "requiredRecordUnknown", "doc": "required record of unknown", "type": { - "$id": "322", + "$id": "330", "kind": "dict", "keyType": { - "$id": "323", + "$id": "331", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "324", + "$id": "332", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -3660,7 +3728,7 @@ "isExactName": false }, { - "$id": "325", + "$id": "333", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -3670,7 +3738,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "322" + "$ref": "330" }, "optional": true, "readOnly": false, @@ -3687,7 +3755,7 @@ "isExactName": false }, { - "$id": "326", + "$id": "334", "kind": "property", "name": "readOnlyRequiredRecordUnknown", "apiVersions": [ @@ -3697,7 +3765,7 @@ "serializedName": "readOnlyRequiredRecordUnknown", "doc": "required readonly record of unknown", "type": { - "$ref": "322" + "$ref": "330" }, "optional": false, "readOnly": true, @@ -3714,7 +3782,7 @@ "isExactName": false }, { - "$id": "327", + "$id": "335", "kind": "property", "name": "readOnlyOptionalRecordUnknown", "apiVersions": [ @@ -3724,7 +3792,7 @@ "serializedName": "readOnlyOptionalRecordUnknown", "doc": "optional readonly record of unknown", "type": { - "$ref": "322" + "$ref": "330" }, "optional": true, "readOnly": true, @@ -3741,7 +3809,7 @@ "isExactName": false }, { - "$id": "328", + "$id": "336", "kind": "property", "name": "modelWithRequiredNullable", "apiVersions": [ @@ -3751,7 +3819,7 @@ "serializedName": "modelWithRequiredNullable", "doc": "this is a model with required nullable properties", "type": { - "$id": "329", + "$id": "337", "kind": "model", "name": "ModelWithRequiredNullableProperties", "apiVersions": [ @@ -3771,7 +3839,7 @@ "isExactName": false, "properties": [ { - "$id": "330", + "$id": "338", "kind": "property", "name": "requiredNullablePrimitive", "apiVersions": [ @@ -3781,10 +3849,10 @@ "serializedName": "requiredNullablePrimitive", "doc": "required nullable primitive type", "type": { - "$id": "331", + "$id": "339", "kind": "nullable", "type": { - "$id": "332", + "$id": "340", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -3807,7 +3875,7 @@ "isExactName": false }, { - "$id": "333", + "$id": "341", "kind": "property", "name": "requiredExtensibleEnum", "apiVersions": [ @@ -3817,7 +3885,7 @@ "serializedName": "requiredExtensibleEnum", "doc": "required nullable extensible enum type", "type": { - "$id": "334", + "$id": "342", "kind": "nullable", "type": { "$ref": "22" @@ -3839,7 +3907,7 @@ "isExactName": false }, { - "$id": "335", + "$id": "343", "kind": "property", "name": "requiredFixedEnum", "apiVersions": [ @@ -3849,7 +3917,7 @@ "serializedName": "requiredFixedEnum", "doc": "required nullable fixed enum type", "type": { - "$id": "336", + "$id": "344", "kind": "nullable", "type": { "$ref": "17" @@ -3887,7 +3955,7 @@ "isExactName": false }, { - "$id": "337", + "$id": "345", "kind": "property", "name": "requiredBytes", "apiVersions": [ @@ -3897,7 +3965,7 @@ "serializedName": "requiredBytes", "doc": "Required bytes", "type": { - "$id": "338", + "$id": "346", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -3921,10 +3989,10 @@ ] }, { - "$ref": "329" + "$ref": "337" }, { - "$id": "339", + "$id": "347", "kind": "model", "name": "Wrapper", "apiVersions": [ @@ -3939,7 +4007,7 @@ "isExactName": false, "properties": [ { - "$id": "340", + "$id": "348", "kind": "property", "name": "p1", "apiVersions": [ @@ -3948,7 +4016,7 @@ ], "doc": "header parameter", "type": { - "$id": "341", + "$id": "349", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3965,7 +4033,7 @@ "isExactName": false }, { - "$id": "342", + "$id": "350", "kind": "property", "name": "action", "apiVersions": [ @@ -3974,7 +4042,7 @@ ], "doc": "body parameter", "type": { - "$ref": "291" + "$ref": "299" }, "optional": false, "readOnly": false, @@ -3987,7 +4055,7 @@ "isExactName": false }, { - "$id": "343", + "$id": "351", "kind": "property", "name": "p2", "apiVersions": [ @@ -3996,7 +4064,7 @@ ], "doc": "path parameter", "type": { - "$id": "344", + "$id": "352", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4015,7 +4083,7 @@ ] }, { - "$id": "345", + "$id": "353", "kind": "model", "name": "Friend", "apiVersions": [ @@ -4035,7 +4103,7 @@ "isExactName": false, "properties": [ { - "$id": "346", + "$id": "354", "kind": "property", "name": "name", "apiVersions": [ @@ -4045,7 +4113,7 @@ "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "347", + "$id": "355", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4068,7 +4136,7 @@ ] }, { - "$id": "348", + "$id": "356", "kind": "model", "name": "RenamedModel", "apiVersions": [ @@ -4088,7 +4156,7 @@ "isExactName": false, "properties": [ { - "$id": "349", + "$id": "357", "kind": "property", "name": "otherName", "apiVersions": [ @@ -4098,7 +4166,7 @@ "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "350", + "$id": "358", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4121,7 +4189,7 @@ ] }, { - "$id": "351", + "$id": "359", "kind": "model", "name": "ReturnsAnonymousModelResponse", "apiVersions": [ @@ -4141,7 +4209,7 @@ "properties": [] }, { - "$id": "352", + "$id": "360", "kind": "model", "name": "ListWithNextLinkResponse", "apiVersions": [ @@ -4160,7 +4228,7 @@ "isExactName": false, "properties": [ { - "$id": "353", + "$id": "361", "kind": "property", "name": "things", "apiVersions": [ @@ -4169,11 +4237,11 @@ ], "serializedName": "things", "type": { - "$id": "354", + "$id": "362", "kind": "array", "name": "ArrayThing", "valueType": { - "$ref": "256" + "$ref": "264" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -4193,7 +4261,7 @@ "isExactName": false }, { - "$id": "355", + "$id": "363", "kind": "property", "name": "next", "apiVersions": [ @@ -4202,7 +4270,7 @@ ], "serializedName": "next", "type": { - "$id": "356", + "$id": "364", "kind": "url", "name": "url", "crossLanguageDefinitionId": "TypeSpec.url", @@ -4225,7 +4293,7 @@ ] }, { - "$id": "357", + "$id": "365", "kind": "model", "name": "ListWithStringNextLinkResponse", "apiVersions": [ @@ -4244,7 +4312,7 @@ "isExactName": false, "properties": [ { - "$id": "358", + "$id": "366", "kind": "property", "name": "things", "apiVersions": [ @@ -4253,7 +4321,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4270,7 +4338,7 @@ "isExactName": false }, { - "$id": "359", + "$id": "367", "kind": "property", "name": "next", "apiVersions": [ @@ -4279,7 +4347,7 @@ ], "serializedName": "next", "type": { - "$id": "360", + "$id": "368", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4302,7 +4370,7 @@ ] }, { - "$id": "361", + "$id": "369", "kind": "model", "name": "ListWithContinuationTokenResponse", "apiVersions": [ @@ -4321,7 +4389,7 @@ "isExactName": false, "properties": [ { - "$id": "362", + "$id": "370", "kind": "property", "name": "things", "apiVersions": [ @@ -4330,7 +4398,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4347,7 +4415,7 @@ "isExactName": false }, { - "$id": "363", + "$id": "371", "kind": "property", "name": "nextToken", "apiVersions": [ @@ -4356,7 +4424,7 @@ ], "serializedName": "nextToken", "type": { - "$id": "364", + "$id": "372", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4379,7 +4447,7 @@ ] }, { - "$id": "365", + "$id": "373", "kind": "model", "name": "ListWithContinuationTokenHeaderResponseResponse", "apiVersions": [], @@ -4395,7 +4463,7 @@ "isExactName": false, "properties": [ { - "$id": "366", + "$id": "374", "kind": "property", "name": "things", "apiVersions": [ @@ -4404,7 +4472,7 @@ ], "serializedName": "things", "type": { - "$ref": "354" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4423,7 +4491,7 @@ ] }, { - "$id": "367", + "$id": "375", "kind": "model", "name": "PageThing", "apiVersions": [ @@ -4442,7 +4510,7 @@ "isExactName": false, "properties": [ { - "$id": "368", + "$id": "376", "kind": "property", "name": "items", "apiVersions": [ @@ -4451,7 +4519,7 @@ ], "serializedName": "items", "type": { - "$ref": "354" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -4470,7 +4538,7 @@ ] }, { - "$id": "369", + "$id": "377", "kind": "model", "name": "ModelWithEmbeddedNonBodyParameters", "apiVersions": [ @@ -4489,7 +4557,7 @@ "isExactName": false, "properties": [ { - "$id": "370", + "$id": "378", "kind": "property", "name": "name", "apiVersions": [ @@ -4499,7 +4567,7 @@ "serializedName": "name", "doc": "name of the ModelWithEmbeddedNonBodyParameters", "type": { - "$id": "371", + "$id": "379", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4520,7 +4588,7 @@ "isExactName": false }, { - "$id": "372", + "$id": "380", "kind": "property", "name": "requiredHeader", "apiVersions": [ @@ -4530,7 +4598,7 @@ "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$id": "373", + "$id": "381", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4551,7 +4619,7 @@ "isExactName": false }, { - "$id": "374", + "$id": "382", "kind": "property", "name": "optionalHeader", "apiVersions": [ @@ -4561,7 +4629,7 @@ "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$id": "375", + "$id": "383", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4582,7 +4650,7 @@ "isExactName": false }, { - "$id": "376", + "$id": "384", "kind": "property", "name": "requiredQuery", "apiVersions": [ @@ -4592,7 +4660,7 @@ "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "377", + "$id": "385", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4613,7 +4681,7 @@ "isExactName": false }, { - "$id": "378", + "$id": "386", "kind": "property", "name": "optionalQuery", "apiVersions": [ @@ -4623,7 +4691,7 @@ "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "379", + "$id": "387", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4646,7 +4714,7 @@ ] }, { - "$id": "380", + "$id": "388", "kind": "model", "name": "DynamicModel", "apiVersions": [ @@ -4671,7 +4739,7 @@ "isExactName": false, "properties": [ { - "$id": "381", + "$id": "389", "kind": "property", "name": "name", "apiVersions": [ @@ -4680,7 +4748,7 @@ ], "serializedName": "name", "type": { - "$id": "382", + "$id": "390", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4701,7 +4769,7 @@ "isExactName": false }, { - "$id": "383", + "$id": "391", "kind": "property", "name": "optionalUnknown", "apiVersions": [ @@ -4710,7 +4778,7 @@ ], "serializedName": "optionalUnknown", "type": { - "$id": "384", + "$id": "392", "kind": "unknown", "name": "unknown", "crossLanguageDefinitionId": "", @@ -4731,7 +4799,7 @@ "isExactName": false }, { - "$id": "385", + "$id": "393", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -4740,7 +4808,7 @@ ], "serializedName": "optionalInt", "type": { - "$id": "386", + "$id": "394", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4761,7 +4829,7 @@ "isExactName": false }, { - "$id": "387", + "$id": "395", "kind": "property", "name": "optionalNullableList", "apiVersions": [ @@ -4770,10 +4838,10 @@ ], "serializedName": "optionalNullableList", "type": { - "$id": "388", + "$id": "396", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -4792,7 +4860,7 @@ "isExactName": false }, { - "$id": "389", + "$id": "397", "kind": "property", "name": "requiredNullableList", "apiVersions": [ @@ -4801,10 +4869,10 @@ ], "serializedName": "requiredNullableList", "type": { - "$id": "390", + "$id": "398", "kind": "nullable", "type": { - "$ref": "285" + "$ref": "293" }, "namespace": "SampleTypeSpec" }, @@ -4823,7 +4891,7 @@ "isExactName": false }, { - "$id": "391", + "$id": "399", "kind": "property", "name": "optionalNullableDictionary", "apiVersions": [ @@ -4832,20 +4900,20 @@ ], "serializedName": "optionalNullableDictionary", "type": { - "$id": "392", + "$id": "400", "kind": "nullable", "type": { - "$id": "393", + "$id": "401", "kind": "dict", "keyType": { - "$id": "394", + "$id": "402", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "395", + "$id": "403", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -4870,7 +4938,7 @@ "isExactName": false }, { - "$id": "396", + "$id": "404", "kind": "property", "name": "requiredNullableDictionary", "apiVersions": [ @@ -4879,10 +4947,10 @@ ], "serializedName": "requiredNullableDictionary", "type": { - "$id": "397", + "$id": "405", "kind": "nullable", "type": { - "$ref": "393" + "$ref": "401" }, "namespace": "SampleTypeSpec" }, @@ -4901,7 +4969,7 @@ "isExactName": false }, { - "$id": "398", + "$id": "406", "kind": "property", "name": "primitiveDictionary", "apiVersions": [ @@ -4910,7 +4978,7 @@ ], "serializedName": "primitiveDictionary", "type": { - "$ref": "393" + "$ref": "401" }, "optional": false, "readOnly": false, @@ -4927,7 +4995,7 @@ "isExactName": false }, { - "$id": "399", + "$id": "407", "kind": "property", "name": "foo", "apiVersions": [ @@ -4936,7 +5004,7 @@ ], "serializedName": "foo", "type": { - "$id": "400", + "$id": "408", "kind": "model", "name": "AnotherDynamicModel", "apiVersions": [ @@ -4961,7 +5029,7 @@ "isExactName": false, "properties": [ { - "$id": "401", + "$id": "409", "kind": "property", "name": "bar", "apiVersions": [ @@ -4970,7 +5038,7 @@ ], "serializedName": "bar", "type": { - "$id": "402", + "$id": "410", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5007,7 +5075,7 @@ "isExactName": false }, { - "$id": "403", + "$id": "411", "kind": "property", "name": "listFoo", "apiVersions": [ @@ -5016,11 +5084,11 @@ ], "serializedName": "listFoo", "type": { - "$id": "404", + "$id": "412", "kind": "array", "name": "ArrayAnotherDynamicModel", "valueType": { - "$ref": "400" + "$ref": "408" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5040,7 +5108,7 @@ "isExactName": false }, { - "$id": "405", + "$id": "413", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -5049,11 +5117,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "406", + "$id": "414", "kind": "array", "name": "ArrayArray", "valueType": { - "$ref": "404" + "$ref": "412" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5073,7 +5141,7 @@ "isExactName": false }, { - "$id": "407", + "$id": "415", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -5082,17 +5150,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "408", + "$id": "416", "kind": "dict", "keyType": { - "$id": "409", + "$id": "417", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "400" + "$ref": "408" }, "decorators": [] }, @@ -5111,7 +5179,7 @@ "isExactName": false }, { - "$id": "410", + "$id": "418", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -5120,17 +5188,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "411", + "$id": "419", "kind": "dict", "keyType": { - "$id": "412", + "$id": "420", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "408" + "$ref": "416" }, "decorators": [] }, @@ -5149,7 +5217,7 @@ "isExactName": false }, { - "$id": "413", + "$id": "421", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -5158,17 +5226,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "414", + "$id": "422", "kind": "dict", "keyType": { - "$id": "415", + "$id": "423", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "404" + "$ref": "412" }, "decorators": [] }, @@ -5187,7 +5255,7 @@ "isExactName": false }, { - "$id": "416", + "$id": "424", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -5196,11 +5264,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "417", + "$id": "425", "kind": "array", "name": "ArrayRecord", "valueType": { - "$ref": "408" + "$ref": "416" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -5222,10 +5290,10 @@ ] }, { - "$ref": "400" + "$ref": "408" }, { - "$id": "418", + "$id": "426", "kind": "model", "name": "XmlAdvancedModel", "apiVersions": [ @@ -5254,7 +5322,7 @@ "isExactName": false, "properties": [ { - "$id": "419", + "$id": "427", "kind": "property", "name": "name", "apiVersions": [ @@ -5264,7 +5332,7 @@ "serializedName": "name", "doc": "A simple string property", "type": { - "$id": "420", + "$id": "428", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5287,7 +5355,7 @@ "isExactName": false }, { - "$id": "421", + "$id": "429", "kind": "property", "name": "age", "apiVersions": [ @@ -5297,7 +5365,7 @@ "serializedName": "age", "doc": "An integer property", "type": { - "$id": "422", + "$id": "430", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5320,7 +5388,7 @@ "isExactName": false }, { - "$id": "423", + "$id": "431", "kind": "property", "name": "enabled", "apiVersions": [ @@ -5330,7 +5398,7 @@ "serializedName": "enabled", "doc": "A boolean property", "type": { - "$id": "424", + "$id": "432", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5353,7 +5421,7 @@ "isExactName": false }, { - "$id": "425", + "$id": "433", "kind": "property", "name": "score", "apiVersions": [ @@ -5363,7 +5431,7 @@ "serializedName": "score", "doc": "A float property", "type": { - "$id": "426", + "$id": "434", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -5386,7 +5454,7 @@ "isExactName": false }, { - "$id": "427", + "$id": "435", "kind": "property", "name": "optionalString", "apiVersions": [ @@ -5396,7 +5464,7 @@ "serializedName": "optionalString", "doc": "An optional string", "type": { - "$id": "428", + "$id": "436", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5419,7 +5487,7 @@ "isExactName": false }, { - "$id": "429", + "$id": "437", "kind": "property", "name": "optionalInt", "apiVersions": [ @@ -5429,7 +5497,7 @@ "serializedName": "optionalInt", "doc": "An optional integer", "type": { - "$id": "430", + "$id": "438", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5452,7 +5520,7 @@ "isExactName": false }, { - "$id": "431", + "$id": "439", "kind": "property", "name": "nullableString", "apiVersions": [ @@ -5462,10 +5530,10 @@ "serializedName": "nullableString", "doc": "A nullable string", "type": { - "$id": "432", + "$id": "440", "kind": "nullable", "type": { - "$id": "433", + "$id": "441", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5490,7 +5558,7 @@ "isExactName": false }, { - "$id": "434", + "$id": "442", "kind": "property", "name": "id", "apiVersions": [ @@ -5500,7 +5568,7 @@ "serializedName": "id", "doc": "A string as XML attribute", "type": { - "$id": "435", + "$id": "443", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5528,7 +5596,7 @@ "isExactName": false }, { - "$id": "436", + "$id": "444", "kind": "property", "name": "version", "apiVersions": [ @@ -5538,7 +5606,7 @@ "serializedName": "version", "doc": "An integer as XML attribute", "type": { - "$id": "437", + "$id": "445", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5566,7 +5634,7 @@ "isExactName": false }, { - "$id": "438", + "$id": "446", "kind": "property", "name": "isActive", "apiVersions": [ @@ -5576,7 +5644,7 @@ "serializedName": "isActive", "doc": "A boolean as XML attribute", "type": { - "$id": "439", + "$id": "447", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -5604,7 +5672,7 @@ "isExactName": false }, { - "$id": "440", + "$id": "448", "kind": "property", "name": "originalName", "apiVersions": [ @@ -5614,7 +5682,7 @@ "serializedName": "RenamedProperty", "doc": "A property with a custom XML element name", "type": { - "$id": "441", + "$id": "449", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5644,7 +5712,7 @@ "isExactName": false }, { - "$id": "442", + "$id": "450", "kind": "property", "name": "xmlIdentifier", "apiVersions": [ @@ -5654,7 +5722,7 @@ "serializedName": "xml-id", "doc": "An attribute with a custom XML name", "type": { - "$id": "443", + "$id": "451", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5688,7 +5756,7 @@ "isExactName": false }, { - "$id": "444", + "$id": "452", "kind": "property", "name": "content", "apiVersions": [ @@ -5698,7 +5766,7 @@ "serializedName": "content", "doc": "Text content in the element (unwrapped string)", "type": { - "$id": "445", + "$id": "453", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5726,7 +5794,7 @@ "isExactName": false }, { - "$id": "446", + "$id": "454", "kind": "property", "name": "unwrappedStrings", "apiVersions": [ @@ -5736,7 +5804,7 @@ "serializedName": "unwrappedStrings", "doc": "An unwrapped array of strings - items appear directly without wrapper", "type": { - "$ref": "262" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -5761,7 +5829,7 @@ "isExactName": false }, { - "$id": "447", + "$id": "455", "kind": "property", "name": "unwrappedCounts", "apiVersions": [ @@ -5771,7 +5839,7 @@ "serializedName": "unwrappedCounts", "doc": "An unwrapped array of integers", "type": { - "$ref": "285" + "$ref": "293" }, "optional": false, "readOnly": false, @@ -5796,7 +5864,7 @@ "isExactName": false }, { - "$id": "448", + "$id": "456", "kind": "property", "name": "unwrappedItems", "apiVersions": [ @@ -5806,11 +5874,11 @@ "serializedName": "unwrappedItems", "doc": "An unwrapped array of models", "type": { - "$id": "449", + "$id": "457", "kind": "array", "name": "ArrayXmlItem", "valueType": { - "$id": "450", + "$id": "458", "kind": "model", "name": "XmlItem", "apiVersions": [ @@ -5839,7 +5907,7 @@ "isExactName": false, "properties": [ { - "$id": "451", + "$id": "459", "kind": "property", "name": "itemName", "apiVersions": [ @@ -5849,7 +5917,7 @@ "serializedName": "itemName", "doc": "The item name", "type": { - "$id": "452", + "$id": "460", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5872,7 +5940,7 @@ "isExactName": false }, { - "$id": "453", + "$id": "461", "kind": "property", "name": "itemValue", "apiVersions": [ @@ -5882,7 +5950,7 @@ "serializedName": "itemValue", "doc": "The item value", "type": { - "$id": "454", + "$id": "462", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -5905,7 +5973,7 @@ "isExactName": false }, { - "$id": "455", + "$id": "463", "kind": "property", "name": "itemId", "apiVersions": [ @@ -5915,7 +5983,7 @@ "serializedName": "itemId", "doc": "Item ID as attribute", "type": { - "$id": "456", + "$id": "464", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -5970,7 +6038,7 @@ "isExactName": false }, { - "$id": "457", + "$id": "465", "kind": "property", "name": "wrappedColors", "apiVersions": [ @@ -5980,7 +6048,7 @@ "serializedName": "wrappedColors", "doc": "A wrapped array of strings (default)", "type": { - "$ref": "262" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -6000,7 +6068,7 @@ "isExactName": false }, { - "$id": "458", + "$id": "466", "kind": "property", "name": "items", "apiVersions": [ @@ -6010,7 +6078,7 @@ "serializedName": "ItemCollection", "doc": "A wrapped array with custom wrapper name", "type": { - "$ref": "449" + "$ref": "457" }, "optional": false, "readOnly": false, @@ -6037,7 +6105,7 @@ "isExactName": false }, { - "$id": "459", + "$id": "467", "kind": "property", "name": "nestedModel", "apiVersions": [ @@ -6047,7 +6115,7 @@ "serializedName": "nestedModel", "doc": "A nested model property", "type": { - "$id": "460", + "$id": "468", "kind": "model", "name": "XmlNestedModel", "apiVersions": [ @@ -6069,7 +6137,7 @@ "isExactName": false, "properties": [ { - "$id": "461", + "$id": "469", "kind": "property", "name": "value", "apiVersions": [ @@ -6079,7 +6147,7 @@ "serializedName": "value", "doc": "The value of the nested model", "type": { - "$id": "462", + "$id": "470", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6102,7 +6170,7 @@ "isExactName": false }, { - "$id": "463", + "$id": "471", "kind": "property", "name": "nestedId", "apiVersions": [ @@ -6112,7 +6180,7 @@ "serializedName": "nestedId", "doc": "An attribute on the nested model", "type": { - "$id": "464", + "$id": "472", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6158,7 +6226,7 @@ "isExactName": false }, { - "$id": "465", + "$id": "473", "kind": "property", "name": "optionalNestedModel", "apiVersions": [ @@ -6168,7 +6236,7 @@ "serializedName": "optionalNestedModel", "doc": "An optional nested model", "type": { - "$ref": "460" + "$ref": "468" }, "optional": true, "readOnly": false, @@ -6187,7 +6255,7 @@ "isExactName": false }, { - "$id": "466", + "$id": "474", "kind": "property", "name": "metadata", "apiVersions": [ @@ -6197,17 +6265,17 @@ "serializedName": "metadata", "doc": "A dictionary property", "type": { - "$id": "467", + "$id": "475", "kind": "dict", "keyType": { - "$id": "468", + "$id": "476", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "469", + "$id": "477", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6232,7 +6300,7 @@ "isExactName": false }, { - "$id": "470", + "$id": "478", "kind": "property", "name": "createdAt", "apiVersions": [ @@ -6242,12 +6310,12 @@ "serializedName": "createdAt", "doc": "A date-time property", "type": { - "$id": "471", + "$id": "479", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "472", + "$id": "480", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6273,7 +6341,7 @@ "isExactName": false }, { - "$id": "473", + "$id": "481", "kind": "property", "name": "duration", "apiVersions": [ @@ -6283,12 +6351,12 @@ "serializedName": "duration", "doc": "A duration property", "type": { - "$id": "474", + "$id": "482", "kind": "duration", "name": "duration", "encode": "ISO8601", "wireType": { - "$id": "475", + "$id": "483", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6314,7 +6382,7 @@ "isExactName": false }, { - "$id": "476", + "$id": "484", "kind": "property", "name": "data", "apiVersions": [ @@ -6324,7 +6392,7 @@ "serializedName": "data", "doc": "A bytes property", "type": { - "$id": "477", + "$id": "485", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -6348,7 +6416,7 @@ "isExactName": false }, { - "$id": "478", + "$id": "486", "kind": "property", "name": "optionalRecordUnknown", "apiVersions": [ @@ -6358,7 +6426,7 @@ "serializedName": "optionalRecordUnknown", "doc": "optional record of unknown", "type": { - "$ref": "322" + "$ref": "330" }, "optional": true, "readOnly": false, @@ -6377,7 +6445,7 @@ "isExactName": false }, { - "$id": "479", + "$id": "487", "kind": "property", "name": "fixedEnum", "apiVersions": [ @@ -6406,7 +6474,7 @@ "isExactName": false }, { - "$id": "480", + "$id": "488", "kind": "property", "name": "extensibleEnum", "apiVersions": [ @@ -6435,7 +6503,7 @@ "isExactName": false }, { - "$id": "481", + "$id": "489", "kind": "property", "name": "optionalFixedEnum", "apiVersions": [ @@ -6464,7 +6532,7 @@ "isExactName": false }, { - "$id": "482", + "$id": "490", "kind": "property", "name": "optionalExtensibleEnum", "apiVersions": [ @@ -6493,7 +6561,7 @@ "isExactName": false }, { - "$id": "483", + "$id": "491", "kind": "property", "name": "label", "apiVersions": [ @@ -6502,7 +6570,7 @@ ], "serializedName": "label", "type": { - "$id": "484", + "$id": "492", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6517,14 +6585,14 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "485", + "$id": "493", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$id": "486", + "$id": "494", "kind": "enum", "decorators": [ { @@ -6537,7 +6605,7 @@ "isExactName": false, "namespace": "SampleTypeSpec", "valueType": { - "$id": "487", + "$id": "495", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -6546,32 +6614,32 @@ }, "values": [ { - "$id": "488", + "$id": "496", "kind": "enumvalue", "decorators": [], "name": "ns1", "isExactName": false, "value": "https://example.com/ns1", "enumType": { - "$ref": "486" + "$ref": "494" }, "valueType": { - "$ref": "487" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" }, { - "$id": "489", + "$id": "497", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "486" + "$ref": "494" }, "valueType": { - "$ref": "487" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6589,7 +6657,7 @@ "__accessSet": true }, "valueType": { - "$ref": "487" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns1" } @@ -6616,7 +6684,7 @@ "isExactName": false }, { - "$id": "490", + "$id": "498", "kind": "property", "name": "daysUsed", "apiVersions": [ @@ -6625,7 +6693,7 @@ ], "serializedName": "daysUsed", "type": { - "$id": "491", + "$id": "499", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -6640,17 +6708,17 @@ "name": "TypeSpec.Xml.@ns", "arguments": { "ns": { - "$id": "492", + "$id": "500", "kind": "enumvalue", "decorators": [], "name": "ns2", "isExactName": false, "value": "https://example.com/ns2", "enumType": { - "$ref": "486" + "$ref": "494" }, "valueType": { - "$ref": "487" + "$ref": "495" }, "crossLanguageDefinitionId": "SampleTypeSpec.XmlNamespaces.ns2" } @@ -6673,7 +6741,7 @@ "isExactName": false }, { - "$id": "493", + "$id": "501", "kind": "property", "name": "fooItems", "apiVersions": [ @@ -6682,7 +6750,7 @@ ], "serializedName": "fooItems", "type": { - "$ref": "262" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -6714,7 +6782,7 @@ "isExactName": false }, { - "$id": "494", + "$id": "502", "kind": "property", "name": "anotherModel", "apiVersions": [ @@ -6723,7 +6791,7 @@ ], "serializedName": "anotherModel", "type": { - "$ref": "460" + "$ref": "468" }, "optional": false, "readOnly": false, @@ -6754,7 +6822,7 @@ "isExactName": false }, { - "$id": "495", + "$id": "503", "kind": "property", "name": "modelsWithNamespaces", "apiVersions": [ @@ -6763,11 +6831,11 @@ ], "serializedName": "modelsWithNamespaces", "type": { - "$id": "496", + "$id": "504", "kind": "array", "name": "ArrayXmlModelWithNamespace", "valueType": { - "$id": "497", + "$id": "505", "kind": "model", "name": "XmlModelWithNamespace", "apiVersions": [ @@ -6800,7 +6868,7 @@ "isExactName": false, "properties": [ { - "$id": "498", + "$id": "506", "kind": "property", "name": "foo", "apiVersions": [ @@ -6809,7 +6877,7 @@ ], "serializedName": "foo", "type": { - "$id": "499", + "$id": "507", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -6858,7 +6926,7 @@ "isExactName": false }, { - "$id": "500", + "$id": "508", "kind": "property", "name": "unwrappedModelsWithNamespaces", "apiVersions": [ @@ -6867,7 +6935,7 @@ ], "serializedName": "unwrappedModelsWithNamespaces", "type": { - "$ref": "496" + "$ref": "504" }, "optional": false, "readOnly": false, @@ -6892,7 +6960,7 @@ "isExactName": false }, { - "$id": "501", + "$id": "509", "kind": "property", "name": "listOfListFoo", "apiVersions": [ @@ -6901,11 +6969,11 @@ ], "serializedName": "listOfListFoo", "type": { - "$id": "502", + "$id": "510", "kind": "array", "name": "ArrayArray1", "valueType": { - "$ref": "449" + "$ref": "457" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -6928,7 +6996,7 @@ "isExactName": false }, { - "$id": "503", + "$id": "511", "kind": "property", "name": "dictionaryFoo", "apiVersions": [ @@ -6937,17 +7005,17 @@ ], "serializedName": "dictionaryFoo", "type": { - "$id": "504", + "$id": "512", "kind": "dict", "keyType": { - "$id": "505", + "$id": "513", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "450" + "$ref": "458" }, "decorators": [] }, @@ -6968,7 +7036,7 @@ "isExactName": false }, { - "$id": "506", + "$id": "514", "kind": "property", "name": "dictionaryOfDictionaryFoo", "apiVersions": [ @@ -6977,17 +7045,17 @@ ], "serializedName": "dictionaryOfDictionaryFoo", "type": { - "$id": "507", + "$id": "515", "kind": "dict", "keyType": { - "$id": "508", + "$id": "516", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "504" + "$ref": "512" }, "decorators": [] }, @@ -7008,7 +7076,7 @@ "isExactName": false }, { - "$id": "509", + "$id": "517", "kind": "property", "name": "dictionaryListFoo", "apiVersions": [ @@ -7017,17 +7085,17 @@ ], "serializedName": "dictionaryListFoo", "type": { - "$id": "510", + "$id": "518", "kind": "dict", "keyType": { - "$id": "511", + "$id": "519", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "449" + "$ref": "457" }, "decorators": [] }, @@ -7048,7 +7116,7 @@ "isExactName": false }, { - "$id": "512", + "$id": "520", "kind": "property", "name": "listOfDictionaryFoo", "apiVersions": [ @@ -7057,11 +7125,11 @@ ], "serializedName": "listOfDictionaryFoo", "type": { - "$id": "513", + "$id": "521", "kind": "array", "name": "ArrayRecord1", "valueType": { - "$ref": "504" + "$ref": "512" }, "crossLanguageDefinitionId": "TypeSpec.Array", "decorators": [] @@ -7086,16 +7154,16 @@ ] }, { - "$ref": "450" + "$ref": "458" }, { - "$ref": "460" + "$ref": "468" }, { - "$ref": "497" + "$ref": "505" }, { - "$id": "514", + "$id": "522", "kind": "model", "name": "Cat", "apiVersions": [ @@ -7110,7 +7178,7 @@ "isExactName": false, "properties": [ { - "$id": "515", + "$id": "523", "kind": "property", "name": "id", "apiVersions": [ @@ -7119,7 +7187,7 @@ ], "serializedName": "id", "type": { - "$id": "516", + "$id": "524", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7146,7 +7214,7 @@ "isExactName": false }, { - "$id": "517", + "$id": "525", "kind": "property", "name": "boolPart", "apiVersions": [ @@ -7155,7 +7223,7 @@ ], "serializedName": "boolPart", "type": { - "$id": "518", + "$id": "526", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -7182,7 +7250,7 @@ "isExactName": false }, { - "$id": "519", + "$id": "527", "kind": "property", "name": "int32Part", "apiVersions": [ @@ -7191,7 +7259,7 @@ ], "serializedName": "int32Part", "type": { - "$id": "520", + "$id": "528", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -7218,7 +7286,7 @@ "isExactName": false }, { - "$id": "521", + "$id": "529", "kind": "property", "name": "int64Part", "apiVersions": [ @@ -7227,7 +7295,7 @@ ], "serializedName": "int64Part", "type": { - "$id": "522", + "$id": "530", "kind": "int64", "name": "int64", "crossLanguageDefinitionId": "TypeSpec.int64", @@ -7254,7 +7322,7 @@ "isExactName": false }, { - "$id": "523", + "$id": "531", "kind": "property", "name": "float32Part", "apiVersions": [ @@ -7263,7 +7331,7 @@ ], "serializedName": "float32Part", "type": { - "$id": "524", + "$id": "532", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -7290,7 +7358,7 @@ "isExactName": false }, { - "$id": "525", + "$id": "533", "kind": "property", "name": "float64Part", "apiVersions": [ @@ -7299,7 +7367,7 @@ ], "serializedName": "float64Part", "type": { - "$id": "526", + "$id": "534", "kind": "float64", "name": "float64", "crossLanguageDefinitionId": "TypeSpec.float64", @@ -7326,7 +7394,7 @@ "isExactName": false }, { - "$id": "527", + "$id": "535", "kind": "property", "name": "decimalPart", "apiVersions": [ @@ -7335,7 +7403,7 @@ ], "serializedName": "decimalPart", "type": { - "$id": "528", + "$id": "536", "kind": "decimal128", "name": "decimal128", "crossLanguageDefinitionId": "TypeSpec.decimal128", @@ -7362,7 +7430,7 @@ "isExactName": false }, { - "$id": "529", + "$id": "537", "kind": "property", "name": "int8Part", "apiVersions": [ @@ -7371,7 +7439,7 @@ ], "serializedName": "int8Part", "type": { - "$id": "530", + "$id": "538", "kind": "int8", "name": "int8", "crossLanguageDefinitionId": "TypeSpec.int8", @@ -7398,7 +7466,7 @@ "isExactName": false }, { - "$id": "531", + "$id": "539", "kind": "property", "name": "uint8Part", "apiVersions": [ @@ -7407,7 +7475,7 @@ ], "serializedName": "uint8Part", "type": { - "$id": "532", + "$id": "540", "kind": "uint8", "name": "uint8", "crossLanguageDefinitionId": "TypeSpec.uint8", @@ -7434,7 +7502,7 @@ "isExactName": false }, { - "$id": "533", + "$id": "541", "kind": "property", "name": "dictionaryPart", "apiVersions": [ @@ -7443,7 +7511,7 @@ ], "serializedName": "dictionaryPart", "type": { - "$ref": "467" + "$ref": "475" }, "optional": false, "readOnly": false, @@ -7466,7 +7534,7 @@ "isExactName": false }, { - "$id": "534", + "$id": "542", "kind": "property", "name": "dictionaryModelPart", "apiVersions": [ @@ -7475,17 +7543,17 @@ ], "serializedName": "dictionaryModelPart", "type": { - "$id": "535", + "$id": "543", "kind": "dict", "keyType": { - "$id": "536", + "$id": "544", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$ref": "256" + "$ref": "264" }, "decorators": [] }, @@ -7510,7 +7578,7 @@ "isExactName": false }, { - "$id": "537", + "$id": "545", "kind": "property", "name": "listPart", "apiVersions": [ @@ -7519,7 +7587,7 @@ ], "serializedName": "listPart", "type": { - "$ref": "262" + "$ref": "270" }, "optional": false, "readOnly": false, @@ -7542,7 +7610,7 @@ "isExactName": false }, { - "$id": "538", + "$id": "546", "kind": "property", "name": "listModelPart", "apiVersions": [ @@ -7551,7 +7619,7 @@ ], "serializedName": "listModelPart", "type": { - "$ref": "354" + "$ref": "362" }, "optional": false, "readOnly": false, @@ -7574,7 +7642,7 @@ "isExactName": false }, { - "$id": "539", + "$id": "547", "kind": "property", "name": "multipleListPart", "apiVersions": [ @@ -7583,11 +7651,11 @@ ], "serializedName": "multipleListPart", "type": { - "$id": "540", + "$id": "548", "kind": "array", "name": "ArrayHttpPart", "valueType": { - "$id": "541", + "$id": "549", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7617,7 +7685,7 @@ "isExactName": false }, { - "$id": "542", + "$id": "550", "kind": "property", "name": "profileImage", "apiVersions": [ @@ -7626,7 +7694,7 @@ ], "serializedName": "profileImage", "type": { - "$id": "543", + "$id": "551", "kind": "model", "name": "File", "apiVersions": [], @@ -7641,14 +7709,14 @@ "isFileType": true, "properties": [ { - "$id": "544", + "$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": "545", + "$id": "553", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7665,14 +7733,14 @@ "isExactName": false }, { - "$id": "546", + "$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": "547", + "$id": "555", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -7689,14 +7757,14 @@ "isExactName": false }, { - "$id": "548", + "$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": "549", + "$id": "557", "kind": "bytes", "name": "bytes", "encode": "base64", @@ -7726,12 +7794,12 @@ "isFilePart": true, "isMulti": false, "filename": { - "$id": "550", + "$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": "551", + "$id": "559", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7762,12 +7830,12 @@ "serializationOptions": {} }, "contentType": { - "$id": "552", + "$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": "553", + "$id": "561", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -7808,7 +7876,7 @@ "isExactName": false }, { - "$id": "554", + "$id": "562", "kind": "property", "name": "extensibleEnumPart", "apiVersions": [ @@ -7840,7 +7908,7 @@ "isExactName": false }, { - "$id": "555", + "$id": "563", "kind": "property", "name": "fixedEnumPart", "apiVersions": [ @@ -7872,7 +7940,7 @@ "isExactName": false }, { - "$id": "556", + "$id": "564", "kind": "property", "name": "intExtensibleEnumPart", "apiVersions": [ @@ -7904,7 +7972,7 @@ "isExactName": false }, { - "$id": "557", + "$id": "565", "kind": "property", "name": "intFixedEnumPart", "apiVersions": [ @@ -7938,7 +8006,7 @@ ] }, { - "$id": "558", + "$id": "566", "kind": "model", "name": "File", "apiVersions": [], @@ -7953,18 +8021,18 @@ "isFileType": true, "properties": [ { - "$ref": "544" + "$ref": "552" }, { - "$ref": "546" + "$ref": "554" }, { - "$ref": "548" + "$ref": "556" } ] }, { - "$id": "559", + "$id": "567", "kind": "model", "name": "StreamingItem", "apiVersions": [ @@ -7983,7 +8051,7 @@ "isExactName": false, "properties": [ { - "$id": "560", + "$id": "568", "kind": "property", "name": "message", "apiVersions": [ @@ -7992,7 +8060,7 @@ ], "serializedName": "message", "type": { - "$id": "561", + "$id": "569", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8015,7 +8083,7 @@ ] }, { - "$id": "562", + "$id": "570", "kind": "model", "name": "Animal", "apiVersions": [ @@ -8034,7 +8102,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "563", + "$id": "571", "kind": "property", "name": "kind", "apiVersions": [ @@ -8044,7 +8112,7 @@ "serializedName": "kind", "doc": "The kind of animal", "type": { - "$id": "564", + "$id": "572", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8066,10 +8134,10 @@ }, "properties": [ { - "$ref": "563" + "$ref": "571" }, { - "$id": "565", + "$id": "573", "kind": "property", "name": "name", "apiVersions": [ @@ -8079,7 +8147,7 @@ "serializedName": "name", "doc": "Name of the animal", "type": { - "$id": "566", + "$id": "574", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8102,7 +8170,7 @@ ], "discriminatedSubtypes": { "pet": { - "$id": "567", + "$id": "575", "kind": "model", "name": "Pet", "apiVersions": [ @@ -8122,7 +8190,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "568", + "$id": "576", "kind": "property", "name": "kind", "apiVersions": [ @@ -8148,14 +8216,14 @@ "isExactName": false }, "baseModel": { - "$ref": "562" + "$ref": "570" }, "properties": [ { - "$ref": "568" + "$ref": "576" }, { - "$id": "569", + "$id": "577", "kind": "property", "name": "trained", "apiVersions": [ @@ -8165,7 +8233,7 @@ "serializedName": "trained", "doc": "Whether the pet is trained", "type": { - "$id": "570", + "$id": "578", "kind": "boolean", "name": "boolean", "crossLanguageDefinitionId": "TypeSpec.boolean", @@ -8188,7 +8256,7 @@ ], "discriminatedSubtypes": { "dog": { - "$id": "571", + "$id": "579", "kind": "model", "name": "Dog", "apiVersions": [ @@ -8208,11 +8276,11 @@ }, "isExactName": false, "baseModel": { - "$ref": "567" + "$ref": "575" }, "properties": [ { - "$id": "572", + "$id": "580", "kind": "property", "name": "kind", "apiVersions": [ @@ -8238,7 +8306,7 @@ "isExactName": false }, { - "$id": "573", + "$id": "581", "kind": "property", "name": "breed", "apiVersions": [ @@ -8248,7 +8316,7 @@ "serializedName": "breed", "doc": "The breed of the dog", "type": { - "$id": "574", + "$id": "582", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8273,18 +8341,18 @@ } }, "dog": { - "$ref": "571" + "$ref": "579" } } }, { - "$ref": "567" + "$ref": "575" }, { - "$ref": "571" + "$ref": "579" }, { - "$id": "575", + "$id": "583", "kind": "model", "name": "Tree", "apiVersions": [ @@ -8309,7 +8377,7 @@ }, "isExactName": false, "baseModel": { - "$id": "576", + "$id": "584", "kind": "model", "name": "Plant", "apiVersions": [ @@ -8333,7 +8401,7 @@ }, "isExactName": false, "discriminatorProperty": { - "$id": "577", + "$id": "585", "kind": "property", "name": "species", "apiVersions": [ @@ -8343,7 +8411,7 @@ "serializedName": "species", "doc": "The species of plant", "type": { - "$id": "578", + "$id": "586", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8370,10 +8438,10 @@ }, "properties": [ { - "$ref": "577" + "$ref": "585" }, { - "$id": "579", + "$id": "587", "kind": "property", "name": "id", "apiVersions": [ @@ -8383,7 +8451,7 @@ "serializedName": "id", "doc": "The unique identifier of the plant", "type": { - "$id": "580", + "$id": "588", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8409,7 +8477,7 @@ "isExactName": false }, { - "$id": "581", + "$id": "589", "kind": "property", "name": "height", "apiVersions": [ @@ -8419,7 +8487,7 @@ "serializedName": "height", "doc": "The height of the plant in centimeters", "type": { - "$id": "582", + "$id": "590", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8447,13 +8515,13 @@ ], "discriminatedSubtypes": { "tree": { - "$ref": "575" + "$ref": "583" } } }, "properties": [ { - "$id": "583", + "$id": "591", "kind": "property", "name": "species", "apiVersions": [ @@ -8484,7 +8552,7 @@ "isExactName": false }, { - "$id": "584", + "$id": "592", "kind": "property", "name": "age", "apiVersions": [ @@ -8494,7 +8562,7 @@ "serializedName": "age", "doc": "The age of the tree in years", "type": { - "$id": "585", + "$id": "593", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8522,10 +8590,10 @@ ] }, { - "$ref": "576" + "$ref": "584" }, { - "$id": "586", + "$id": "594", "kind": "model", "name": "GetWidgetMetricsResponse", "apiVersions": [ @@ -8544,7 +8612,7 @@ "isExactName": false, "properties": [ { - "$id": "587", + "$id": "595", "kind": "property", "name": "numSold", "apiVersions": [ @@ -8553,7 +8621,7 @@ ], "serializedName": "numSold", "type": { - "$id": "588", + "$id": "596", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -8574,7 +8642,7 @@ "isExactName": false }, { - "$id": "589", + "$id": "597", "kind": "property", "name": "averagePrice", "apiVersions": [ @@ -8583,7 +8651,7 @@ ], "serializedName": "averagePrice", "type": { - "$id": "590", + "$id": "598", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -8606,7 +8674,7 @@ ] }, { - "$id": "591", + "$id": "599", "kind": "model", "name": "GetNotebookResponse", "apiVersions": [ @@ -8625,7 +8693,7 @@ "isExactName": false, "properties": [ { - "$id": "592", + "$id": "600", "kind": "property", "name": "name", "apiVersions": [ @@ -8634,7 +8702,7 @@ ], "serializedName": "name", "type": { - "$id": "593", + "$id": "601", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8655,7 +8723,7 @@ "isExactName": false }, { - "$id": "594", + "$id": "602", "kind": "property", "name": "content", "apiVersions": [ @@ -8664,7 +8732,7 @@ ], "serializedName": "content", "type": { - "$id": "595", + "$id": "603", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -8687,7 +8755,7 @@ ] }, { - "$id": "596", + "$id": "604", "kind": "model", "name": "NullableDynamicModel", "apiVersions": [ @@ -8712,7 +8780,7 @@ "isExactName": false, "properties": [ { - "$id": "597", + "$id": "605", "kind": "property", "name": "modelValue", "apiVersions": [ @@ -8721,10 +8789,10 @@ ], "serializedName": "modelValue", "type": { - "$id": "598", + "$id": "606", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8743,7 +8811,7 @@ "isExactName": false }, { - "$id": "599", + "$id": "607", "kind": "property", "name": "children", "apiVersions": [ @@ -8752,17 +8820,17 @@ ], "serializedName": "children", "type": { - "$id": "600", + "$id": "608", "kind": "nullable", "type": { - "$id": "601", + "$id": "609", "kind": "array", "name": "Array2", "valueType": { - "$id": "602", + "$id": "610", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8786,7 +8854,7 @@ "isExactName": false }, { - "$id": "603", + "$id": "611", "kind": "property", "name": "childDictionary", "apiVersions": [ @@ -8795,23 +8863,23 @@ ], "serializedName": "childDictionary", "type": { - "$id": "604", + "$id": "612", "kind": "nullable", "type": { - "$id": "605", + "$id": "613", "kind": "dict", "keyType": { - "$id": "606", + "$id": "614", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "607", + "$id": "615", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8834,7 +8902,7 @@ "isExactName": false }, { - "$id": "608", + "$id": "616", "kind": "property", "name": "nestedChildren", "apiVersions": [ @@ -8843,24 +8911,24 @@ ], "serializedName": "nestedChildren", "type": { - "$id": "609", + "$id": "617", "kind": "nullable", "type": { - "$id": "610", + "$id": "618", "kind": "array", "name": "Array3", "valueType": { - "$id": "611", + "$id": "619", "kind": "nullable", "type": { - "$id": "612", + "$id": "620", "kind": "array", "name": "Array4", "valueType": { - "$id": "613", + "$id": "621", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8889,7 +8957,7 @@ "isExactName": false }, { - "$id": "614", + "$id": "622", "kind": "property", "name": "nestedChildDictionary", "apiVersions": [ @@ -8898,36 +8966,36 @@ ], "serializedName": "nestedChildDictionary", "type": { - "$id": "615", + "$id": "623", "kind": "nullable", "type": { - "$id": "616", + "$id": "624", "kind": "dict", "keyType": { - "$id": "617", + "$id": "625", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "618", + "$id": "626", "kind": "nullable", "type": { - "$id": "619", + "$id": "627", "kind": "dict", "keyType": { - "$id": "620", + "$id": "628", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "621", + "$id": "629", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -8954,7 +9022,7 @@ "isExactName": false }, { - "$id": "622", + "$id": "630", "kind": "property", "name": "dictionaryChildren", "apiVersions": [ @@ -8963,30 +9031,30 @@ ], "serializedName": "dictionaryChildren", "type": { - "$id": "623", + "$id": "631", "kind": "nullable", "type": { - "$id": "624", + "$id": "632", "kind": "dict", "keyType": { - "$id": "625", + "$id": "633", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "626", + "$id": "634", "kind": "nullable", "type": { - "$id": "627", + "$id": "635", "kind": "array", "name": "Array5", "valueType": { - "$id": "628", + "$id": "636", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -9014,7 +9082,7 @@ "isExactName": false }, { - "$id": "629", + "$id": "637", "kind": "property", "name": "listOfDictionaries", "apiVersions": [ @@ -9023,30 +9091,30 @@ ], "serializedName": "listOfDictionaries", "type": { - "$id": "630", + "$id": "638", "kind": "nullable", "type": { - "$id": "631", + "$id": "639", "kind": "array", "name": "Array6", "valueType": { - "$id": "632", + "$id": "640", "kind": "nullable", "type": { - "$id": "633", + "$id": "641", "kind": "dict", "keyType": { - "$id": "634", + "$id": "642", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "635", + "$id": "643", "kind": "nullable", "type": { - "$ref": "400" + "$ref": "408" }, "namespace": "SampleTypeSpec" }, @@ -9076,7 +9144,7 @@ ] }, { - "$id": "636", + "$id": "644", "kind": "model", "name": "JsonlStreamStreamingItem", "apiVersions": [], @@ -9089,7 +9157,7 @@ "isExactName": false, "properties": [ { - "$id": "637", + "$id": "645", "kind": "property", "name": "contentType", "apiVersions": [ @@ -9110,7 +9178,7 @@ "isExactName": false }, { - "$id": "638", + "$id": "646", "kind": "property", "name": "body", "apiVersions": [ @@ -9118,7 +9186,7 @@ "2024-08-16-preview" ], "type": { - "$id": "639", + "$id": "647", "kind": "bytes", "name": "bytes", "crossLanguageDefinitionId": "", @@ -9139,7 +9207,7 @@ ], "clients": [ { - "$id": "640", + "$id": "648", "kind": "client", "name": "SampleTypeSpecClient", "isExactName": false, @@ -9147,7 +9215,7 @@ "doc": "This is a sample typespec project.", "methods": [ { - "$id": "641", + "$id": "649", "kind": "basic", "name": "sayHi", "isExactName": false, @@ -9158,7 +9226,7 @@ ], "doc": "Return hi", "operation": { - "$id": "642", + "$id": "650", "name": "sayHi", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9166,12 +9234,12 @@ "accessibility": "public", "parameters": [ { - "$id": "643", + "$id": "651", "kind": "header", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "644", + "$id": "652", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9186,12 +9254,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.headParameter", "methodParameterSegments": [ { - "$id": "645", + "$id": "653", "kind": "method", "name": "headParameter", "serializedName": "head-parameter", "type": { - "$id": "646", + "$id": "654", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9211,12 +9279,12 @@ "isExactName": false }, { - "$id": "647", + "$id": "655", "kind": "query", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "648", + "$id": "656", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9231,12 +9299,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "649", + "$id": "657", "kind": "method", "name": "queryParameter", "serializedName": "queryParameter", "type": { - "$id": "650", + "$id": "658", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9256,12 +9324,12 @@ "isExactName": false }, { - "$id": "651", + "$id": "659", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "652", + "$id": "660", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9276,12 +9344,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "653", + "$id": "661", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "type": { - "$id": "654", + "$id": "662", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9301,7 +9369,7 @@ "isExactName": false }, { - "$id": "655", + "$id": "663", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9317,7 +9385,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi.accept", "methodParameterSegments": [ { - "$id": "656", + "$id": "664", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9344,7 +9412,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -9370,21 +9438,21 @@ }, "parameters": [ { - "$ref": "645" + "$ref": "653" }, { - "$ref": "649" + "$ref": "657" }, { - "$ref": "653" + "$ref": "661" }, { - "$ref": "656" + "$ref": "664" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -9393,7 +9461,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sayHi" }, { - "$id": "657", + "$id": "665", "kind": "basic", "name": "helloAgain", "isExactName": false, @@ -9404,7 +9472,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "658", + "$id": "666", "name": "helloAgain", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9412,12 +9480,12 @@ "accessibility": "public", "parameters": [ { - "$id": "659", + "$id": "667", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "660", + "$id": "668", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9432,12 +9500,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p1", "methodParameterSegments": [ { - "$id": "661", + "$id": "669", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "662", + "$id": "670", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9457,7 +9525,7 @@ "isExactName": false }, { - "$id": "663", + "$id": "671", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9473,7 +9541,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.contentType", "methodParameterSegments": [ { - "$id": "664", + "$id": "672", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9494,12 +9562,12 @@ "isExactName": false }, { - "$id": "665", + "$id": "673", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "666", + "$id": "674", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9517,12 +9585,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.p2", "methodParameterSegments": [ { - "$id": "667", + "$id": "675", "kind": "method", "name": "p2", "serializedName": "p2", "type": { - "$id": "668", + "$id": "676", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9542,7 +9610,7 @@ "isExactName": false }, { - "$id": "669", + "$id": "677", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9558,7 +9626,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.accept", "methodParameterSegments": [ { - "$id": "670", + "$id": "678", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9579,12 +9647,12 @@ "isExactName": false }, { - "$id": "671", + "$id": "679", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "299" }, "isApiVersion": false, "contentTypes": [ @@ -9598,12 +9666,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain.action", "methodParameterSegments": [ { - "$id": "672", + "$id": "680", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "299" }, "location": "Body", "isApiVersion": false, @@ -9626,7 +9694,7 @@ 200 ], "bodyType": { - "$ref": "291" + "$ref": "299" }, "headers": [], "isErrorResponse": false, @@ -9655,24 +9723,24 @@ }, "parameters": [ { - "$ref": "661" + "$ref": "669" }, { - "$ref": "672" + "$ref": "680" }, { - "$ref": "664" + "$ref": "672" }, { - "$ref": "667" + "$ref": "675" }, { - "$ref": "670" + "$ref": "678" } ], "response": { "type": { - "$ref": "291" + "$ref": "299" } }, "isOverride": false, @@ -9681,7 +9749,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloAgain" }, { - "$id": "673", + "$id": "681", "kind": "basic", "name": "noContentType", "isExactName": false, @@ -9692,7 +9760,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "674", + "$id": "682", "name": "noContentType", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -9700,12 +9768,12 @@ "accessibility": "public", "parameters": [ { - "$id": "675", + "$id": "683", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "676", + "$id": "684", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9720,12 +9788,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p1", "methodParameterSegments": [ { - "$id": "677", + "$id": "685", "kind": "method", "name": "info", "serializedName": "info", "type": { - "$ref": "339" + "$ref": "347" }, "location": "", "isApiVersion": false, @@ -9738,13 +9806,13 @@ "isExactName": false }, { - "$id": "678", + "$id": "686", "kind": "method", "name": "p1", "serializedName": "p1", "doc": "header parameter", "type": { - "$ref": "341" + "$ref": "349" }, "location": "", "isApiVersion": false, @@ -9760,12 +9828,12 @@ "isExactName": false }, { - "$id": "679", + "$id": "687", "kind": "path", "name": "p2", "serializedName": "p2", "type": { - "$id": "680", + "$id": "688", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -9783,16 +9851,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.p2", "methodParameterSegments": [ { - "$ref": "677" + "$ref": "685" }, { - "$id": "681", + "$id": "689", "kind": "method", "name": "p2", "serializedName": "p2", "doc": "path parameter", "type": { - "$ref": "344" + "$ref": "352" }, "location": "", "isApiVersion": false, @@ -9808,7 +9876,7 @@ "isExactName": false }, { - "$id": "682", + "$id": "690", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -9825,7 +9893,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.contentType", "methodParameterSegments": [ { - "$id": "683", + "$id": "691", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -9847,7 +9915,7 @@ "isExactName": false }, { - "$id": "684", + "$id": "692", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -9863,7 +9931,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.accept", "methodParameterSegments": [ { - "$id": "685", + "$id": "693", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -9884,12 +9952,12 @@ "isExactName": false }, { - "$id": "686", + "$id": "694", "kind": "body", "name": "action", "serializedName": "action", "type": { - "$ref": "291" + "$ref": "299" }, "isApiVersion": false, "contentTypes": [ @@ -9903,16 +9971,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType.action", "methodParameterSegments": [ { - "$ref": "677" + "$ref": "685" }, { - "$id": "687", + "$id": "695", "kind": "method", "name": "action", "serializedName": "action", "doc": "body parameter", "type": { - "$ref": "291" + "$ref": "299" }, "location": "", "isApiVersion": false, @@ -9939,7 +10007,7 @@ 200 ], "bodyType": { - "$ref": "291" + "$ref": "299" }, "headers": [], "isErrorResponse": false, @@ -9968,18 +10036,18 @@ }, "parameters": [ { - "$ref": "677" + "$ref": "685" }, { - "$ref": "683" + "$ref": "691" }, { - "$ref": "685" + "$ref": "693" } ], "response": { "type": { - "$ref": "291" + "$ref": "299" } }, "isOverride": true, @@ -9988,7 +10056,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.noContentType" }, { - "$id": "688", + "$id": "696", "kind": "basic", "name": "helloDemo2", "isExactName": false, @@ -9999,7 +10067,7 @@ ], "doc": "Return hi in demo2", "operation": { - "$id": "689", + "$id": "697", "name": "helloDemo2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10007,7 +10075,7 @@ "accessibility": "public", "parameters": [ { - "$id": "690", + "$id": "698", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10023,7 +10091,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2.accept", "methodParameterSegments": [ { - "$id": "691", + "$id": "699", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10050,7 +10118,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10076,12 +10144,12 @@ }, "parameters": [ { - "$ref": "691" + "$ref": "699" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10090,7 +10158,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloDemo2" }, { - "$id": "692", + "$id": "700", "kind": "basic", "name": "createLiteral", "isExactName": false, @@ -10101,7 +10169,7 @@ ], "doc": "Create with literal value", "operation": { - "$id": "693", + "$id": "701", "name": "createLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10109,7 +10177,7 @@ "accessibility": "public", "parameters": [ { - "$id": "694", + "$id": "702", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10126,7 +10194,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.contentType", "methodParameterSegments": [ { - "$id": "695", + "$id": "703", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10148,7 +10216,7 @@ "isExactName": false }, { - "$id": "696", + "$id": "704", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10164,7 +10232,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.accept", "methodParameterSegments": [ { - "$id": "697", + "$id": "705", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10185,12 +10253,12 @@ "isExactName": false }, { - "$id": "698", + "$id": "706", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -10204,12 +10272,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral.body", "methodParameterSegments": [ { - "$id": "699", + "$id": "707", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -10236,7 +10304,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10265,18 +10333,18 @@ }, "parameters": [ { - "$ref": "699" + "$ref": "707" }, { - "$ref": "695" + "$ref": "703" }, { - "$ref": "697" + "$ref": "705" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10285,7 +10353,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.createLiteral" }, { - "$id": "700", + "$id": "708", "kind": "basic", "name": "helloLiteral", "isExactName": false, @@ -10296,7 +10364,7 @@ ], "doc": "Send literal parameters", "operation": { - "$id": "701", + "$id": "709", "name": "helloLiteral", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10304,7 +10372,7 @@ "accessibility": "public", "parameters": [ { - "$id": "702", + "$id": "710", "kind": "header", "name": "p1", "serializedName": "p1", @@ -10320,7 +10388,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p1", "methodParameterSegments": [ { - "$id": "703", + "$id": "711", "kind": "method", "name": "p1", "serializedName": "p1", @@ -10341,7 +10409,7 @@ "isExactName": false }, { - "$id": "704", + "$id": "712", "kind": "path", "name": "p2", "serializedName": "p2", @@ -10360,7 +10428,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.p2", "methodParameterSegments": [ { - "$id": "705", + "$id": "713", "kind": "method", "name": "p2", "serializedName": "p2", @@ -10381,7 +10449,7 @@ "isExactName": false }, { - "$id": "706", + "$id": "714", "kind": "query", "name": "p3", "serializedName": "p3", @@ -10397,7 +10465,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "707", + "$id": "715", "kind": "method", "name": "p3", "serializedName": "p3", @@ -10418,7 +10486,7 @@ "isExactName": false }, { - "$id": "708", + "$id": "716", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10434,7 +10502,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral.accept", "methodParameterSegments": [ { - "$id": "709", + "$id": "717", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10461,7 +10529,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10487,21 +10555,21 @@ }, "parameters": [ { - "$ref": "703" + "$ref": "711" }, { - "$ref": "705" + "$ref": "713" }, { - "$ref": "707" + "$ref": "715" }, { - "$ref": "709" + "$ref": "717" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10510,7 +10578,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.helloLiteral" }, { - "$id": "710", + "$id": "718", "kind": "basic", "name": "topAction", "isExactName": false, @@ -10521,7 +10589,7 @@ ], "doc": "top level method", "operation": { - "$id": "711", + "$id": "719", "name": "topAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10529,17 +10597,17 @@ "accessibility": "public", "parameters": [ { - "$id": "712", + "$id": "720", "kind": "path", "name": "action", "serializedName": "action", "type": { - "$id": "713", + "$id": "721", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "714", + "$id": "722", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10560,17 +10628,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.action", "methodParameterSegments": [ { - "$id": "715", + "$id": "723", "kind": "method", "name": "action", "serializedName": "action", "type": { - "$id": "716", + "$id": "724", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc3339", "wireType": { - "$id": "717", + "$id": "725", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -10593,7 +10661,7 @@ "isExactName": false }, { - "$id": "718", + "$id": "726", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10609,7 +10677,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction.accept", "methodParameterSegments": [ { - "$id": "719", + "$id": "727", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10636,7 +10704,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10662,15 +10730,15 @@ }, "parameters": [ { - "$ref": "715" + "$ref": "723" }, { - "$ref": "719" + "$ref": "727" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10679,7 +10747,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction" }, { - "$id": "720", + "$id": "728", "kind": "basic", "name": "topAction2", "isExactName": false, @@ -10690,7 +10758,7 @@ ], "doc": "top level method2", "operation": { - "$id": "721", + "$id": "729", "name": "topAction2", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10698,7 +10766,7 @@ "accessibility": "public", "parameters": [ { - "$id": "722", + "$id": "730", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10714,7 +10782,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2.accept", "methodParameterSegments": [ { - "$id": "723", + "$id": "731", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10741,7 +10809,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10767,12 +10835,12 @@ }, "parameters": [ { - "$ref": "723" + "$ref": "731" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10781,7 +10849,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.topAction2" }, { - "$id": "724", + "$id": "732", "kind": "basic", "name": "patchAction", "isExactName": false, @@ -10792,7 +10860,7 @@ ], "doc": "top level patch", "operation": { - "$id": "725", + "$id": "733", "name": "patchAction", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10800,7 +10868,7 @@ "accessibility": "public", "parameters": [ { - "$id": "726", + "$id": "734", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -10817,7 +10885,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.contentType", "methodParameterSegments": [ { - "$id": "727", + "$id": "735", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -10839,7 +10907,7 @@ "isExactName": false }, { - "$id": "728", + "$id": "736", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -10855,7 +10923,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.accept", "methodParameterSegments": [ { - "$id": "729", + "$id": "737", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -10876,12 +10944,12 @@ "isExactName": false }, { - "$id": "730", + "$id": "738", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -10895,12 +10963,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction.body", "methodParameterSegments": [ { - "$id": "731", + "$id": "739", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -10927,7 +10995,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -10956,18 +11024,18 @@ }, "parameters": [ { - "$ref": "731" + "$ref": "739" }, { - "$ref": "727" + "$ref": "735" }, { - "$ref": "729" + "$ref": "737" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -10976,7 +11044,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.patchAction" }, { - "$id": "732", + "$id": "740", "kind": "basic", "name": "anonymousBody", "isExactName": false, @@ -10987,7 +11055,7 @@ ], "doc": "body parameter without body decorator", "operation": { - "$id": "733", + "$id": "741", "name": "anonymousBody", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -10995,7 +11063,7 @@ "accessibility": "public", "parameters": [ { - "$id": "734", + "$id": "742", "kind": "query", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11011,7 +11079,7 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "735", + "$id": "743", "kind": "method", "name": "requiredQueryParam", "serializedName": "requiredQueryParam", @@ -11032,7 +11100,7 @@ "isExactName": false }, { - "$id": "736", + "$id": "744", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", @@ -11048,7 +11116,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.requiredHeader", "methodParameterSegments": [ { - "$id": "737", + "$id": "745", "kind": "method", "name": "requiredHeader", "serializedName": "required-header", @@ -11069,7 +11137,7 @@ "isExactName": false }, { - "$id": "738", + "$id": "746", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11086,7 +11154,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.contentType", "methodParameterSegments": [ { - "$id": "739", + "$id": "747", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11108,7 +11176,7 @@ "isExactName": false }, { - "$id": "740", + "$id": "748", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11124,7 +11192,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.accept", "methodParameterSegments": [ { - "$id": "741", + "$id": "749", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11145,12 +11213,12 @@ "isExactName": false }, { - "$id": "742", + "$id": "750", "kind": "body", "name": "thing", "serializedName": "thing", "type": { - "$ref": "256" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -11164,13 +11232,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody.body", "methodParameterSegments": [ { - "$id": "743", + "$id": "751", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the Thing", "type": { - "$id": "744", + "$id": "752", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11201,7 +11269,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -11230,16 +11298,16 @@ }, "parameters": [ { - "$ref": "743" + "$ref": "751" }, { - "$id": "745", + "$id": "753", "kind": "method", "name": "requiredUnion", "serializedName": "requiredUnion", "doc": "required Union", "type": { - "$ref": "260" + "$ref": "268" }, "location": "Body", "isApiVersion": false, @@ -11252,7 +11320,7 @@ "isExactName": false }, { - "$id": "746", + "$id": "754", "kind": "method", "name": "requiredLiteralString", "serializedName": "requiredLiteralString", @@ -11271,13 +11339,13 @@ "isExactName": false }, { - "$id": "747", + "$id": "755", "kind": "method", "name": "requiredNullableString", "serializedName": "requiredNullableString", "doc": "required nullable string", "type": { - "$ref": "267" + "$ref": "275" }, "location": "Body", "isApiVersion": false, @@ -11290,13 +11358,13 @@ "isExactName": false }, { - "$id": "748", + "$id": "756", "kind": "method", "name": "optionalNullableString", "serializedName": "optionalNullableString", "doc": "required optional string", "type": { - "$ref": "270" + "$ref": "278" }, "location": "Body", "isApiVersion": false, @@ -11309,7 +11377,7 @@ "isExactName": false }, { - "$id": "749", + "$id": "757", "kind": "method", "name": "requiredLiteralInt", "serializedName": "requiredLiteralInt", @@ -11328,7 +11396,7 @@ "isExactName": false }, { - "$id": "750", + "$id": "758", "kind": "method", "name": "requiredLiteralFloat", "serializedName": "requiredLiteralFloat", @@ -11347,7 +11415,7 @@ "isExactName": false }, { - "$id": "751", + "$id": "759", "kind": "method", "name": "requiredLiteralBool", "serializedName": "requiredLiteralBool", @@ -11366,19 +11434,19 @@ "isExactName": false }, { - "$id": "752", + "$id": "760", "kind": "method", "name": "optionalLiteralString", "serializedName": "optionalLiteralString", "doc": "optional literal string", "type": { - "$id": "753", + "$id": "761", "kind": "enum", "name": "ThingOptionalLiteralString", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "754", + "$id": "762", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11386,12 +11454,12 @@ }, "values": [ { - "$id": "755", + "$id": "763", "kind": "enumvalue", "name": "reject", "value": "reject", "valueType": { - "$id": "756", + "$id": "764", "kind": "string", "decorators": [], "doc": "A sequence of textual characters.", @@ -11399,7 +11467,7 @@ "crossLanguageDefinitionId": "TypeSpec.string" }, "enumType": { - "$ref": "753" + "$ref": "761" }, "decorators": [], "isExactName": false @@ -11423,13 +11491,13 @@ "isExactName": false }, { - "$id": "757", + "$id": "765", "kind": "method", "name": "requiredNullableLiteralString", "serializedName": "requiredNullableLiteralString", "doc": "required nullable literal string", "type": { - "$ref": "277" + "$ref": "285" }, "location": "Body", "isApiVersion": false, @@ -11442,19 +11510,19 @@ "isExactName": false }, { - "$id": "758", + "$id": "766", "kind": "method", "name": "optionalLiteralInt", "serializedName": "optionalLiteralInt", "doc": "optional literal int", "type": { - "$id": "759", + "$id": "767", "kind": "enum", "name": "ThingOptionalLiteralInt", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "760", + "$id": "768", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -11462,12 +11530,12 @@ }, "values": [ { - "$id": "761", + "$id": "769", "kind": "enumvalue", "name": "456", "value": 456, "valueType": { - "$id": "762", + "$id": "770", "kind": "int32", "decorators": [], "doc": "A 32-bit integer. (`-2,147,483,648` to `2,147,483,647`)", @@ -11475,7 +11543,7 @@ "crossLanguageDefinitionId": "TypeSpec.int32" }, "enumType": { - "$ref": "759" + "$ref": "767" }, "decorators": [], "isExactName": false @@ -11499,19 +11567,19 @@ "isExactName": false }, { - "$id": "763", + "$id": "771", "kind": "method", "name": "optionalLiteralFloat", "serializedName": "optionalLiteralFloat", "doc": "optional literal float", "type": { - "$id": "764", + "$id": "772", "kind": "enum", "name": "ThingOptionalLiteralFloat", "apiVersions": [], "crossLanguageDefinitionId": "", "valueType": { - "$id": "765", + "$id": "773", "kind": "float32", "name": "float32", "crossLanguageDefinitionId": "TypeSpec.float32", @@ -11519,12 +11587,12 @@ }, "values": [ { - "$id": "766", + "$id": "774", "kind": "enumvalue", "name": "4.56", "value": 4.56, "valueType": { - "$id": "767", + "$id": "775", "kind": "float32", "decorators": [], "doc": "A 32 bit floating point number. (`±1.5 x 10^−45` to `±3.4 x 10^38`)", @@ -11532,7 +11600,7 @@ "crossLanguageDefinitionId": "TypeSpec.float32" }, "enumType": { - "$ref": "764" + "$ref": "772" }, "decorators": [], "isExactName": false @@ -11556,7 +11624,7 @@ "isExactName": false }, { - "$id": "768", + "$id": "776", "kind": "method", "name": "optionalLiteralBool", "serializedName": "optionalLiteralBool", @@ -11575,13 +11643,13 @@ "isExactName": false }, { - "$id": "769", + "$id": "777", "kind": "method", "name": "requiredBadDescription", "serializedName": "requiredBadDescription", "doc": "description with xml <|endoftext|>", "type": { - "$id": "770", + "$id": "778", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11598,13 +11666,13 @@ "isExactName": false }, { - "$id": "771", + "$id": "779", "kind": "method", "name": "optionalNullableList", "serializedName": "optionalNullableList", "doc": "optional nullable collection", "type": { - "$ref": "284" + "$ref": "292" }, "location": "Body", "isApiVersion": false, @@ -11617,13 +11685,13 @@ "isExactName": false }, { - "$id": "772", + "$id": "780", "kind": "method", "name": "requiredNullableList", "serializedName": "requiredNullableList", "doc": "required nullable collection", "type": { - "$ref": "288" + "$ref": "296" }, "location": "Body", "isApiVersion": false, @@ -11636,13 +11704,13 @@ "isExactName": false }, { - "$id": "773", + "$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": "774", + "$id": "782", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11659,21 +11727,21 @@ "isExactName": false }, { - "$ref": "735" + "$ref": "743" }, { - "$ref": "737" + "$ref": "745" }, { - "$ref": "739" + "$ref": "747" }, { - "$ref": "741" + "$ref": "749" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -11682,7 +11750,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.anonymousBody" }, { - "$id": "775", + "$id": "783", "kind": "basic", "name": "friendlyModel", "isExactName": false, @@ -11693,7 +11761,7 @@ ], "doc": "Model can have its friendly name", "operation": { - "$id": "776", + "$id": "784", "name": "friendlyModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -11701,7 +11769,7 @@ "accessibility": "public", "parameters": [ { - "$id": "777", + "$id": "785", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -11718,7 +11786,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.contentType", "methodParameterSegments": [ { - "$id": "778", + "$id": "786", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -11740,7 +11808,7 @@ "isExactName": false }, { - "$id": "779", + "$id": "787", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -11756,7 +11824,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.accept", "methodParameterSegments": [ { - "$id": "780", + "$id": "788", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -11777,12 +11845,12 @@ "isExactName": false }, { - "$id": "781", + "$id": "789", "kind": "body", "name": "friend", "serializedName": "friend", "type": { - "$ref": "345" + "$ref": "353" }, "isApiVersion": false, "contentTypes": [ @@ -11796,13 +11864,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel.body", "methodParameterSegments": [ { - "$id": "782", + "$id": "790", "kind": "method", "name": "name", "serializedName": "name", "doc": "name of the NotFriend", "type": { - "$id": "783", + "$id": "791", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11833,7 +11901,7 @@ 200 ], "bodyType": { - "$ref": "345" + "$ref": "353" }, "headers": [], "isErrorResponse": false, @@ -11862,18 +11930,18 @@ }, "parameters": [ { - "$ref": "782" + "$ref": "790" }, { - "$ref": "778" + "$ref": "786" }, { - "$ref": "780" + "$ref": "788" } ], "response": { "type": { - "$ref": "345" + "$ref": "353" } }, "isOverride": false, @@ -11882,7 +11950,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.friendlyModel" }, { - "$id": "784", + "$id": "792", "kind": "basic", "name": "addTimeHeader", "isExactName": false, @@ -11892,24 +11960,24 @@ "2024-08-16-preview" ], "operation": { - "$id": "785", + "$id": "793", "name": "addTimeHeader", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "786", + "$id": "794", "kind": "header", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "787", + "$id": "795", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "788", + "$id": "796", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11927,17 +11995,17 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader.repeatabilityFirstSent", "methodParameterSegments": [ { - "$id": "789", + "$id": "797", "kind": "method", "name": "repeatabilityFirstSent", "serializedName": "Repeatability-First-Sent", "type": { - "$id": "790", + "$id": "798", "kind": "utcDateTime", "name": "utcDateTime", "encode": "rfc7231", "wireType": { - "$id": "791", + "$id": "799", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -11982,7 +12050,7 @@ }, "parameters": [ { - "$ref": "789" + "$ref": "797" } ], "response": {}, @@ -11992,7 +12060,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.addTimeHeader" }, { - "$id": "792", + "$id": "800", "kind": "basic", "name": "projectedNameModel", "isExactName": false, @@ -12003,7 +12071,7 @@ ], "doc": "Model can have its projected name", "operation": { - "$id": "793", + "$id": "801", "name": "projectedNameModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12011,7 +12079,7 @@ "accessibility": "public", "parameters": [ { - "$id": "794", + "$id": "802", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12028,7 +12096,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.contentType", "methodParameterSegments": [ { - "$id": "795", + "$id": "803", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12050,7 +12118,7 @@ "isExactName": false }, { - "$id": "796", + "$id": "804", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12066,7 +12134,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.accept", "methodParameterSegments": [ { - "$id": "797", + "$id": "805", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12087,12 +12155,12 @@ "isExactName": false }, { - "$id": "798", + "$id": "806", "kind": "body", "name": "renamedModel", "serializedName": "renamedModel", "type": { - "$ref": "348" + "$ref": "356" }, "isApiVersion": false, "contentTypes": [ @@ -12106,13 +12174,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel.body", "methodParameterSegments": [ { - "$id": "799", + "$id": "807", "kind": "method", "name": "otherName", "serializedName": "otherName", "doc": "name of the ModelWithClientName", "type": { - "$id": "800", + "$id": "808", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12143,7 +12211,7 @@ 200 ], "bodyType": { - "$ref": "348" + "$ref": "356" }, "headers": [], "isErrorResponse": false, @@ -12172,18 +12240,18 @@ }, "parameters": [ { - "$ref": "799" + "$ref": "807" }, { - "$ref": "795" + "$ref": "803" }, { - "$ref": "797" + "$ref": "805" } ], "response": { "type": { - "$ref": "348" + "$ref": "356" } }, "isOverride": false, @@ -12192,7 +12260,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.projectedNameModel" }, { - "$id": "801", + "$id": "809", "kind": "basic", "name": "returnsAnonymousModel", "isExactName": false, @@ -12203,7 +12271,7 @@ ], "doc": "return anonymous model", "operation": { - "$id": "802", + "$id": "810", "name": "returnsAnonymousModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12211,7 +12279,7 @@ "accessibility": "public", "parameters": [ { - "$id": "803", + "$id": "811", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12227,7 +12295,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel.accept", "methodParameterSegments": [ { - "$id": "804", + "$id": "812", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12254,7 +12322,7 @@ 200 ], "bodyType": { - "$ref": "351" + "$ref": "359" }, "headers": [], "isErrorResponse": false, @@ -12280,12 +12348,12 @@ }, "parameters": [ { - "$ref": "804" + "$ref": "812" } ], "response": { "type": { - "$ref": "351" + "$ref": "359" } }, "isOverride": false, @@ -12294,7 +12362,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.returnsAnonymousModel" }, { - "$id": "805", + "$id": "813", "kind": "basic", "name": "getUnknownValue", "isExactName": false, @@ -12305,7 +12373,7 @@ ], "doc": "get extensible enum", "operation": { - "$id": "806", + "$id": "814", "name": "getUnknownValue", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12313,7 +12381,7 @@ "accessibility": "public", "parameters": [ { - "$id": "807", + "$id": "815", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12329,7 +12397,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue.accept", "methodParameterSegments": [ { - "$id": "808", + "$id": "816", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12378,7 +12446,7 @@ }, "parameters": [ { - "$ref": "808" + "$ref": "816" } ], "response": { @@ -12392,7 +12460,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.getUnknownValue" }, { - "$id": "809", + "$id": "817", "kind": "basic", "name": "internalProtocol", "isExactName": false, @@ -12403,7 +12471,7 @@ ], "doc": "When set protocol false and convenient true, then the protocol method should be internal", "operation": { - "$id": "810", + "$id": "818", "name": "internalProtocol", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12411,7 +12479,7 @@ "accessibility": "public", "parameters": [ { - "$id": "811", + "$id": "819", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -12428,7 +12496,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.contentType", "methodParameterSegments": [ { - "$id": "812", + "$id": "820", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -12450,7 +12518,7 @@ "isExactName": false }, { - "$id": "813", + "$id": "821", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12466,7 +12534,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.accept", "methodParameterSegments": [ { - "$id": "814", + "$id": "822", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12487,12 +12555,12 @@ "isExactName": false }, { - "$id": "815", + "$id": "823", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "isApiVersion": false, "contentTypes": [ @@ -12506,12 +12574,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol.body", "methodParameterSegments": [ { - "$id": "816", + "$id": "824", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "256" + "$ref": "264" }, "location": "Body", "isApiVersion": false, @@ -12538,7 +12606,7 @@ 200 ], "bodyType": { - "$ref": "256" + "$ref": "264" }, "headers": [], "isErrorResponse": false, @@ -12567,18 +12635,18 @@ }, "parameters": [ { - "$ref": "816" + "$ref": "824" }, { - "$ref": "812" + "$ref": "820" }, { - "$ref": "814" + "$ref": "822" } ], "response": { "type": { - "$ref": "256" + "$ref": "264" } }, "isOverride": false, @@ -12587,7 +12655,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.internalProtocol" }, { - "$id": "817", + "$id": "825", "kind": "basic", "name": "stillConvenient", "isExactName": false, @@ -12598,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": "818", + "$id": "826", "name": "stillConvenient", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12633,7 +12701,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.stillConvenient" }, { - "$id": "819", + "$id": "827", "kind": "basic", "name": "headAsBoolean", "isExactName": false, @@ -12644,7 +12712,7 @@ ], "doc": "head as boolean.", "operation": { - "$id": "820", + "$id": "828", "name": "headAsBoolean", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12652,12 +12720,12 @@ "accessibility": "public", "parameters": [ { - "$id": "821", + "$id": "829", "kind": "path", "name": "id", "serializedName": "id", "type": { - "$id": "822", + "$id": "830", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12675,12 +12743,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean.id", "methodParameterSegments": [ { - "$id": "823", + "$id": "831", "kind": "method", "name": "id", "serializedName": "id", "type": { - "$id": "824", + "$id": "832", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12722,7 +12790,7 @@ }, "parameters": [ { - "$ref": "823" + "$ref": "831" } ], "response": {}, @@ -12732,7 +12800,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.headAsBoolean" }, { - "$id": "825", + "$id": "833", "kind": "basic", "name": "WithApiVersion", "isExactName": false, @@ -12743,7 +12811,7 @@ ], "doc": "Return hi again", "operation": { - "$id": "826", + "$id": "834", "name": "WithApiVersion", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12751,12 +12819,12 @@ "accessibility": "public", "parameters": [ { - "$id": "827", + "$id": "835", "kind": "header", "name": "p1", "serializedName": "p1", "type": { - "$id": "828", + "$id": "836", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12771,12 +12839,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion.p1", "methodParameterSegments": [ { - "$id": "829", + "$id": "837", "kind": "method", "name": "p1", "serializedName": "p1", "type": { - "$id": "830", + "$id": "838", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12796,12 +12864,12 @@ "isExactName": false }, { - "$id": "831", + "$id": "839", "kind": "query", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "832", + "$id": "840", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12811,7 +12879,7 @@ "explode": false, "defaultValue": { "type": { - "$id": "833", + "$id": "841", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12825,12 +12893,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "834", + "$id": "842", "kind": "method", "name": "apiVersion", "serializedName": "apiVersion", "type": { - "$id": "835", + "$id": "843", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -12840,7 +12908,7 @@ "isApiVersion": true, "defaultValue": { "type": { - "$id": "836", + "$id": "844", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -12881,7 +12949,7 @@ }, "parameters": [ { - "$ref": "829" + "$ref": "837" } ], "response": {}, @@ -12891,7 +12959,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.WithApiVersion" }, { - "$id": "837", + "$id": "845", "kind": "paging", "name": "ListWithNextLink", "isExactName": false, @@ -12902,7 +12970,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "838", + "$id": "846", "name": "ListWithNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -12910,7 +12978,7 @@ "accessibility": "public", "parameters": [ { - "$id": "839", + "$id": "847", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -12926,7 +12994,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithNextLink.accept", "methodParameterSegments": [ { - "$id": "840", + "$id": "848", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -12953,7 +13021,7 @@ 200 ], "bodyType": { - "$ref": "352" + "$ref": "360" }, "headers": [], "isErrorResponse": false, @@ -12979,12 +13047,12 @@ }, "parameters": [ { - "$ref": "840" + "$ref": "848" } ], "response": { "type": { - "$ref": "354" + "$ref": "362" }, "resultSegments": [ "things" @@ -13008,7 +13076,7 @@ } }, { - "$id": "841", + "$id": "849", "kind": "paging", "name": "ListWithStringNextLink", "isExactName": false, @@ -13019,7 +13087,7 @@ ], "doc": "List things with nextlink", "operation": { - "$id": "842", + "$id": "850", "name": "ListWithStringNextLink", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13027,7 +13095,7 @@ "accessibility": "public", "parameters": [ { - "$id": "843", + "$id": "851", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13043,7 +13111,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithStringNextLink.accept", "methodParameterSegments": [ { - "$id": "844", + "$id": "852", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13070,7 +13138,7 @@ 200 ], "bodyType": { - "$ref": "357" + "$ref": "365" }, "headers": [], "isErrorResponse": false, @@ -13096,12 +13164,12 @@ }, "parameters": [ { - "$ref": "844" + "$ref": "852" } ], "response": { "type": { - "$ref": "354" + "$ref": "362" }, "resultSegments": [ "things" @@ -13125,7 +13193,7 @@ } }, { - "$id": "845", + "$id": "853", "kind": "paging", "name": "ListWithContinuationToken", "isExactName": false, @@ -13136,7 +13204,7 @@ ], "doc": "List things with continuation token", "operation": { - "$id": "846", + "$id": "854", "name": "ListWithContinuationToken", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13144,12 +13212,12 @@ "accessibility": "public", "parameters": [ { - "$id": "847", + "$id": "855", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "848", + "$id": "856", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13164,12 +13232,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "849", + "$id": "857", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "850", + "$id": "858", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13189,7 +13257,7 @@ "isExactName": false }, { - "$id": "851", + "$id": "859", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13205,7 +13273,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationToken.accept", "methodParameterSegments": [ { - "$id": "852", + "$id": "860", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13232,7 +13300,7 @@ 200 ], "bodyType": { - "$ref": "361" + "$ref": "369" }, "headers": [], "isErrorResponse": false, @@ -13258,15 +13326,15 @@ }, "parameters": [ { - "$ref": "849" + "$ref": "857" }, { - "$ref": "852" + "$ref": "860" } ], "response": { "type": { - "$ref": "354" + "$ref": "362" }, "resultSegments": [ "things" @@ -13282,7 +13350,7 @@ ], "continuationToken": { "parameter": { - "$ref": "847" + "$ref": "855" }, "responseSegments": [ "nextToken" @@ -13293,7 +13361,7 @@ } }, { - "$id": "853", + "$id": "861", "kind": "paging", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, @@ -13304,7 +13372,7 @@ ], "doc": "List things with continuation token header response", "operation": { - "$id": "854", + "$id": "862", "name": "ListWithContinuationTokenHeaderResponse", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13312,12 +13380,12 @@ "accessibility": "public", "parameters": [ { - "$id": "855", + "$id": "863", "kind": "query", "name": "token", "serializedName": "token", "type": { - "$id": "856", + "$id": "864", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13332,12 +13400,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "857", + "$id": "865", "kind": "method", "name": "token", "serializedName": "token", "type": { - "$id": "858", + "$id": "866", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13357,7 +13425,7 @@ "isExactName": false }, { - "$id": "859", + "$id": "867", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13373,7 +13441,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithContinuationTokenHeaderResponse.accept", "methodParameterSegments": [ { - "$id": "860", + "$id": "868", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13400,14 +13468,14 @@ 200 ], "bodyType": { - "$ref": "365" + "$ref": "373" }, "headers": [ { "name": "nextToken", "nameInResponse": "next-token", "type": { - "$id": "861", + "$id": "869", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13438,15 +13506,15 @@ }, "parameters": [ { - "$ref": "857" + "$ref": "865" }, { - "$ref": "860" + "$ref": "868" } ], "response": { "type": { - "$ref": "354" + "$ref": "362" }, "resultSegments": [ "things" @@ -13462,7 +13530,7 @@ ], "continuationToken": { "parameter": { - "$ref": "855" + "$ref": "863" }, "responseSegments": [ "next-token" @@ -13473,7 +13541,7 @@ } }, { - "$id": "862", + "$id": "870", "kind": "paging", "name": "ListWithPaging", "isExactName": false, @@ -13484,7 +13552,7 @@ ], "doc": "List things with paging", "operation": { - "$id": "863", + "$id": "871", "name": "ListWithPaging", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13492,7 +13560,7 @@ "accessibility": "public", "parameters": [ { - "$id": "864", + "$id": "872", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13508,7 +13576,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ListWithPaging.accept", "methodParameterSegments": [ { - "$id": "865", + "$id": "873", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13535,7 +13603,7 @@ 200 ], "bodyType": { - "$ref": "367" + "$ref": "375" }, "headers": [], "isErrorResponse": false, @@ -13561,12 +13629,12 @@ }, "parameters": [ { - "$ref": "865" + "$ref": "873" } ], "response": { "type": { - "$ref": "354" + "$ref": "362" }, "resultSegments": [ "items" @@ -13584,7 +13652,7 @@ } }, { - "$id": "866", + "$id": "874", "kind": "basic", "name": "EmbeddedParameters", "isExactName": false, @@ -13595,7 +13663,7 @@ ], "doc": "An operation with embedded parameters within the body", "operation": { - "$id": "867", + "$id": "875", "name": "EmbeddedParameters", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13603,13 +13671,13 @@ "accessibility": "public", "parameters": [ { - "$id": "868", + "$id": "876", "kind": "header", "name": "requiredHeader", "serializedName": "required-header", "doc": "required header parameter", "type": { - "$id": "869", + "$id": "877", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13624,12 +13692,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.requiredHeader", "methodParameterSegments": [ { - "$id": "870", + "$id": "878", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "369" + "$ref": "377" }, "location": "Body", "isApiVersion": false, @@ -13642,13 +13710,13 @@ "isExactName": false }, { - "$id": "871", + "$id": "879", "kind": "method", "name": "requiredHeader", "serializedName": "requiredHeader", "doc": "required header parameter", "type": { - "$ref": "373" + "$ref": "381" }, "location": "", "isApiVersion": false, @@ -13664,13 +13732,13 @@ "isExactName": false }, { - "$id": "872", + "$id": "880", "kind": "header", "name": "optionalHeader", "serializedName": "optional-header", "doc": "optional header parameter", "type": { - "$id": "873", + "$id": "881", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13685,16 +13753,16 @@ "crossLanguageDefinitionId": "SampleTypeSpec.ModelWithEmbeddedNonBodyParameters.optionalHeader", "methodParameterSegments": [ { - "$ref": "870" + "$ref": "878" }, { - "$id": "874", + "$id": "882", "kind": "method", "name": "optionalHeader", "serializedName": "optionalHeader", "doc": "optional header parameter", "type": { - "$ref": "375" + "$ref": "383" }, "location": "", "isApiVersion": false, @@ -13710,13 +13778,13 @@ "isExactName": false }, { - "$id": "875", + "$id": "883", "kind": "query", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$id": "876", + "$id": "884", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13731,16 +13799,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "870" + "$ref": "878" }, { - "$id": "877", + "$id": "885", "kind": "method", "name": "requiredQuery", "serializedName": "requiredQuery", "doc": "required query parameter", "type": { - "$ref": "377" + "$ref": "385" }, "location": "", "isApiVersion": false, @@ -13756,13 +13824,13 @@ "isExactName": false }, { - "$id": "878", + "$id": "886", "kind": "query", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$id": "879", + "$id": "887", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -13777,16 +13845,16 @@ "readOnly": false, "methodParameterSegments": [ { - "$ref": "870" + "$ref": "878" }, { - "$id": "880", + "$id": "888", "kind": "method", "name": "optionalQuery", "serializedName": "optionalQuery", "doc": "optional query parameter", "type": { - "$ref": "379" + "$ref": "387" }, "location": "", "isApiVersion": false, @@ -13802,7 +13870,7 @@ "isExactName": false }, { - "$id": "881", + "$id": "889", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13819,7 +13887,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.contentType", "methodParameterSegments": [ { - "$id": "882", + "$id": "890", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13841,12 +13909,12 @@ "isExactName": false }, { - "$id": "883", + "$id": "891", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "369" + "$ref": "377" }, "isApiVersion": false, "contentTypes": [ @@ -13860,7 +13928,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters.body", "methodParameterSegments": [ { - "$ref": "870" + "$ref": "878" } ], "isExactName": false, @@ -13896,10 +13964,10 @@ }, "parameters": [ { - "$ref": "870" + "$ref": "878" }, { - "$ref": "882" + "$ref": "890" } ], "response": {}, @@ -13909,7 +13977,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.EmbeddedParameters" }, { - "$id": "884", + "$id": "892", "kind": "basic", "name": "DynamicModelOperation", "isExactName": false, @@ -13920,7 +13988,7 @@ ], "doc": "An operation with a dynamic model", "operation": { - "$id": "885", + "$id": "893", "name": "DynamicModelOperation", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -13928,7 +13996,7 @@ "accessibility": "public", "parameters": [ { - "$id": "886", + "$id": "894", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -13945,7 +14013,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.contentType", "methodParameterSegments": [ { - "$id": "887", + "$id": "895", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -13967,12 +14035,12 @@ "isExactName": false }, { - "$id": "888", + "$id": "896", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "380" + "$ref": "388" }, "isApiVersion": false, "contentTypes": [ @@ -13986,12 +14054,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation.body", "methodParameterSegments": [ { - "$id": "889", + "$id": "897", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "380" + "$ref": "388" }, "location": "Body", "isApiVersion": false, @@ -14037,10 +14105,10 @@ }, "parameters": [ { - "$ref": "889" + "$ref": "897" }, { - "$ref": "887" + "$ref": "895" } ], "response": {}, @@ -14050,7 +14118,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DynamicModelOperation" }, { - "$id": "890", + "$id": "898", "kind": "basic", "name": "GetXmlAdvancedModel", "isExactName": false, @@ -14061,7 +14129,7 @@ ], "doc": "Get an advanced XML model with various property types", "operation": { - "$id": "891", + "$id": "899", "name": "GetXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14069,7 +14137,7 @@ "accessibility": "public", "parameters": [ { - "$id": "892", + "$id": "900", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14085,7 +14153,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "893", + "$id": "901", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14112,7 +14180,7 @@ 200 ], "bodyType": { - "$ref": "418" + "$ref": "426" }, "headers": [ { @@ -14146,12 +14214,12 @@ }, "parameters": [ { - "$ref": "893" + "$ref": "901" } ], "response": { "type": { - "$ref": "418" + "$ref": "426" } }, "isOverride": false, @@ -14160,7 +14228,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.GetXmlAdvancedModel" }, { - "$id": "894", + "$id": "902", "kind": "basic", "name": "UpdateXmlAdvancedModel", "isExactName": false, @@ -14171,7 +14239,7 @@ ], "doc": "Update an advanced XML model with various property types", "operation": { - "$id": "895", + "$id": "903", "name": "UpdateXmlAdvancedModel", "isExactName": false, "resourceName": "SampleTypeSpec", @@ -14179,7 +14247,7 @@ "accessibility": "public", "parameters": [ { - "$id": "896", + "$id": "904", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14195,7 +14263,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.contentType", "methodParameterSegments": [ { - "$id": "897", + "$id": "905", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14216,7 +14284,7 @@ "isExactName": false }, { - "$id": "898", + "$id": "906", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14232,7 +14300,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.accept", "methodParameterSegments": [ { - "$id": "899", + "$id": "907", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14253,12 +14321,12 @@ "isExactName": false }, { - "$id": "900", + "$id": "908", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "418" + "$ref": "426" }, "isApiVersion": false, "contentTypes": [ @@ -14272,12 +14340,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel.body", "methodParameterSegments": [ { - "$id": "901", + "$id": "909", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "418" + "$ref": "426" }, "location": "Body", "isApiVersion": false, @@ -14304,7 +14372,7 @@ 200 ], "bodyType": { - "$ref": "418" + "$ref": "426" }, "headers": [ { @@ -14341,18 +14409,18 @@ }, "parameters": [ { - "$ref": "901" + "$ref": "909" }, { - "$ref": "897" + "$ref": "905" }, { - "$ref": "899" + "$ref": "907" } ], "response": { "type": { - "$ref": "418" + "$ref": "426" } }, "isOverride": false, @@ -14361,7 +14429,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.UpdateXmlAdvancedModel" }, { - "$id": "902", + "$id": "910", "kind": "basic", "name": "uploadCat", "isExactName": false, @@ -14371,14 +14439,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "903", + "$id": "911", "name": "uploadCat", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "904", + "$id": "912", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14394,7 +14462,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.contentType", "methodParameterSegments": [ { - "$id": "905", + "$id": "913", "kind": "method", "name": "contentType", "serializedName": "Content-Type", @@ -14415,12 +14483,12 @@ "isExactName": false }, { - "$id": "906", + "$id": "914", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$ref": "514" + "$ref": "522" }, "isApiVersion": false, "contentTypes": [ @@ -14434,12 +14502,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat.body", "methodParameterSegments": [ { - "$id": "907", + "$id": "915", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "514" + "$ref": "522" }, "location": "Body", "isApiVersion": false, @@ -14481,10 +14549,10 @@ }, "parameters": [ { - "$ref": "905" + "$ref": "913" }, { - "$ref": "907" + "$ref": "915" } ], "response": {}, @@ -14494,7 +14562,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.uploadCat" }, { - "$id": "908", + "$id": "916", "kind": "basic", "name": "sendJsonLines", "isExactName": false, @@ -14504,14 +14572,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "909", + "$id": "917", "name": "sendJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "910", + "$id": "918", "kind": "header", "name": "contentType", "serializedName": "Content-Type", @@ -14527,16 +14595,16 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.contentType", "methodParameterSegments": [ { - "$id": "911", + "$id": "919", "kind": "method", "name": "stream", "serializedName": "stream", "type": { - "$id": "912", + "$id": "920", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14555,7 +14623,7 @@ "isExactName": false }, { - "$id": "913", + "$id": "921", "kind": "method", "name": "contentType", "serializedName": "contentType", @@ -14576,16 +14644,16 @@ "isExactName": false }, { - "$id": "914", + "$id": "922", "kind": "body", "name": "body", "serializedName": "body", "type": { - "$id": "915", + "$id": "923", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14605,15 +14673,15 @@ "crossLanguageDefinitionId": "TypeSpec.Http.Streams.JsonlStream.body", "methodParameterSegments": [ { - "$ref": "911" + "$ref": "919" }, { - "$id": "916", + "$id": "924", "kind": "method", "name": "body", "serializedName": "body", "type": { - "$ref": "639" + "$ref": "647" }, "location": "", "isApiVersion": false, @@ -14659,7 +14727,7 @@ }, "parameters": [ { - "$ref": "911" + "$ref": "919" } ], "response": {}, @@ -14669,7 +14737,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.sendJsonLines" }, { - "$id": "917", + "$id": "925", "kind": "basic", "name": "receiveJsonLines", "isExactName": false, @@ -14679,14 +14747,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "918", + "$id": "926", "name": "receiveJsonLines", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "919", + "$id": "927", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14702,7 +14770,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines.accept", "methodParameterSegments": [ { - "$id": "920", + "$id": "928", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14729,11 +14797,11 @@ 200 ], "bodyType": { - "$id": "921", + "$id": "929", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14773,16 +14841,16 @@ }, "parameters": [ { - "$ref": "920" + "$ref": "928" } ], "response": { "type": { - "$id": "922", + "$id": "930", "kind": "streaming", "name": "JsonlStreamStreamingItem", "valueType": { - "$ref": "559" + "$ref": "567" }, "streamKind": "jsonl", "contentTypes": [ @@ -14797,7 +14865,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveJsonLines" }, { - "$id": "923", + "$id": "931", "kind": "basic", "name": "receiveSse", "isExactName": false, @@ -14807,14 +14875,14 @@ "2024-08-16-preview" ], "operation": { - "$id": "924", + "$id": "932", "name": "receiveSse", "isExactName": false, "resourceName": "SampleTypeSpec", "accessibility": "public", "parameters": [ { - "$id": "925", + "$id": "933", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -14830,7 +14898,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse.accept", "methodParameterSegments": [ { - "$id": "926", + "$id": "934", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -14857,16 +14925,16 @@ 200 ], "bodyType": { - "$id": "927", + "$id": "935", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$id": "928", + "$id": "936", "kind": "union", "name": "SampleEvents", "variantTypes": [ { - "$ref": "559" + "$ref": "567" }, { "$ref": "204" @@ -14911,16 +14979,16 @@ }, "parameters": [ { - "$ref": "926" + "$ref": "934" } ], "response": { "type": { - "$id": "929", + "$id": "937", "kind": "streaming", "name": "SSEStreamSampleEvents", "valueType": { - "$ref": "928" + "$ref": "936" }, "streamKind": "sse", "contentTypes": [ @@ -14934,16 +15002,244 @@ "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "SampleTypeSpec.receiveSse" + }, + { + "$id": "938", + "kind": "basic", + "name": "getJsonInt32", + "isExactName": false, + "accessibility": "public", + "apiVersions": [ + "2024-07-16-preview", + "2024-08-16-preview" + ], + "doc": "get JSON int32", + "operation": { + "$id": "939", + "name": "getJsonInt32", + "isExactName": false, + "resourceName": "SampleTypeSpec", + "doc": "get JSON int32", + "accessibility": "public", + "parameters": [ + { + "$id": "940", + "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": "941", + "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": "942", + "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": "941" + } + ], + "response": { + "type": { + "$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": "930", + "$id": "948", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "931", + "$id": "949", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -14959,7 +15255,7 @@ "isExactName": false }, { - "$ref": "834" + "$ref": "842" } ], "initializedBy": 1, @@ -14971,14 +15267,14 @@ ], "children": [ { - "$id": "932", + "$id": "950", "kind": "client", "name": "AnimalOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "933", + "$id": "951", "kind": "basic", "name": "updatePetAsAnimal", "isExactName": false, @@ -14989,7 +15285,7 @@ ], "doc": "Update a pet as an animal", "operation": { - "$id": "934", + "$id": "952", "name": "updatePetAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -14997,13 +15293,13 @@ "accessibility": "public", "parameters": [ { - "$id": "935", + "$id": "953", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "208" + "$ref": "216" }, "isApiVersion": false, "optional": false, @@ -15014,13 +15310,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "936", + "$id": "954", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "208" + "$ref": "216" }, "location": "Header", "isApiVersion": false, @@ -15036,12 +15332,12 @@ "isExactName": false }, { - "$id": "937", + "$id": "955", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "210" + "$ref": "218" }, "isApiVersion": false, "optional": false, @@ -15052,12 +15348,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.accept", "methodParameterSegments": [ { - "$id": "938", + "$id": "956", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "210" + "$ref": "218" }, "location": "Header", "isApiVersion": false, @@ -15073,12 +15369,12 @@ "isExactName": false }, { - "$id": "939", + "$id": "957", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "570" }, "isApiVersion": false, "contentTypes": [ @@ -15092,12 +15388,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal.animal", "methodParameterSegments": [ { - "$id": "940", + "$id": "958", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "570" }, "location": "Body", "isApiVersion": false, @@ -15124,7 +15420,7 @@ 200 ], "bodyType": { - "$ref": "562" + "$ref": "570" }, "headers": [], "isErrorResponse": false, @@ -15153,18 +15449,18 @@ }, "parameters": [ { - "$ref": "940" + "$ref": "958" }, { - "$ref": "936" + "$ref": "954" }, { - "$ref": "938" + "$ref": "956" } ], "response": { "type": { - "$ref": "562" + "$ref": "570" } }, "isOverride": false, @@ -15173,7 +15469,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updatePetAsAnimal" }, { - "$id": "941", + "$id": "959", "kind": "basic", "name": "updateDogAsAnimal", "isExactName": false, @@ -15184,7 +15480,7 @@ ], "doc": "Update a dog as an animal", "operation": { - "$id": "942", + "$id": "960", "name": "updateDogAsAnimal", "isExactName": false, "resourceName": "AnimalOperations", @@ -15192,13 +15488,13 @@ "accessibility": "public", "parameters": [ { - "$id": "943", + "$id": "961", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "220" }, "isApiVersion": false, "optional": false, @@ -15209,13 +15505,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.contentType", "methodParameterSegments": [ { - "$id": "944", + "$id": "962", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "212" + "$ref": "220" }, "location": "Header", "isApiVersion": false, @@ -15231,12 +15527,12 @@ "isExactName": false }, { - "$id": "945", + "$id": "963", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "222" }, "isApiVersion": false, "optional": false, @@ -15247,12 +15543,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.accept", "methodParameterSegments": [ { - "$id": "946", + "$id": "964", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "214" + "$ref": "222" }, "location": "Header", "isApiVersion": false, @@ -15268,12 +15564,12 @@ "isExactName": false }, { - "$id": "947", + "$id": "965", "kind": "body", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "570" }, "isApiVersion": false, "contentTypes": [ @@ -15287,12 +15583,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.AnimalOperations.updateDogAsAnimal.animal", "methodParameterSegments": [ { - "$id": "948", + "$id": "966", "kind": "method", "name": "animal", "serializedName": "animal", "type": { - "$ref": "562" + "$ref": "570" }, "location": "Body", "isApiVersion": false, @@ -15319,7 +15615,7 @@ 200 ], "bodyType": { - "$ref": "562" + "$ref": "570" }, "headers": [], "isErrorResponse": false, @@ -15348,18 +15644,18 @@ }, "parameters": [ { - "$ref": "948" + "$ref": "966" }, { - "$ref": "944" + "$ref": "962" }, { - "$ref": "946" + "$ref": "964" } ], "response": { "type": { - "$ref": "562" + "$ref": "570" } }, "isOverride": false, @@ -15370,12 +15666,12 @@ ], "parameters": [ { - "$id": "949", + "$id": "967", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "950", + "$id": "968", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15399,19 +15695,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "951", + "$id": "969", "kind": "client", "name": "PetOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "952", + "$id": "970", "kind": "basic", "name": "updatePetAsPet", "isExactName": false, @@ -15422,7 +15718,7 @@ ], "doc": "Update a pet as a pet", "operation": { - "$id": "953", + "$id": "971", "name": "updatePetAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15430,13 +15726,13 @@ "accessibility": "public", "parameters": [ { - "$id": "954", + "$id": "972", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "224" }, "isApiVersion": false, "optional": false, @@ -15447,13 +15743,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.contentType", "methodParameterSegments": [ { - "$id": "955", + "$id": "973", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "216" + "$ref": "224" }, "location": "Header", "isApiVersion": false, @@ -15469,12 +15765,12 @@ "isExactName": false }, { - "$id": "956", + "$id": "974", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "226" }, "isApiVersion": false, "optional": false, @@ -15485,12 +15781,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.accept", "methodParameterSegments": [ { - "$id": "957", + "$id": "975", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "218" + "$ref": "226" }, "location": "Header", "isApiVersion": false, @@ -15506,12 +15802,12 @@ "isExactName": false }, { - "$id": "958", + "$id": "976", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -15525,12 +15821,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet.pet", "methodParameterSegments": [ { - "$id": "959", + "$id": "977", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -15557,7 +15853,7 @@ 200 ], "bodyType": { - "$ref": "567" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -15586,18 +15882,18 @@ }, "parameters": [ { - "$ref": "959" + "$ref": "977" }, { - "$ref": "955" + "$ref": "973" }, { - "$ref": "957" + "$ref": "975" } ], "response": { "type": { - "$ref": "567" + "$ref": "575" } }, "isOverride": false, @@ -15606,7 +15902,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updatePetAsPet" }, { - "$id": "960", + "$id": "978", "kind": "basic", "name": "updateDogAsPet", "isExactName": false, @@ -15617,7 +15913,7 @@ ], "doc": "Update a dog as a pet", "operation": { - "$id": "961", + "$id": "979", "name": "updateDogAsPet", "isExactName": false, "resourceName": "PetOperations", @@ -15625,13 +15921,13 @@ "accessibility": "public", "parameters": [ { - "$id": "962", + "$id": "980", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "228" }, "isApiVersion": false, "optional": false, @@ -15642,13 +15938,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.contentType", "methodParameterSegments": [ { - "$id": "963", + "$id": "981", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "220" + "$ref": "228" }, "location": "Header", "isApiVersion": false, @@ -15664,12 +15960,12 @@ "isExactName": false }, { - "$id": "964", + "$id": "982", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "230" }, "isApiVersion": false, "optional": false, @@ -15680,12 +15976,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.accept", "methodParameterSegments": [ { - "$id": "965", + "$id": "983", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "222" + "$ref": "230" }, "location": "Header", "isApiVersion": false, @@ -15701,12 +15997,12 @@ "isExactName": false }, { - "$id": "966", + "$id": "984", "kind": "body", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "575" }, "isApiVersion": false, "contentTypes": [ @@ -15720,12 +16016,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PetOperations.updateDogAsPet.pet", "methodParameterSegments": [ { - "$id": "967", + "$id": "985", "kind": "method", "name": "pet", "serializedName": "pet", "type": { - "$ref": "567" + "$ref": "575" }, "location": "Body", "isApiVersion": false, @@ -15752,7 +16048,7 @@ 200 ], "bodyType": { - "$ref": "567" + "$ref": "575" }, "headers": [], "isErrorResponse": false, @@ -15781,18 +16077,18 @@ }, "parameters": [ { - "$ref": "967" + "$ref": "985" }, { - "$ref": "963" + "$ref": "981" }, { - "$ref": "965" + "$ref": "983" } ], "response": { "type": { - "$ref": "567" + "$ref": "575" } }, "isOverride": false, @@ -15803,12 +16099,12 @@ ], "parameters": [ { - "$id": "968", + "$id": "986", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "969", + "$id": "987", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -15832,19 +16128,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "970", + "$id": "988", "kind": "client", "name": "DogOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "971", + "$id": "989", "kind": "basic", "name": "updateDogAsDog", "isExactName": false, @@ -15855,7 +16151,7 @@ ], "doc": "Update a dog as a dog", "operation": { - "$id": "972", + "$id": "990", "name": "updateDogAsDog", "isExactName": false, "resourceName": "DogOperations", @@ -15863,13 +16159,13 @@ "accessibility": "public", "parameters": [ { - "$id": "973", + "$id": "991", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "232" }, "isApiVersion": false, "optional": false, @@ -15880,13 +16176,13 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.contentType", "methodParameterSegments": [ { - "$id": "974", + "$id": "992", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "doc": "Body parameter's content type. Known values are application/json", "type": { - "$ref": "224" + "$ref": "232" }, "location": "Header", "isApiVersion": false, @@ -15902,12 +16198,12 @@ "isExactName": false }, { - "$id": "975", + "$id": "993", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "234" }, "isApiVersion": false, "optional": false, @@ -15918,12 +16214,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.accept", "methodParameterSegments": [ { - "$id": "976", + "$id": "994", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "226" + "$ref": "234" }, "location": "Header", "isApiVersion": false, @@ -15939,12 +16235,12 @@ "isExactName": false }, { - "$id": "977", + "$id": "995", "kind": "body", "name": "dog", "serializedName": "dog", "type": { - "$ref": "571" + "$ref": "579" }, "isApiVersion": false, "contentTypes": [ @@ -15958,12 +16254,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.DogOperations.updateDogAsDog.dog", "methodParameterSegments": [ { - "$id": "978", + "$id": "996", "kind": "method", "name": "dog", "serializedName": "dog", "type": { - "$ref": "571" + "$ref": "579" }, "location": "Body", "isApiVersion": false, @@ -15990,7 +16286,7 @@ 200 ], "bodyType": { - "$ref": "571" + "$ref": "579" }, "headers": [], "isErrorResponse": false, @@ -16019,18 +16315,18 @@ }, "parameters": [ { - "$ref": "978" + "$ref": "996" }, { - "$ref": "974" + "$ref": "992" }, { - "$ref": "976" + "$ref": "994" } ], "response": { "type": { - "$ref": "571" + "$ref": "579" } }, "isOverride": false, @@ -16041,12 +16337,12 @@ ], "parameters": [ { - "$id": "979", + "$id": "997", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "980", + "$id": "998", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16070,19 +16366,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "981", + "$id": "999", "kind": "client", "name": "PlantOperations", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "982", + "$id": "1000", "kind": "basic", "name": "getTree", "isExactName": false, @@ -16093,7 +16389,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "983", + "$id": "1001", "name": "getTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16101,12 +16397,12 @@ "accessibility": "public", "parameters": [ { - "$id": "984", + "$id": "1002", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "228" + "$ref": "236" }, "isApiVersion": false, "optional": false, @@ -16117,12 +16413,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree.accept", "methodParameterSegments": [ { - "$id": "985", + "$id": "1003", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "228" + "$ref": "236" }, "location": "Header", "isApiVersion": false, @@ -16144,14 +16440,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "230" + "$ref": "238" } } ], @@ -16178,12 +16474,12 @@ }, "parameters": [ { - "$ref": "985" + "$ref": "1003" } ], "response": { "type": { - "$ref": "575" + "$ref": "583" } }, "isOverride": false, @@ -16192,7 +16488,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTree" }, { - "$id": "986", + "$id": "1004", "kind": "basic", "name": "getTreeAsJson", "isExactName": false, @@ -16203,7 +16499,7 @@ ], "doc": "Get a tree as a plant", "operation": { - "$id": "987", + "$id": "1005", "name": "getTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16211,12 +16507,12 @@ "accessibility": "public", "parameters": [ { - "$id": "988", + "$id": "1006", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "240" }, "isApiVersion": false, "optional": false, @@ -16227,12 +16523,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "989", + "$id": "1007", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "232" + "$ref": "240" }, "location": "Header", "isApiVersion": false, @@ -16254,14 +16550,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "234" + "$ref": "242" } } ], @@ -16288,12 +16584,12 @@ }, "parameters": [ { - "$ref": "989" + "$ref": "1007" } ], "response": { "type": { - "$ref": "575" + "$ref": "583" } }, "isOverride": false, @@ -16302,7 +16598,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.getTreeAsJson" }, { - "$id": "990", + "$id": "1008", "kind": "basic", "name": "updateTree", "isExactName": false, @@ -16313,7 +16609,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "991", + "$id": "1009", "name": "updateTree", "isExactName": false, "resourceName": "PlantOperations", @@ -16321,12 +16617,12 @@ "accessibility": "public", "parameters": [ { - "$id": "992", + "$id": "1010", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "236" + "$ref": "244" }, "isApiVersion": false, "optional": false, @@ -16337,12 +16633,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.contentType", "methodParameterSegments": [ { - "$id": "993", + "$id": "1011", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "236" + "$ref": "244" }, "location": "Header", "isApiVersion": false, @@ -16358,12 +16654,12 @@ "isExactName": false }, { - "$id": "994", + "$id": "1012", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "248" }, "isApiVersion": false, "optional": false, @@ -16374,12 +16670,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.accept", "methodParameterSegments": [ { - "$id": "995", + "$id": "1013", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "240" + "$ref": "248" }, "location": "Header", "isApiVersion": false, @@ -16395,12 +16691,12 @@ "isExactName": false }, { - "$id": "996", + "$id": "1014", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "583" }, "isApiVersion": false, "contentTypes": [ @@ -16414,12 +16710,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree.tree", "methodParameterSegments": [ { - "$id": "997", + "$id": "1015", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "583" }, "location": "Body", "isApiVersion": false, @@ -16446,14 +16742,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "242" + "$ref": "250" } } ], @@ -16483,18 +16779,18 @@ }, "parameters": [ { - "$ref": "997" + "$ref": "1015" }, { - "$ref": "993" + "$ref": "1011" }, { - "$ref": "995" + "$ref": "1013" } ], "response": { "type": { - "$ref": "575" + "$ref": "583" } }, "isOverride": false, @@ -16503,7 +16799,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTree" }, { - "$id": "998", + "$id": "1016", "kind": "basic", "name": "updateTreeAsJson", "isExactName": false, @@ -16514,7 +16810,7 @@ ], "doc": "Update a tree as a plant", "operation": { - "$id": "999", + "$id": "1017", "name": "updateTreeAsJson", "isExactName": false, "resourceName": "PlantOperations", @@ -16522,12 +16818,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1000", + "$id": "1018", "kind": "header", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "252" }, "isApiVersion": false, "optional": false, @@ -16538,12 +16834,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.contentType", "methodParameterSegments": [ { - "$id": "1001", + "$id": "1019", "kind": "method", "name": "contentType", "serializedName": "Content-Type", "type": { - "$ref": "244" + "$ref": "252" }, "location": "Header", "isApiVersion": false, @@ -16559,12 +16855,12 @@ "isExactName": false }, { - "$id": "1002", + "$id": "1020", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "256" }, "isApiVersion": false, "optional": false, @@ -16575,12 +16871,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.accept", "methodParameterSegments": [ { - "$id": "1003", + "$id": "1021", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "248" + "$ref": "256" }, "location": "Header", "isApiVersion": false, @@ -16596,12 +16892,12 @@ "isExactName": false }, { - "$id": "1004", + "$id": "1022", "kind": "body", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "583" }, "isApiVersion": false, "contentTypes": [ @@ -16615,12 +16911,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.PlantOperations.updateTreeAsJson.tree", "methodParameterSegments": [ { - "$id": "1005", + "$id": "1023", "kind": "method", "name": "tree", "serializedName": "tree", "type": { - "$ref": "575" + "$ref": "583" }, "location": "Body", "isApiVersion": false, @@ -16647,14 +16943,14 @@ 200 ], "bodyType": { - "$ref": "575" + "$ref": "583" }, "headers": [ { "name": "contentType", "nameInResponse": "content-type", "type": { - "$ref": "250" + "$ref": "258" } } ], @@ -16684,18 +16980,18 @@ }, "parameters": [ { - "$ref": "1005" + "$ref": "1023" }, { - "$ref": "1001" + "$ref": "1019" }, { - "$ref": "1003" + "$ref": "1021" } ], "response": { "type": { - "$ref": "575" + "$ref": "583" } }, "isOverride": false, @@ -16706,12 +17002,12 @@ ], "parameters": [ { - "$id": "1006", + "$id": "1024", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1007", + "$id": "1025", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16735,19 +17031,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "1008", + "$id": "1026", "kind": "client", "name": "Metrics", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1009", + "$id": "1027", "kind": "basic", "name": "getWidgetMetrics", "isExactName": false, @@ -16758,7 +17054,7 @@ ], "doc": "Get Widget metrics for given day of week", "operation": { - "$id": "1010", + "$id": "1028", "name": "getWidgetMetrics", "isExactName": false, "resourceName": "Metrics", @@ -16766,12 +17062,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1011", + "$id": "1029", "kind": "path", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1012", + "$id": "1030", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16789,12 +17085,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", "methodParameterSegments": [ { - "$id": "1013", + "$id": "1031", "kind": "method", "name": "metricsNamespace", "serializedName": "metricsNamespace", "type": { - "$id": "1014", + "$id": "1032", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -16814,7 +17110,7 @@ "isExactName": false }, { - "$id": "1015", + "$id": "1033", "kind": "path", "name": "day", "serializedName": "day", @@ -16833,7 +17129,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "1016", + "$id": "1034", "kind": "method", "name": "day", "serializedName": "day", @@ -16854,12 +17150,12 @@ "isExactName": false }, { - "$id": "1017", + "$id": "1035", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "260" }, "isApiVersion": false, "optional": false, @@ -16870,12 +17166,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "1018", + "$id": "1036", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "252" + "$ref": "260" }, "location": "Header", "isApiVersion": false, @@ -16897,7 +17193,7 @@ 200 ], "bodyType": { - "$ref": "586" + "$ref": "594" }, "headers": [], "isErrorResponse": false, @@ -16923,15 +17219,15 @@ }, "parameters": [ { - "$ref": "1016" + "$ref": "1034" }, { - "$ref": "1018" + "$ref": "1036" } ], "response": { "type": { - "$ref": "586" + "$ref": "594" } }, "isOverride": false, @@ -16942,12 +17238,12 @@ ], "parameters": [ { - "$id": "1019", + "$id": "1037", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1020", + "$id": "1038", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -16963,7 +17259,7 @@ "isExactName": false }, { - "$ref": "1013" + "$ref": "1031" } ], "initializedBy": 3, @@ -16974,19 +17270,19 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }, { - "$id": "1021", + "$id": "1039", "kind": "client", "name": "Notebooks", "isExactName": false, "namespace": "SampleTypeSpec", "methods": [ { - "$id": "1022", + "$id": "1040", "kind": "basic", "name": "getNotebook", "isExactName": false, @@ -16997,7 +17293,7 @@ ], "doc": "Get a notebook by name", "operation": { - "$id": "1023", + "$id": "1041", "name": "getNotebook", "isExactName": false, "resourceName": "Notebooks", @@ -17005,12 +17301,12 @@ "accessibility": "public", "parameters": [ { - "$id": "1024", + "$id": "1042", "kind": "path", "name": "notebookName", "serializedName": "notebookName", "type": { - "$id": "1025", + "$id": "1043", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17028,12 +17324,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.notebookName", "methodParameterSegments": [ { - "$id": "1026", + "$id": "1044", "kind": "method", "name": "notebook", "serializedName": "notebook", "type": { - "$id": "1027", + "$id": "1045", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -17054,12 +17350,12 @@ "isExactName": false }, { - "$id": "1028", + "$id": "1046", "kind": "header", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "254" + "$ref": "262" }, "isApiVersion": false, "optional": false, @@ -17070,12 +17366,12 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Notebooks.getNotebook.accept", "methodParameterSegments": [ { - "$id": "1029", + "$id": "1047", "kind": "method", "name": "accept", "serializedName": "Accept", "type": { - "$ref": "254" + "$ref": "262" }, "location": "Header", "isApiVersion": false, @@ -17097,7 +17393,7 @@ 200 ], "bodyType": { - "$ref": "591" + "$ref": "599" }, "headers": [], "isErrorResponse": false, @@ -17123,12 +17419,12 @@ }, "parameters": [ { - "$ref": "1029" + "$ref": "1047" } ], "response": { "type": { - "$ref": "591" + "$ref": "599" } }, "isOverride": false, @@ -17139,12 +17435,12 @@ ], "parameters": [ { - "$id": "1030", + "$id": "1048", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "1031", + "$id": "1049", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -17160,7 +17456,7 @@ "isExactName": false }, { - "$ref": "1026" + "$ref": "1044" } ], "initializedBy": 3, @@ -17171,7 +17467,7 @@ "2024-08-16-preview" ], "parent": { - "$ref": "640" + "$ref": "648" }, "isMultiServiceClient": false }