diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1 index 5998370d4c..f756658248 100644 --- a/packages/http-client-csharp/eng/scripts/Generate.ps1 +++ b/packages/http-client-csharp/eng/scripts/Generate.ps1 @@ -52,7 +52,6 @@ $failingSpecs = @( Join-Path 'http' 'payload' 'json-merge-patch' Join-Path 'http' 'payload' 'pageable' Join-Path 'http' 'resiliency' 'srv-driven' - Join-Path 'http' 'routes' Join-Path 'http' 'special-headers' 'conditional-request' Join-Path 'http' 'type' 'model' 'flatten' Join-Path 'http' 'type' 'model' 'templated' diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientUriBuilderDefinition.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientUriBuilderDefinition.cs index 25c9d70d54..b9ea195239 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientUriBuilderDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientUriBuilderDefinition.cs @@ -17,15 +17,47 @@ namespace Microsoft.Generator.CSharp.ClientModel.Providers { internal sealed class ClientUriBuilderDefinition : TypeProvider { - protected override TypeSignatureModifiers GetDeclarationModifiers() - { - return TypeSignatureModifiers.Internal; - } + private const string ToUriMethodName = "ToUri"; + private const string ResetMethodName = "Reset"; + private const string AppendQueryMethodName = "AppendQuery"; + private const string AppendQueryDelimitedMethodName = "AppendQueryDelimited"; + private const string AppendPathDelimitedMethodName = "AppendPathDelimited"; + private const string AppendPathMethodName = "AppendPath"; private readonly FieldProvider _uriBuilderField; private readonly FieldProvider _pathBuilderField; private readonly FieldProvider _queryBuilderField; + private PropertyProvider? _uriBuilderProperty; + private PropertyProvider UriBuilderProperty => _uriBuilderProperty ??= new( + modifiers: MethodSignatureModifiers.Private, + name: "UriBuilder", + type: typeof(UriBuilder), + body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _uriBuilderField, New.Instance(typeof(UriBuilder)))), + description: null, + enclosingType: this); + + private ValueExpression UriBuilderPath => new MemberExpression(UriBuilderProperty, "Path"); + private ValueExpression UriBuilderQuery => new MemberExpression(UriBuilderProperty, "Query"); + + private PropertyProvider? _pathBuilderProperty; + private PropertyProvider PathBuilderProperty => _pathBuilderProperty ??= new( + modifiers: MethodSignatureModifiers.Private, + name: "PathBuilder", + type: typeof(StringBuilder), + body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _pathBuilderField, New.Instance(typeof(StringBuilder), UriBuilderPath))), + description: null, + enclosingType: this); + + private PropertyProvider? _queryBuilderProperty; + private PropertyProvider QueryBuilderProperty => _queryBuilderProperty ??= new( + modifiers: MethodSignatureModifiers.Private, + name: "QueryBuilder", + type: typeof(StringBuilder), + body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _queryBuilderField, New.Instance(typeof(StringBuilder), UriBuilderQuery))), + description: null, + enclosingType: this); + public ClientUriBuilderDefinition() { _uriBuilderField = new(FieldModifiers.Private, typeof(UriBuilder), "_uriBuilder", this); @@ -33,6 +65,11 @@ public ClientUriBuilderDefinition() _queryBuilderField = new(FieldModifiers.Private, typeof(StringBuilder), "_queryBuilder", this); } + protected override TypeSignatureModifiers GetDeclarationModifiers() + { + return TypeSignatureModifiers.Internal; + } + protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "ClientUriBuilder"; @@ -42,36 +79,6 @@ protected override FieldProvider[] BuildFields() return [_uriBuilderField, _pathBuilderField, _queryBuilderField]; } - private PropertyProvider? _uriBuilderProperty; - private PropertyProvider UriBuilderProperty => _uriBuilderProperty ??= new( - modifiers: MethodSignatureModifiers.Private, - name: "UriBuilder", - type: typeof(UriBuilder), - body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _uriBuilderField, New.Instance(typeof(UriBuilder)))), - description: null, - enclosingType: this); - - internal ValueExpression UriBuilderPath => new MemberExpression(UriBuilderProperty, "Path"); - internal ValueExpression UriBuilderQuery => new MemberExpression(UriBuilderProperty, "Query"); - - private PropertyProvider? _pathBuilderProperty; - private PropertyProvider PathBuilderProperty => _pathBuilderProperty ??= new( - modifiers: MethodSignatureModifiers.Private, - name: "PathBuilder", - type: typeof(StringBuilder), - body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _pathBuilderField, New.Instance(typeof(StringBuilder), UriBuilderPath))), - description: null, - enclosingType: this); - - private PropertyProvider? _queryBuilderProperty; - private PropertyProvider QueryBuilderProperty => _queryBuilderProperty ??= new( - modifiers: MethodSignatureModifiers.Private, - name: "QueryBuilder", - type: typeof(StringBuilder), - body: new ExpressionPropertyBody(new BinaryOperatorExpression(" ??= ", _queryBuilderField, New.Instance(typeof(StringBuilder), UriBuilderQuery))), - description: null, - enclosingType: this); - protected override PropertyProvider[] BuildProperties() { return [UriBuilderProperty, PathBuilderProperty, QueryBuilderProperty]; @@ -95,23 +102,22 @@ protected override MethodProvider[] BuildMethods() { methods.Add(BuildResetMethod()); methods.AddRange(BuildAppendPathMethods()); + methods.AddRange(BuildAppendPathDelimitedMethods()); methods.AddRange(BuildAppendQueryMethods()); + methods.AddRange(BuildAppendQueryDelimitedMethods()); methods.Add(BuildToUriMethod()); } - methods.AddRange(BuildAppendQueryDelimitedMethods()); - return methods.ToArray(); } protected override CSharpType? GetBaseType() => ClientModelPlugin.Instance.TypeFactory.ClientUriBuilderBaseType; - private const string _resetMethodName = "Reset"; private MethodProvider BuildResetMethod() { var uriParameter = new ParameterProvider("uri", $"The uri.", typeof(Uri)); var signature = new MethodSignature( - Name: _resetMethodName, + Name: ResetMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: new[] { @@ -130,13 +136,12 @@ private MethodProvider BuildResetMethod() return new(signature, body, this); } - private const string _appendPathMethodName = "AppendPath"; private MethodProvider[] BuildAppendPathMethods() { var valueParameter = new ParameterProvider("value", $"The value.", typeof(string)); var escapeParameter = new ParameterProvider("escape", $"The escape", typeof(bool)); var signature = new MethodSignature( - Name: _appendPathMethodName, + Name: AppendPathMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: [valueParameter, escapeParameter], ReturnType: null, @@ -168,7 +173,6 @@ private MethodProvider[] BuildAppendPathMethods() BuildAppendPathMethod(typeof(double), true, false), BuildAppendPathMethod(typeof(int), true, false), BuildAppendPathMethod(typeof(byte[]), true, true), - BuildAppendPathMethod(typeof(IEnumerable), true, false), BuildAppendPathMethod(typeof(DateTimeOffset), true, true), BuildAppendPathMethod(typeof(TimeSpan), true, true), BuildAppendPathMethod(typeof(Guid), true, false), @@ -186,18 +190,17 @@ private MethodProvider BuildAppendPathMethod(CSharpType valueType, bool escapeDe : new[] { valueParameter, escapeParameter }; var signature = new MethodSignature( - Name: _appendPathMethodName, + Name: AppendPathMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: parameters, ReturnType: null, Description: null, ReturnDescription: null); var convertToStringExpression = TypeFormattersSnippets.ConvertToString(valueParameter, hasFormat ? (ValueExpression)formatParameter : null); - var body = new InvokeMethodExpression(null, _appendPathMethodName, [convertToStringExpression, escapeParameter]); + var body = new InvokeMethodExpression(null, AppendPathMethodName, [convertToStringExpression, escapeParameter]); return new(signature, body, this); } - private const string _appendQueryMethodName = "AppendQuery"; private MethodProvider[] BuildAppendQueryMethods() { var nameParameter = new ParameterProvider("name", $"The name.", typeof(string)); @@ -205,7 +208,7 @@ private MethodProvider[] BuildAppendQueryMethods() var escapeParameter = new ParameterProvider("escape", $"The escape.", typeof(bool)); var signature = new MethodSignature( - Name: _appendQueryMethodName, + Name: AppendQueryMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: [nameParameter, valueParameter, escapeParameter], ReturnType: null, @@ -258,38 +261,50 @@ private MethodProvider BuildAppendQueryMethod(CSharpType valueType, bool escapeD : new[] { nameParameter, valueParameter, escapeParameter }; var signature = new MethodSignature( - Name: _appendQueryMethodName, + Name: AppendQueryMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: parameters, ReturnType: null, Description: null, ReturnDescription: null); var convertToStringExpression = TypeFormattersSnippets.ConvertToString(valueParameter, hasFormat ? (ValueExpression)formatParameter : null); - var body = new InvokeMethodExpression(null, _appendQueryMethodName, [nameParameter, convertToStringExpression, escapeParameter]); + var body = new InvokeMethodExpression(null, AppendQueryMethodName, [nameParameter, convertToStringExpression, escapeParameter]); return new(signature, body, this); } private MethodProvider[] BuildAppendQueryDelimitedMethods() { - return [ BuildAppendQueryDelimitedMethod(false), BuildAppendQueryDelimitedMethod(true)]; + return + [ + BuildAppendDelimitedMethod(AppendQueryDelimitedMethodName, AppendQueryMethodName) + ]; + } + + private MethodProvider[] BuildAppendPathDelimitedMethods() + { + return + [ + BuildAppendDelimitedMethod(AppendPathDelimitedMethodName, AppendPathMethodName, false), + ]; } private readonly CSharpType _t = typeof(IEnumerable<>).GetGenericArguments()[0]; - private const string _appendQueryDelimitedMethodName = "AppendQueryDelimited"; - private MethodProvider BuildAppendQueryDelimitedMethod(bool hasFormat) + private MethodProvider BuildAppendDelimitedMethod(string appendDelimitedMethodName, string appendMethodName, bool hasName = true) { var nameParameter = new ParameterProvider("name", $"The name.", typeof(string)); - var valueParameter = new ParameterProvider("value", $"The value.", new CSharpType(typeof(IEnumerable<>), _t)); + var valueParameter = + new ParameterProvider("value", $"The value.", new CSharpType(typeof(IEnumerable<>), _t)); var delimiterParameter = new ParameterProvider("delimiter", $"The delimiter.", typeof(string)); - var formatParameter = new ParameterProvider("format", $"The format.", typeof(string)); + var formatParameter = new ParameterProvider("format", $"The format.", typeof(string), Literal(null)); var escapeParameter = new ParameterProvider("escape", $"The escape.", typeof(bool), Bool(true)); - var parameters = hasFormat + var parameters = hasName ? new[] { nameParameter, valueParameter, delimiterParameter, formatParameter, escapeParameter } - : new[] { nameParameter, valueParameter, delimiterParameter, escapeParameter }; + : new[] { valueParameter, delimiterParameter, formatParameter, escapeParameter }; + var signature = new MethodSignature( - Name: _appendQueryDelimitedMethodName, + Name: appendDelimitedMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: parameters, ReturnType: null, @@ -299,22 +314,26 @@ private MethodProvider BuildAppendQueryDelimitedMethod(bool hasFormat) var value = valueParameter.As(_t); var v = new VariableExpression(_t, "v"); - var convertToStringExpression = TypeFormattersSnippets.ConvertToString(v, hasFormat ? formatParameter : (ValueExpression?)null); + var convertToStringExpression = v.ConvertToString(formatParameter); var selector = new FuncExpression([v.Declaration], convertToStringExpression).As(); var body = new[] { + delimiterParameter.Assign(Literal(","), true).Terminate(), Declare("stringValues", value.Select(selector), out var stringValues), - new InvokeMethodExpression(null, _appendQueryMethodName, [nameParameter, StringSnippets.Join(delimiterParameter, stringValues), escapeParameter]).Terminate() - }; - + hasName ? new InvokeMethodExpression( + null, appendMethodName, + [nameParameter, StringSnippets.Join(delimiterParameter, stringValues), escapeParameter]) + .Terminate() + : new InvokeMethodExpression(null, appendMethodName, [StringSnippets.Join(delimiterParameter, stringValues), escapeParameter]) + .Terminate() + }; return new(signature, body, this); } - private const string _toUriMethodName = "ToUri"; private MethodProvider BuildToUriMethod() { var signature = new MethodSignature( - Name: _toUriMethodName, + Name: ToUriMethodName, Modifiers: MethodSignatureModifiers.Public, Parameters: Array.Empty(), ReturnType: typeof(Uri), diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs index 0879686c9c..f09fd6356b 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs @@ -250,7 +250,33 @@ private static List AppendQueryParameters(ScopedApi(), out var list), + new ForeachStatement("param", valueExpression.AsDictionary(paramType), out KeyValuePairExpression item) + { + list.Add(item.Key), + list.Add(item.Value) + }, + uri.AppendQueryDelimited(Literal(inputParameter.NameInRequest), list, format, true) + .Terminate() + }; + } + } + else if (!inputParameter.Explode) { statement = uri.AppendQueryDelimited(Literal(inputParameter.NameInRequest), valueExpression, format, true, delimiter: delimiter).Terminate(); } @@ -287,13 +313,26 @@ private static IfStatement BuildQueryParameterNullCheck( { if (parameterType?.IsCollection == true) { - var changeTrackingListDeclaration = Declare( - "changeTrackingList", - ClientModelPlugin.Instance.TypeFactory.ListInitializationType.MakeGenericType(parameterType.Arguments), - out var changeTrackingReference); + DeclarationExpression? changeTrackingCollectionDeclaration; + VariableExpression? changeTrackingReference; + if (parameterType.IsDictionary) + { + changeTrackingCollectionDeclaration = Declare( + "changeTrackingDictionary", + ClientModelPlugin.Instance.TypeFactory.DictionaryInitializationType.MakeGenericType(parameterType.Arguments), + out changeTrackingReference); + } + else + { + changeTrackingCollectionDeclaration = Declare( + "changeTrackingList", + ClientModelPlugin.Instance.TypeFactory.ListInitializationType.MakeGenericType(parameterType + .Arguments), + out changeTrackingReference); + } return new IfStatement(valueExpression.NotEqual(Null) - .And(Not(valueExpression.Is(changeTrackingListDeclaration) + .And(Not(valueExpression.Is(changeTrackingCollectionDeclaration) .And(changeTrackingReference.Property("IsUndefined"))))) { originalStatement @@ -344,13 +383,14 @@ private void AddUriSegments( CSharpType? type; string? format; ValueExpression valueExpression; + InputParameter? inputParam = null; if (isClientParameter) { GetParamInfo(paramMap[paramName], out type, out format, out valueExpression); } else { - var inputParam = inputParamHash[paramName]; + inputParam = inputParamHash[paramName]; if (inputParam.Location == RequestLocation.Path || inputParam.Location == RequestLocation.Uri) { GetParamInfo(paramMap, operation, inputParam, out type, out format, out valueExpression); @@ -361,8 +401,19 @@ private void AddUriSegments( } } ValueExpression[] toStringParams = format is null ? [] : [Literal(format)]; - valueExpression = type?.Equals(typeof(string)) == true ? valueExpression : valueExpression.Invoke(nameof(ToString), toStringParams); - statements.Add(uri.AppendPath(valueExpression, true).Terminate()); + bool escape = !inputParam?.SkipUrlEncoding ?? true; + if (type?.OutputType.IsCollection == true) + { + statements.Add(uri.AppendPathDelimited( + valueExpression, format, escape, inputParam?.ArraySerializationDelimiter).Terminate()); + } + else + { + valueExpression = type?.Equals(typeof(string)) == true + ? valueExpression + : valueExpression.Invoke(nameof(ToString), toStringParams); + statements.Add(uri.AppendPath(valueExpression, escape).Terminate()); + } pathSpan = pathSpan.Slice(paramEndIndex + 1); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/ClientUriBuilderSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/ClientUriBuilderSnippets.cs index f8a56187f7..844745126f 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/ClientUriBuilderSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/ClientUriBuilderSnippets.cs @@ -14,16 +14,19 @@ internal static class ClientUriBuilderSnippets public static InvokeMethodExpression Reset(this ScopedApi uriBuilder, ValueExpression baseUri) => uriBuilder.Invoke("Reset", baseUri); - public static InvokeMethodExpression AppendPath(this ScopedApi uriBuilder, ValueExpression path, bool shouldEscape) + public static InvokeMethodExpression AppendPath(this ScopedApi uriBuilder, ValueExpression path, bool? shouldEscape) => uriBuilder.Invoke("AppendPath", path, Literal(shouldEscape)); + public static InvokeMethodExpression AppendPathDelimited(this ScopedApi uriBuilder, ValueExpression path, string? format, bool? shouldEscape, string? delimiter = ",") + => uriBuilder.Invoke("AppendPathDelimited", [path, Literal(delimiter), Literal(format), Literal(shouldEscape)]); + public static InvokeMethodExpression AppendQuery(this ScopedApi uriBuilder, ValueExpression name, ValueExpression value, bool shouldEscape) => uriBuilder.Invoke("AppendQuery", [name, value, Literal(shouldEscape)]); public static InvokeMethodExpression AppendQuery(this ScopedApi uriBuilder, ValueExpression name, ValueExpression value, string? format, bool shouldEscape) => uriBuilder.Invoke("AppendQuery", [name, value, Literal(format), Literal(shouldEscape)]); - public static InvokeMethodExpression AppendQueryDelimited(this ScopedApi uriBuilder, ValueExpression name, ValueExpression value, string? format, bool shouldEscape, string delimiter = ",") + public static InvokeMethodExpression AppendQueryDelimited(this ScopedApi uriBuilder, ValueExpression name, ValueExpression value, string? format, bool shouldEscape, string? delimiter = ",") => uriBuilder.Invoke("AppendQueryDelimited", [name, value, Literal(delimiter), Literal(format), Literal(shouldEscape)]); public static ScopedApi ToUri(this ScopedApi uriBuilder) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientUriBuilderTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientUriBuilderTests.cs index b3ca5b3daf..b381035e58 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientUriBuilderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientUriBuilderTests.cs @@ -244,18 +244,31 @@ public void AppendPath_ByteArray(string endpoint, byte[] value, string format, b Assert.AreEqual(expected, builder.ToUri().ToString()); } - [TestCase("http://localhost", new[] { "hello", "world" }, true, "http://localhost/hello%2Cworld")] - [TestCase("http://localhost", new[] { "hello", "world" }, false, "http://localhost/hello,world")] - public void AppendPath_StringArray(string endpoint, IEnumerable value, bool escape, string expected) + [TestCase("http://localhost", new[] { "hello", "world" }, ",", true, "http://localhost/hello%2Cworld")] + [TestCase("http://localhost", new[] { "hello", "world" }, ".", false, "http://localhost/hello.world")] + public void AppendPathDelimited_StringArray(string endpoint, IEnumerable value, string delimiter, bool escape, string expected) { var builder = new ClientUriBuilder(); builder.Reset(new Uri(endpoint)); - builder.AppendPath(value, escape); + builder.AppendPathDelimited(value, delimiter, null, escape); + + Assert.AreEqual(expected, builder.ToUri().ToString()); + } + + [TestCase("http://localhost", new[] { 4, 5 }, ",", true, "http://localhost/4%2C5")] + [TestCase("http://localhost", new[] { 1, 2 }, ".", false, "http://localhost/1.2")] + public void AppendPathDelimited_IntArray(string endpoint, IEnumerable value, string delimiter, bool escape, string expected) + { + var builder = new ClientUriBuilder(); + builder.Reset(new Uri(endpoint)); + + builder.AppendPathDelimited(value, delimiter, null, escape); Assert.AreEqual(expected, builder.ToUri().ToString()); } + [TestCase("http://localhost", "6/30/1905 1:14:00 PM +00:00", "D", true, "http://localhost/1905-06-30")] [TestCase("http://localhost", "6/30/1905 1:14:00 PM +00:00", "U", true, "http://localhost/-2035622760")] [TestCase("http://localhost", "6/30/1905 1:14:00 PM +00:00", "O", true, "http://localhost/1905-06-30T13%3A14%3A00.0000000Z")] @@ -453,7 +466,7 @@ public void AppendQueryDelimited(string endpoint, IEnumerable value, str var builder = new ClientUriBuilder(); builder.Reset(new Uri(endpoint)); - builder.AppendQueryDelimited("query", value, delimiter, escape); + builder.AppendQueryDelimited("query", value, delimiter, null, escape); Assert.AreEqual(expected, builder.ToUri().ToString()); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs index 77769dfd3b..3a1b883d6f 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs @@ -287,7 +287,9 @@ public void TestBuildCreateRequestMethodWithQueryParameters() InputFactory.Parameter("p1", InputFactory.Array(InputPrimitiveType.String), location: RequestLocation.Query, isRequired: true, delimiter: "|"), InputFactory.Parameter("p2Explode", InputFactory.Array(InputPrimitiveType.Int32), location: RequestLocation.Query, isRequired: true, explode: true), InputFactory.Parameter("p2", InputFactory.Array(InputPrimitiveType.Int32), location: RequestLocation.Query, isRequired: true, delimiter: " "), - InputFactory.Parameter("optionalParam", new InputNullableType(InputPrimitiveType.String), location: RequestLocation.Query, isRequired: false, explode: false) + InputFactory.Parameter("optionalParam", new InputNullableType(InputPrimitiveType.String), location: RequestLocation.Query, isRequired: false, explode: false), + InputFactory.Parameter("p3Explode", InputFactory.Dictionary(InputPrimitiveType.Int32), location: RequestLocation.Query, isRequired: true, explode: true), + InputFactory.Parameter("p3", InputFactory.Dictionary(InputPrimitiveType.Int32), location: RequestLocation.Query, isRequired: true), ]; var operation = InputFactory.Operation( "sampleOp", diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/TestBuildCreateRequestMethodWithQueryParameters.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/TestBuildCreateRequestMethodWithQueryParameters.cs index 9c907ef9a7..02dce78f6f 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/TestBuildCreateRequestMethodWithQueryParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/TestBuildCreateRequestMethodWithQueryParameters.cs @@ -10,7 +10,7 @@ namespace Sample /// public partial class TestClient { - internal global::System.ClientModel.Primitives.PipelineMessage CreateSampleOpRequest(global::System.Collections.Generic.IEnumerable p1Explode, global::System.Collections.Generic.IEnumerable p1, global::System.Collections.Generic.IEnumerable p2Explode, global::System.Collections.Generic.IEnumerable p2, string optionalParam, global::System.ClientModel.Primitives.RequestOptions options) + internal global::System.ClientModel.Primitives.PipelineMessage CreateSampleOpRequest(global::System.Collections.Generic.IEnumerable p1Explode, global::System.Collections.Generic.IEnumerable p1, global::System.Collections.Generic.IEnumerable p2Explode, global::System.Collections.Generic.IEnumerable p2, global::System.Collections.Generic.IDictionary p3Explode, global::System.Collections.Generic.IDictionary p3, string optionalParam, global::System.ClientModel.Primitives.RequestOptions options) { global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); message.ResponseClassifier = PipelineMessageClassifier200; @@ -44,6 +44,23 @@ public partial class TestClient { uri.AppendQuery("optionalParam", optionalParam, true); } + if (((p3Explode != null) && !((p3Explode is global::Sample.ChangeTrackingDictionary changeTrackingDictionary) && changeTrackingDictionary.IsUndefined))) + { + foreach (var @param in p3Explode) + { + uri.AppendQuery(@param.Key, @param.Value, true); + } + } + if (((p3 != null) && !((p3 is global::Sample.ChangeTrackingDictionary changeTrackingDictionary0) && changeTrackingDictionary0.IsUndefined))) + { + global::System.Collections.Generic.List list = new global::System.Collections.Generic.List(); + foreach (var @param in p3) + { + list.Add(@param.Key); + list.Add(@param.Value); + } + uri.AppendQueryDelimited("p3", list, ",", null, true); + } request.Uri = uri.ToUri(); message.Apply(options); return message; diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json index 67e396d3e8..c425d7cd0a 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json @@ -115,6 +115,11 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, + "http-routes": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/routes -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, "http-serialization-encoded-name-json": { "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/serialization/encoded-name/json -p StubLibraryPlugin", "commandName": "Executable", diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/PathParameterTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/PathParameterTests.cs new file mode 100644 index 0000000000..c76b23a517 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/PathParameterTests.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using NUnit.Framework; +using Routes; + +namespace TestProjects.CadlRanch.Tests.Http.Routes +{ + public class PathParameterTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task InInterface() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetInInterfaceClient().FixedAsync(); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task Fixed() => Test(async (host) => + { + var response = await new RoutesClient(host, null).FixedAsync(); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task PathAnnotationOnly() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient().AnnotationOnlyAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task PathExplicit() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient().ExplicitAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task PathTemplateOnly() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient().TemplateOnlyAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task ReservedAnnotation() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersReservedExpansionClient() + .AnnotationAsync("foo/bar baz"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task ReservedTemplate() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersReservedExpansionClient() + .TemplateAsync("foo/bar baz"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task Explicit() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient().ExplicitAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionExplodeArray() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionExplodeClient() + .ArrayAsync(["a, b"]); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionArray() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionStandardClient() + .ArrayAsync(["a", "b"]); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionExplodePrimitive() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionExplodeClient() + .PrimitiveAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionPrimitive() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionExplodeClient() + .PrimitiveAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionExplodeRecord() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionExplodeClient() + .RecordAsync(new Dictionary {{"a", 1}, {"b", 2}}); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/Azure/cadl-ranch/issues/772")] + public Task LabelExpansionRecord() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetPathParametersClient() + .GetPathParametersLabelExpansionClient() + .GetPathParametersLabelExpansionStandardClient() + .RecordAsync(new Dictionary {{"a", 1}, {"b", 2}}); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/QueryTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/QueryTests.cs new file mode 100644 index 0000000000..dee383f112 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Routes/QueryTests.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Threading.Tasks; +using NUnit.Framework; +using Routes; + +namespace TestProjects.CadlRanch.Tests.Http.Routes +{ + public class QueryParameterTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task QueryAnnotationOnly() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient().AnnotationOnlyAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task QueryExplicit() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient().ExplicitAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task QueryTemplateOnly() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient().TemplateOnlyAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task QueryExpansionPrimitive() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionStandardClient() + .PrimitiveAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task QueryExpansionArray() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionStandardClient() + .ArrayAsync(["a", "b"]); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task QueryExpansionRecord() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionStandardClient() + .RecordAsync(new Dictionary {{"a", 1}, {"b", 2}}); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5134")] + public Task QueryExpansionExplodePrimitive() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionExplodeClient() + .PrimitiveAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5134")] + public Task QueryExpansionExplodeArray() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionExplodeClient() + .ArrayAsync(["a", "b"]); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5134")] + public Task QueryExpansionExplodeRecord() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionExplodeClient() + .RecordAsync(new Dictionary {{"a", 1}, {"b", 2}}); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5139")] + public Task QueryContinuationPrimitive() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryContinuationClient() + .GetQueryParametersQueryContinuationStandardClient() + .PrimitiveAsync("a"); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5139")] + public Task QueryContinuationArray() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryContinuationClient() + .GetQueryParametersQueryContinuationStandardClient() + .ArrayAsync(["a", "b"]); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + [Ignore("https://github.com/microsoft/typespec/issues/5139")] + public Task QueryContinuationRecord() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryContinuationClient() + .GetQueryParametersQueryContinuationStandardClient() + .RecordAsync(new Dictionary {{"a", 1}, {"b", 2}}); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/TestProjects.CadlRanch.Tests.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/TestProjects.CadlRanch.Tests.csproj index 5a90145fb4..b13eab378c 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/TestProjects.CadlRanch.Tests.csproj +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/TestProjects.CadlRanch.Tests.csproj @@ -27,4 +27,8 @@ + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Configuration.json new file mode 100644 index 0000000000..d150a971ff --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Routes", + "library-name": "Routes", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Routes.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Routes.sln new file mode 100644 index 0000000000..77342836cd --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/Routes.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Routes", "src\Routes.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs new file mode 100644 index 0000000000..f9e38a0b30 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs @@ -0,0 +1,25 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class InInterface + { + protected InInterface() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Fixed(RequestOptions options) => throw null; + + public virtual Task FixedAsync(RequestOptions options) => throw null; + + public virtual ClientResult Fixed() => throw null; + + public virtual Task FixedAsync() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs new file mode 100644 index 0000000000..5534e32b29 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs @@ -0,0 +1,51 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParameters + { + protected PathParameters() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult TemplateOnly(string @param, RequestOptions options) => throw null; + + public virtual Task TemplateOnlyAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult TemplateOnly(string @param) => throw null; + + public virtual Task TemplateOnlyAsync(string @param) => throw null; + + public virtual ClientResult Explicit(string @param, RequestOptions options) => throw null; + + public virtual Task ExplicitAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Explicit(string @param) => throw null; + + public virtual Task ExplicitAsync(string @param) => throw null; + + public virtual ClientResult AnnotationOnly(string @param, RequestOptions options) => throw null; + + public virtual Task AnnotationOnlyAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult AnnotationOnly(string @param) => throw null; + + public virtual Task AnnotationOnlyAsync(string @param) => throw null; + + public virtual PathParametersReservedExpansion GetPathParametersReservedExpansionClient() => throw null; + + public virtual PathParametersSimpleExpansion GetPathParametersSimpleExpansionClient() => throw null; + + public virtual PathParametersPathExpansion GetPathParametersPathExpansionClient() => throw null; + + public virtual PathParametersLabelExpansion GetPathParametersLabelExpansionClient() => throw null; + + public virtual PathParametersMatrixExpansion GetPathParametersMatrixExpansionClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansion.cs new file mode 100644 index 0000000000..4de4937805 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansion.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class PathParametersLabelExpansion + { + protected PathParametersLabelExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual PathParametersLabelExpansionStandard GetPathParametersLabelExpansionStandardClient() => throw null; + + public virtual PathParametersLabelExpansionExplode GetPathParametersLabelExpansionExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs new file mode 100644 index 0000000000..c9e25fb270 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersLabelExpansionExplode + { + protected PathParametersLabelExpansionExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs new file mode 100644 index 0000000000..602fdc64c6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersLabelExpansionStandard + { + protected PathParametersLabelExpansionStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansion.cs new file mode 100644 index 0000000000..edf251d39b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansion.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class PathParametersMatrixExpansion + { + protected PathParametersMatrixExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual PathParametersMatrixExpansionStandard GetPathParametersMatrixExpansionStandardClient() => throw null; + + public virtual PathParametersMatrixExpansionExplode GetPathParametersMatrixExpansionExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs new file mode 100644 index 0000000000..95fafffdf3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersMatrixExpansionExplode + { + protected PathParametersMatrixExpansionExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs new file mode 100644 index 0000000000..f25304743c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersMatrixExpansionStandard + { + protected PathParametersMatrixExpansionStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansion.cs new file mode 100644 index 0000000000..c8826f72f6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansion.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class PathParametersPathExpansion + { + protected PathParametersPathExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual PathParametersPathExpansionStandard GetPathParametersPathExpansionStandardClient() => throw null; + + public virtual PathParametersPathExpansionExplode GetPathParametersPathExpansionExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs new file mode 100644 index 0000000000..f23f791ca8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersPathExpansionExplode + { + protected PathParametersPathExpansionExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs new file mode 100644 index 0000000000..630125936b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersPathExpansionStandard + { + protected PathParametersPathExpansionStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs new file mode 100644 index 0000000000..df9e6cf61b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs @@ -0,0 +1,33 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersReservedExpansion + { + protected PathParametersReservedExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Template(string @param, RequestOptions options) => throw null; + + public virtual Task TemplateAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Template(string @param) => throw null; + + public virtual Task TemplateAsync(string @param) => throw null; + + public virtual ClientResult Annotation(string @param, RequestOptions options) => throw null; + + public virtual Task AnnotationAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Annotation(string @param) => throw null; + + public virtual Task AnnotationAsync(string @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansion.cs new file mode 100644 index 0000000000..00b73ea938 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansion.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class PathParametersSimpleExpansion + { + protected PathParametersSimpleExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual PathParametersSimpleExpansionStandard GetPathParametersSimpleExpansionStandardClient() => throw null; + + public virtual PathParametersSimpleExpansionExplode GetPathParametersSimpleExpansionExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs new file mode 100644 index 0000000000..85da5092ad --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersSimpleExpansionExplode + { + protected PathParametersSimpleExpansionExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs new file mode 100644 index 0000000000..a7d27628f8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class PathParametersSimpleExpansionStandard + { + protected PathParametersSimpleExpansionStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs new file mode 100644 index 0000000000..3e3f54fa83 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs @@ -0,0 +1,45 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class QueryParameters + { + protected QueryParameters() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult TemplateOnly(string @param, RequestOptions options) => throw null; + + public virtual Task TemplateOnlyAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult TemplateOnly(string @param) => throw null; + + public virtual Task TemplateOnlyAsync(string @param) => throw null; + + public virtual ClientResult Explicit(string @param, RequestOptions options) => throw null; + + public virtual Task ExplicitAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Explicit(string @param) => throw null; + + public virtual Task ExplicitAsync(string @param) => throw null; + + public virtual ClientResult AnnotationOnly(string @param, RequestOptions options) => throw null; + + public virtual Task AnnotationOnlyAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult AnnotationOnly(string @param) => throw null; + + public virtual Task AnnotationOnlyAsync(string @param) => throw null; + + public virtual QueryParametersQueryExpansion GetQueryParametersQueryExpansionClient() => throw null; + + public virtual QueryParametersQueryContinuation GetQueryParametersQueryContinuationClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuation.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuation.cs new file mode 100644 index 0000000000..7222c40a59 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuation.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class QueryParametersQueryContinuation + { + protected QueryParametersQueryContinuation() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual QueryParametersQueryContinuationStandard GetQueryParametersQueryContinuationStandardClient() => throw null; + + public virtual QueryParametersQueryContinuationExplode GetQueryParametersQueryContinuationExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs new file mode 100644 index 0000000000..1baaf7747b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class QueryParametersQueryContinuationExplode + { + protected QueryParametersQueryContinuationExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs new file mode 100644 index 0000000000..6df7ef5dc2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class QueryParametersQueryContinuationStandard + { + protected QueryParametersQueryContinuationStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansion.cs new file mode 100644 index 0000000000..50c31360a4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansion.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class QueryParametersQueryExpansion + { + protected QueryParametersQueryExpansion() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual QueryParametersQueryExpansionStandard GetQueryParametersQueryExpansionStandardClient() => throw null; + + public virtual QueryParametersQueryExpansionExplode GetQueryParametersQueryExpansionExplodeClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs new file mode 100644 index 0000000000..e1efb87da9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class QueryParametersQueryExpansionExplode + { + protected QueryParametersQueryExpansionExplode() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs new file mode 100644 index 0000000000..88c40e1ae0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class QueryParametersQueryExpansionStandard + { + protected QueryParametersQueryExpansionStandard() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; + + public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null; + + public virtual ClientResult Primitive(string @param) => throw null; + + public virtual Task PrimitiveAsync(string @param) => throw null; + + public virtual ClientResult Array(IEnumerable @param, RequestOptions options) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null; + + public virtual ClientResult Array(IEnumerable @param) => throw null; + + public virtual Task ArrayAsync(IEnumerable @param) => throw null; + + public virtual ClientResult Record(IDictionary @param, RequestOptions options) => throw null; + + public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null; + + public virtual ClientResult Record(IDictionary @param) => throw null; + + public virtual Task RecordAsync(IDictionary @param) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs new file mode 100644 index 0000000000..7de88f0d62 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs @@ -0,0 +1,34 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading.Tasks; + +namespace Routes +{ + public partial class RoutesClient + { + public RoutesClient() : this(new Uri("http://localhost:3000"), new RoutesClientOptions()) => throw null; + + public RoutesClient(Uri endpoint, RoutesClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Fixed(RequestOptions options) => throw null; + + public virtual Task FixedAsync(RequestOptions options) => throw null; + + public virtual ClientResult Fixed() => throw null; + + public virtual Task FixedAsync() => throw null; + + public virtual PathParameters GetPathParametersClient() => throw null; + + public virtual QueryParameters GetQueryParametersClient() => throw null; + + public virtual InInterface GetInInterfaceClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClientOptions.cs new file mode 100644 index 0000000000..f81efdb4ab --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClientOptions.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Routes +{ + public partial class RoutesClientOptions : ClientPipelineOptions + { + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Routes.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Routes.csproj new file mode 100644 index 0000000000..b169af1d05 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Routes.csproj @@ -0,0 +1,16 @@ + + + This is the Routes client library for developing .NET applications with rich experience. + SDK Code Generation Routes + 1.0.0-beta.1 + Routes + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/tspCodeModel.json new file mode 100644 index 0000000000..fd9d5fbd52 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/tspCodeModel.json @@ -0,0 +1,3453 @@ +{ + "$id": "1", + "Name": "Routes", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "RoutesClient", + "Description": "Define scenario in building the http route/uri", + "Operations": [ + { + "$id": "3", + "Name": "fixed", + "ResourceName": "Routes", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "4", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/fixed", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.fixed", + "Decorators": [] + } + ], + "Protocol": { + "$id": "5" + }, + "Parameters": [ + { + "$id": "6", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "7", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "8", + "Type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "10", + "Name": "PathParameters", + "Operations": [ + { + "$id": "11", + "Name": "templateOnly", + "ResourceName": "PathParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "12", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "14", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/template-only/{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.templateOnly", + "Decorators": [] + }, + { + "$id": "15", + "Name": "explicit", + "ResourceName": "PathParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "16", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "18", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/explicit/{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.explicit", + "Decorators": [] + }, + { + "$id": "19", + "Name": "annotationOnly", + "ResourceName": "PathParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "20", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "22", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/annotation-only/{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.annotationOnly", + "Decorators": [] + } + ], + "Protocol": { + "$id": "23" + }, + "Parent": "RoutesClient", + "Parameters": [ + { + "$id": "24", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "25", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "26", + "Type": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "28", + "Name": "PathParametersReservedExpansion", + "Operations": [ + { + "$id": "29", + "Name": "template", + "ResourceName": "ReservedExpansion", + "Accessibility": "public", + "Parameters": [ + { + "$id": "30", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": true + } + ], + "Responses": [ + { + "$id": "32", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/reserved-expansion/template/{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion.template", + "Decorators": [] + }, + { + "$id": "33", + "Name": "annotation", + "ResourceName": "ReservedExpansion", + "Accessibility": "public", + "Parameters": [ + { + "$id": "34", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": true + } + ], + "Responses": [ + { + "$id": "36", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/reserved-expansion/annotation/{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion.annotation", + "Decorators": [] + } + ], + "Protocol": { + "$id": "37" + }, + "Parent": "PathParameters", + "Parameters": [ + { + "$id": "38", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "39", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "40", + "Type": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "42", + "Name": "PathParametersSimpleExpansion", + "Operations": [], + "Protocol": { + "$id": "43" + }, + "Parent": "PathParameters", + "Parameters": [ + { + "$id": "44", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "45", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "46", + "Type": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "48", + "Name": "PathParametersSimpleExpansionStandard", + "Operations": [ + { + "$id": "49", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "50", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "52", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/standard/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.primitive", + "Decorators": [] + }, + { + "$id": "53", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "54", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "55", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "56", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "57", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/standard/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.array", + "Decorators": [] + }, + { + "$id": "58", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "59", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "60", + "kind": "dict", + "keyType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "62", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "63", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/standard/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "64" + }, + "Parent": "PathParametersSimpleExpansion", + "Parameters": [ + { + "$id": "65", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "66", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "67", + "Type": { + "$id": "68", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "69", + "Name": "PathParametersSimpleExpansionExplode", + "Operations": [ + { + "$id": "70", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "71", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "72", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "73", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/explode/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.primitive", + "Decorators": [] + }, + { + "$id": "74", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "75", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "76", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "78", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/explode/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.array", + "Decorators": [] + }, + { + "$id": "79", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "80", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "81", + "kind": "dict", + "keyType": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "83", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "84", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/simple/explode/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "85" + }, + "Parent": "PathParametersSimpleExpansion", + "Parameters": [ + { + "$id": "86", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "87", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "88", + "Type": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "90", + "Name": "PathParametersPathExpansion", + "Operations": [], + "Protocol": { + "$id": "91" + }, + "Parent": "PathParameters", + "Parameters": [ + { + "$id": "92", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "93", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "94", + "Type": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "96", + "Name": "PathParametersPathExpansionStandard", + "Operations": [ + { + "$id": "97", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "98", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "100", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/standard/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.primitive", + "Decorators": [] + }, + { + "$id": "101", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "102", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "103", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "104", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "105", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/standard/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.array", + "Decorators": [] + }, + { + "$id": "106", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "107", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "108", + "kind": "dict", + "keyType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "110", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "111", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/standard/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "112" + }, + "Parent": "PathParametersPathExpansion", + "Parameters": [ + { + "$id": "113", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "114", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "115", + "Type": { + "$id": "116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "117", + "Name": "PathParametersPathExpansionExplode", + "Operations": [ + { + "$id": "118", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "119", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "121", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/explode/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.primitive", + "Decorators": [] + }, + { + "$id": "122", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "123", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "124", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "126", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/explode/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.array", + "Decorators": [] + }, + { + "$id": "127", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "128", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "129", + "kind": "dict", + "keyType": { + "$id": "130", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "131", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "132", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/path/explode/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "133" + }, + "Parent": "PathParametersPathExpansion", + "Parameters": [ + { + "$id": "134", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "135", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "136", + "Type": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "138", + "Name": "PathParametersLabelExpansion", + "Operations": [], + "Protocol": { + "$id": "139" + }, + "Parent": "PathParameters", + "Parameters": [ + { + "$id": "140", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "141", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "142", + "Type": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "144", + "Name": "PathParametersLabelExpansionStandard", + "Operations": [ + { + "$id": "145", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "146", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "148", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/standard/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.primitive", + "Decorators": [] + }, + { + "$id": "149", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "150", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "151", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "153", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/standard/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.array", + "Decorators": [] + }, + { + "$id": "154", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "155", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "156", + "kind": "dict", + "keyType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "158", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "159", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/standard/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "160" + }, + "Parent": "PathParametersLabelExpansion", + "Parameters": [ + { + "$id": "161", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "162", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "163", + "Type": { + "$id": "164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "165", + "Name": "PathParametersLabelExpansionExplode", + "Operations": [ + { + "$id": "166", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "167", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "169", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/explode/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.primitive", + "Decorators": [] + }, + { + "$id": "170", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "171", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "172", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "174", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/explode/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.array", + "Decorators": [] + }, + { + "$id": "175", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "176", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "177", + "kind": "dict", + "keyType": { + "$id": "178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "179", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "180", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/label/explode/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "181" + }, + "Parent": "PathParametersLabelExpansion", + "Parameters": [ + { + "$id": "182", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "183", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "184", + "Type": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "186", + "Name": "PathParametersMatrixExpansion", + "Operations": [], + "Protocol": { + "$id": "187" + }, + "Parent": "PathParameters", + "Parameters": [ + { + "$id": "188", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "189", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "190", + "Type": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "192", + "Name": "PathParametersMatrixExpansionStandard", + "Operations": [ + { + "$id": "193", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "194", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "196", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/standard/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.primitive", + "Decorators": [] + }, + { + "$id": "197", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "198", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "199", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "200", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "201", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/standard/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.array", + "Decorators": [] + }, + { + "$id": "202", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "203", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "204", + "kind": "dict", + "keyType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "206", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "207", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/standard/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "208" + }, + "Parent": "PathParametersMatrixExpansion", + "Parameters": [ + { + "$id": "209", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "210", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "211", + "Type": { + "$id": "212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "213", + "Name": "PathParametersMatrixExpansionExplode", + "Operations": [ + { + "$id": "214", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "215", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "217", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/explode/primitive{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.primitive", + "Decorators": [] + }, + { + "$id": "218", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "219", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "220", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "222", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/explode/array{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.array", + "Decorators": [] + }, + { + "$id": "223", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "224", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "225", + "kind": "dict", + "keyType": { + "$id": "226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "227", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "228", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/path/matrix/explode/record{param}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "229" + }, + "Parent": "PathParametersMatrixExpansion", + "Parameters": [ + { + "$id": "230", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "231", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "232", + "Type": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "234", + "Name": "QueryParameters", + "Operations": [ + { + "$id": "235", + "Name": "templateOnly", + "ResourceName": "QueryParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "236", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "238", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/template-only", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.templateOnly", + "Decorators": [] + }, + { + "$id": "239", + "Name": "explicit", + "ResourceName": "QueryParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "240", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "242", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/explicit", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.explicit", + "Decorators": [] + }, + { + "$id": "243", + "Name": "annotationOnly", + "ResourceName": "QueryParameters", + "Accessibility": "public", + "Parameters": [ + { + "$id": "244", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "246", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/annotation-only", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.annotationOnly", + "Decorators": [] + } + ], + "Protocol": { + "$id": "247" + }, + "Parent": "RoutesClient", + "Parameters": [ + { + "$id": "248", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "249", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "250", + "Type": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "252", + "Name": "QueryParametersQueryExpansion", + "Operations": [], + "Protocol": { + "$id": "253" + }, + "Parent": "QueryParameters", + "Parameters": [ + { + "$id": "254", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "255", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "256", + "Type": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "258", + "Name": "QueryParametersQueryExpansionStandard", + "Operations": [ + { + "$id": "259", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "260", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "262", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/standard/primitive", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard.primitive", + "Decorators": [] + }, + { + "$id": "263", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "264", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "265", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "267", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/standard/array", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard.array", + "Decorators": [] + }, + { + "$id": "268", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "269", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "270", + "kind": "dict", + "keyType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "272", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "273", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/standard/record", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "274" + }, + "Parent": "QueryParametersQueryExpansion", + "Parameters": [ + { + "$id": "275", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "276", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "277", + "Type": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "279", + "Name": "QueryParametersQueryExpansionExplode", + "Operations": [ + { + "$id": "280", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "281", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "283", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/explode/primitive", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.primitive", + "Decorators": [] + }, + { + "$id": "284", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "285", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "286", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "288", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/explode/array", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.array", + "Decorators": [] + }, + { + "$id": "289", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "290", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "291", + "kind": "dict", + "keyType": { + "$id": "292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "293", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "294", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-expansion/explode/record", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "295" + }, + "Parent": "QueryParametersQueryExpansion", + "Parameters": [ + { + "$id": "296", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "297", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "298", + "Type": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "300", + "Name": "QueryParametersQueryContinuation", + "Operations": [], + "Protocol": { + "$id": "301" + }, + "Parent": "QueryParameters", + "Parameters": [ + { + "$id": "302", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "303", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "304", + "Type": { + "$id": "305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "306", + "Name": "QueryParametersQueryContinuationStandard", + "Operations": [ + { + "$id": "307", + "Name": "primitive", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "308", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "310", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/standard/primitive?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard.primitive", + "Decorators": [] + }, + { + "$id": "311", + "Name": "array", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "312", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "313", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "315", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/standard/array?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard.array", + "Decorators": [] + }, + { + "$id": "316", + "Name": "record", + "ResourceName": "Standard", + "Accessibility": "public", + "Parameters": [ + { + "$id": "317", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "318", + "kind": "dict", + "keyType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "320", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "321", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/standard/record?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "322" + }, + "Parent": "QueryParametersQueryContinuation", + "Parameters": [ + { + "$id": "323", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "324", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "325", + "Type": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "327", + "Name": "QueryParametersQueryContinuationExplode", + "Operations": [ + { + "$id": "328", + "Name": "primitive", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "329", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "330", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "331", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/explode/primitive?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode.primitive", + "Decorators": [] + }, + { + "$id": "332", + "Name": "array", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "333", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "334", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "336", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/explode/array?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode.array", + "Decorators": [] + }, + { + "$id": "337", + "Name": "record", + "ResourceName": "Explode", + "Accessibility": "public", + "Parameters": [ + { + "$id": "338", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "339", + "kind": "dict", + "keyType": { + "$id": "340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "341", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "342", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/query/query-continuation/explode/record?fixed=true", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode.record", + "Decorators": [] + } + ], + "Protocol": { + "$id": "343" + }, + "Parent": "QueryParametersQueryContinuation", + "Parameters": [ + { + "$id": "344", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "345", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "346", + "Type": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + }, + { + "$id": "348", + "Name": "InInterface", + "Operations": [ + { + "$id": "349", + "Name": "fixed", + "ResourceName": "InInterface", + "Accessibility": "public", + "Parameters": [], + "Responses": [ + { + "$id": "350", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/routes/in-interface/fixed", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Routes.InInterface.fixed", + "Decorators": [] + } + ], + "Protocol": { + "$id": "351" + }, + "Parent": "RoutesClient", + "Parameters": [ + { + "$id": "352", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "353", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "354", + "Type": { + "$id": "355", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/ClientUriBuilder.cs b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/ClientUriBuilder.cs index 4aaeb80a20..6f598e6784 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/ClientUriBuilder.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/ClientUriBuilder.cs @@ -56,8 +56,6 @@ public void AppendPath(string value, bool escape) public void AppendPath(byte[] value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); - public void AppendPath(IEnumerable value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(DateTimeOffset value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); public void AppendPath(TimeSpan value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); @@ -66,6 +64,13 @@ public void AppendPath(string value, bool escape) public void AppendPath(long value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); + public void AppendPathDelimited(IEnumerable value, string delimiter, string format = null, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + AppendPath(string.Join(delimiter, stringValues), escape); + } + public void AppendQuery(string name, string value, bool escape) { if (QueryBuilder.Length > 0) @@ -103,6 +108,13 @@ public void AppendQuery(string name, string value, bool escape) public void AppendQuery(string name, Guid value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); + public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, string format = null, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + AppendQuery(name, string.Join(delimiter, stringValues), escape); + } + public Uri ToUri() { if (_pathBuilder != null) @@ -115,17 +127,5 @@ public Uri ToUri() } return UriBuilder.Uri; } - - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, bool escape = true) - { - IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v)); - AppendQuery(name, string.Join(delimiter, stringValues), escape); - } - - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, string format, bool escape = true) - { - IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); - AppendQuery(name, string.Join(delimiter, stringValues), escape); - } } }