From 6a525ea60621c792858e6fe043693bcb11d17704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Tue, 28 Jul 2026 22:23:01 +0200 Subject: [PATCH 1/9] Implement a more legible BuildUrl --- .../Emitter.Inline.Method.cs | 9 +- .../Emitter.Inline.ParameterInfo.cs | 4 +- .../Emitter.Inline.Path.cs | 14 ++- .../Emitter.Inline.cs | 30 ++++- ...uildingTests.InlineEmissionAndFallbacks.cs | 7 +- ...ldingTests.PropertiesFormBodiesAndPaths.cs | 2 +- .../GeneratedRequestBuildingTests.cs | 12 +- .../RelativePathResolutionLiveTests.cs | 2 +- ...mitAllFiles#IGeneratedClient.g.verified.cs | 7 +- ...terfacesSmokeTest#IGitHubApi.g.verified.cs | 109 +++++++++++++++--- ...okeTest#IGitHubApiDisposable.g.verified.cs | 7 +- ...esSmokeTest#INestedGitHubApi.g.verified.cs | 62 ++++++++-- ...est#IServiceWithoutNamespace.g.verified.cs | 14 ++- ...faceTest#IContainedInterface.g.verified.cs | 7 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 7 +- ...terfaceMethod#IBaseInterface.g.verified.cs | 7 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 14 ++- ...ableTest#IGeneratedInterface.g.verified.cs | 7 +- ...paceTest#IGeneratedInterface.g.verified.cs | 7 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 7 +- ...itBaseTest#IDerivedInterface.g.verified.cs | 7 +- ...nstraint#IGeneratedInterface.g.verified.cs | 7 +- ...acesWithDifferentCasing#IApi.g.verified.cs | 7 +- ...cesWithDifferentCasing#Iapi1.g.verified.cs | 7 +- ...sWithDifferentSignature#IApi.g.verified.cs | 7 +- ...WithDifferentSignature#IApi1.g.verified.cs | 7 +- ...paceTest#IGeneratedInterface.g.verified.cs | 7 +- ...eDiagnostic#IGeneratedClient.g.verified.cs | 7 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 7 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 7 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 14 ++- ...Constraints#IGeneratedClient.g.verified.cs | 7 +- ...teParameter#IGeneratedClient.g.verified.cs | 10 +- ...teParameter#IGeneratedClient.g.verified.cs | 10 +- ...teParameter#IGeneratedClient.g.verified.cs | 10 +- ...teParameter#IGeneratedClient.g.verified.cs | 7 +- ...thAttribute#IGeneratedClient.g.verified.cs | 10 +- ...utAttribute#IGeneratedClient.g.verified.cs | 10 +- ...thAttribute#IGeneratedClient.g.verified.cs | 10 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 7 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 7 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 7 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 7 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 7 +- ...IObservable#IGeneratedClient.g.verified.cs | 8 +- ...lableObject#IGeneratedClient.g.verified.cs | 7 +- ...leValueType#IGeneratedClient.g.verified.cs | 7 +- ...eShouldWork#IGeneratedClient.g.verified.cs | 7 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 7 +- 49 files changed, 479 insertions(+), 85 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs index 9983cfe89..b35b904e2 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs @@ -34,7 +34,7 @@ internal static InlineMethodFragments BuildInlineMethodFragments( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, bodyIndent); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -110,7 +110,7 @@ internal static void AppendInlineStandardRefitMethod( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, bodyIndent); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -149,8 +149,9 @@ internal static void AppendInlineStandardRefitMethod( .Append(bodyIndent).Append("var ").Append(settingsLocal).Append(" = ").Append(settingsFieldName).AppendLine(";") .Append(prologue) .Append(bodyIndent).Append("var ").Append(requestLocal) - .Append(" = new global::System.Net.Http.HttpRequestMessage(").Append(httpMethodExpression) - .Append(", ").Append(requestUriExpression).AppendLine(");") + .Append(" = new global::System.Net.Http.HttpRequestMessage(") + .AppendLine().Append(bodyIndent).Append(httpMethodExpression) + .Append(",").AppendLine().Append(bodyIndent).Append(requestUriExpression).AppendLine(");") .Append(contentSource) .Append(headerSource); AppendInlineRequestProperties(builder, request, interfaceModel, methodModel, requestLocal, settingsLocal); diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs index 6a4a6e902..d9955fac0 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs @@ -207,12 +207,14 @@ internal static string GetParametersArg( replacements.Sort(static (left, right) => left.Start.CompareTo(right.Start)); var parametersSb = new PooledStringBuilder(); + var indent = Indent(MethodBodyIndentation + MethodBodyIndentation); + var first = true; foreach (var replacement in replacements) { if (!first) { - _ = parametersSb.Append(", "); + _ = parametersSb.AppendLine(",").Append(indent); } first = false; diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs index e5a5c6fc8..a4cd100af 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs @@ -74,9 +74,21 @@ internal static string BuildInlinePathExpression( { // A template with placeholders but no bound path parameters still runs the unmatched-placeholder // check so AllowUnmatchedRouteParameters keeps its reflection-path semantics. + var indent = Indent(MethodBodyIndentation + MethodBodyIndentation); return TryBuildInlinePathFastExpression(request, parameterInfoNames, emission) ?? (parameters.Length > 0 || request.Path.IndexOf('{') >= 0 - ? $"global::Refit.GeneratedRequestRunner.BuildRequestPath({ToCSharpStringLiteral(request.Path)}, {settingsLocal}.AllowUnmatchedRouteParameters{parameters})" + ? new PooledStringBuilder() + .AppendLine("global::Refit.GeneratedRequestRunner.BuildRequestPath(") + .Append(indent) + .Append(ToCSharpStringLiteral(request.Path)) + .AppendLine(",") + .Append(indent) + .Append(settingsLocal) + .AppendLine(".AllowUnmatchedRouteParameters") + .Append(indent) + .Append(parameters) + .Append(")") + .ToString() : ToCSharpStringLiteral(request.Path)); } diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs index 22b80f86b..add5563ba 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs @@ -586,13 +586,35 @@ internal static bool HasUrlParameter(in RequestModel request) => /// The parsed request model. /// The built path-and-query expression. /// The generated settings local name. + /// The indentation for the body. /// The generated BuildRelativeUri call. /// A [QueryUriFormat] method re-encodes the whole path and query with the attribute's UriFormat, /// matching the reflection builder's final GetComponents pass; every other method uses the direct relative URI. - internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal) => - request.QueryUriFormat is { } queryUriFormat - ? $"global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, {requestPathExpression}, {settingsLocal}.UrlResolution, (global::System.UriFormat){queryUriFormat})" - : $"global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, {requestPathExpression}, {settingsLocal}.UrlResolution)"; + internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal, string bodyIndent) + { + var buffer = new PooledStringBuilder() + .AppendLine("global::Refit.GeneratedRequestRunner.BuildRelativeUri(") + .Append(bodyIndent) + .AppendLine("this.Client,") + .Append(bodyIndent) + .Append(requestPathExpression) + .AppendLine(",") + .Append(bodyIndent) + .Append(settingsLocal) + .Append(".UrlResolution"); + if (request.QueryUriFormat is { } queryUriFormat) + { + _ = buffer + .AppendLine(",") + .Append(bodyIndent) + .Append("(global::System.UriFormat)") + .Append(queryUriFormat); + } + + return buffer + .Append(')') + .ToString(); + } /// Finds the first request parameter of the given kind. /// The request model to inspect. diff --git a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.InlineEmissionAndFallbacks.cs b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.InlineEmissionAndFallbacks.cs index 8188ea28d..815520ca0 100644 --- a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.InlineEmissionAndFallbacks.cs +++ b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.InlineEmissionAndFallbacks.cs @@ -60,7 +60,8 @@ public async Task SwitchOnGeneratesInlineForQueryUriFormat() generatedRequestBuilding: true); await Assert.That(generated).DoesNotContain(ReflectiveRequestBuilderCall); - await Assert.That(generated).Contains(".UrlResolution, (global::System.UriFormat)"); + await Assert.That(generated).Contains(".UrlResolution,"); + await Assert.That(generated).Contains("(global::System.UriFormat)"); } /// Verifies custom HTTP method attributes are discovered but fall back to the runtime builder. @@ -113,7 +114,7 @@ public interface IGeneratedClient // The custom verb is allocated once in a static field and the request references it, not a per-call allocation. await Assert.That(generated).Contains("private static readonly global::System.Net.Http.HttpMethod ______httpMethod = new global::System.Net.Http.HttpMethod(\"PURGE\");"); - await Assert.That(generated).Contains("new global::System.Net.Http.HttpRequestMessage(______httpMethod,"); + await Assert.That(generated).Contains("______httpMethod,"); } /// Verifies a custom HTTP QUERY verb attribute (a draft-standard body-carrying method) with an explicit @@ -218,7 +219,7 @@ public async Task SwitchOnRemovesWhitespaceAndEmptyQueryKeysFromInlineConstantPa GeneratedClientHintName, generatedRequestBuilding: true); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/foo?one=1&two\""); + await Assert.That(generated).Contains("\"/foo?one=1&two\""); await Assert.That(generated).DoesNotContain("drop"); await Assert.That(generated).DoesNotContain(ReflectiveRequestBuilderCall); } diff --git a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs index 735a9d437..1ebfb27e0 100644 --- a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs +++ b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs @@ -330,7 +330,7 @@ public interface IGeneratedClient var generated = result.GeneratedSources[GeneratedClientHintName]; await Assert.That(result.CompilesWithoutErrors).IsTrue(); - await Assert.That(generated).Contains("""GeneratedRequestRunner.BuildRequestPath("/a?b={bVal}", refitSettings.AllowUnmatchedRouteParameters, [((5, 11), """); + await Assert.That(generated).Contains("[((5, 11), "); } /// Verifies that auto-appended query parameters generate inline query construction. diff --git a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.cs b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.cs index 6610e0c7f..dd4b412df 100644 --- a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.cs +++ b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.cs @@ -210,7 +210,7 @@ public async Task SwitchOnStripsFragmentsFromInlineConstantPaths() GeneratedClientHintName, generatedRequestBuilding: true); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/foo?key=value\""); + await Assert.That(generated).Contains("\"/foo?key=value\","); await Assert.That(generated).DoesNotContain("#name"); await Assert.That(generated).DoesNotContain(ReflectiveRequestBuilderCall); } @@ -228,7 +228,7 @@ public async Task SwitchOnStripsQueryAfterFragmentFromInlineConstantPaths() GeneratedClientHintName, generatedRequestBuilding: true); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/foo\""); + await Assert.That(generated).Contains("\"/foo\","); await Assert.That(generated).DoesNotContain("?key=value"); await Assert.That(generated).DoesNotContain(ReflectiveRequestBuilderCall); } @@ -246,7 +246,7 @@ public async Task SwitchOnRemovesEmptyQueryKeysFromInlineConstantPaths() GeneratedClientHintName, generatedRequestBuilding: true); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/foo?key=&two=2\""); + await Assert.That(generated).Contains("\"/foo?key=&two=2\","); await Assert.That(generated).DoesNotContain("=drop"); await Assert.That(generated).DoesNotContain(ReflectiveRequestBuilderCall); } @@ -363,9 +363,9 @@ public interface IGeneratedClient GeneratedClientHintName, generatedRequestBuilding: true); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/global\""); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/alias\""); - await Assert.That(generated).Contains("BuildRelativeUri(this.Client, \"/qualified\""); + await Assert.That(generated).Contains("\"/global\","); + await Assert.That(generated).Contains("\"/alias\","); + await Assert.That(generated).Contains("\"/qualified\","); await Assert.That(generated).Contains("HttpMethod.Get"); await Assert.That(generated).Contains("HttpMethod.Post"); await Assert.That(generated).Contains("HttpMethod.Put"); diff --git a/src/tests/Refit.GeneratorTests/RelativePathResolutionLiveTests.cs b/src/tests/Refit.GeneratorTests/RelativePathResolutionLiveTests.cs index 8213a9732..e0a75edee 100644 --- a/src/tests/Refit.GeneratorTests/RelativePathResolutionLiveTests.cs +++ b/src/tests/Refit.GeneratorTests/RelativePathResolutionLiveTests.cs @@ -53,7 +53,7 @@ public async Task GeneratedInlinesNoLeadingSlashPath() { var generated = string.Concat(Fixture.RunGenerator(ApiSource, generatedRequestBuilding: true).GeneratedSources.Values); - await Assert.That(generated).Contains("BuildRequestPath(\"relative/{id}\""); + await Assert.That(generated).Contains("\"relative/{id}\","); await Assert.That(generated).DoesNotContain("BuildRestResultFuncForMethod(\"Relative\""); } diff --git a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs index 6f0be4fca..77c5f38ed 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs index 50e9db9ff..04d136449 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs @@ -50,7 +50,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -73,7 +81,13 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); @@ -98,7 +112,13 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{userName}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); @@ -121,7 +141,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/orgs/{orgname}/members", refitSettings.AllowUnmatchedRouteParameters, [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters + , [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -147,7 +175,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { refitQueryBuilder.AddPreEscapedKey("q", refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)), false); } - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, refitQueryBuilder.Build(), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -167,7 +200,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R public global::System.Threading.Tasks.Task GetIndex() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -189,7 +227,10 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); @@ -211,7 +252,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R public global::System.Threading.Tasks.Task NothingToSeeHere() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/give-me-some-404-action", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); @@ -231,7 +277,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R public global::System.Threading.Tasks.Task> NothingToSeeHereWithMetadata() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/give-me-some-404-action", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHereWithMetadata"); @@ -252,7 +303,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserWithMetadata"); @@ -275,7 +334,13 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservableWithMetadata"); @@ -300,7 +365,13 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserIApiResponseObservableWithMetadata"); @@ -322,7 +393,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R public global::System.Threading.Tasks.Task CreateUser(global::Refit.Tests.User @user) { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, @@ -347,7 +423,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R public global::System.Threading.Tasks.Task> CreateUserWithMetadata(global::Refit.Tests.User @user) { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs index 04200b8e3..25c96f764 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs @@ -49,7 +49,12 @@ public RefitTestsIGitHubApiDisposable(global::System.Net.Http.HttpClient client, public global::System.Threading.Tasks.Task RefitMethod() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "whatever", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "whatever", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApiDisposable)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "RefitMethod"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "whatever"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs index 10c89e3c7..c3f234cb6 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs @@ -50,7 +50,15 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -73,7 +81,13 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{username}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); @@ -98,7 +112,13 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{userName}", refitSettings.AllowUnmatchedRouteParameters, [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); @@ -121,7 +141,15 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/orgs/{orgname}/members", refitSettings.AllowUnmatchedRouteParameters, [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters + , [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -147,7 +175,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { refitQueryBuilder.AddPreEscapedKey("q", refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)), false); } - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, refitQueryBuilder.Build(), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -167,7 +200,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c public global::System.Threading.Tasks.Task GetIndex() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -189,7 +227,10 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); @@ -211,7 +252,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c public global::System.Threading.Tasks.Task NothingToSeeHere() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/give-me-some-404-action", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs index a2e82e4e1..c2fab7738 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs @@ -49,7 +49,12 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa public global::System.Threading.Tasks.Task GetRoot() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); @@ -66,7 +71,12 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa public global::System.Threading.Tasks.Task PostRoot() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "PostRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs index 2bc36f0d4..3f8433f52 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestContainerTypeIContainedInterface(global::System.Net.Htt public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.ContainerType.IContainedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index 58833807c..f09b4cc19 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs index 9134f1dd6..a2cd49078 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien public global::System.Threading.Tasks.Task GetPosts() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/posts", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index ea3cd4b33..1e5488c80 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -68,7 +73,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient global::System.Threading.Tasks.Task global::RefitGeneratorTest.IBaseInterface.GetPosts() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/posts", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs index be6abb162..3705a1d4b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs index f59adb6d9..2a4c1186a 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index 1b80667bc..4106fdff1 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs index b2872ba8e..95e19da41 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIDerivedInterface(global::System.Net.Http.HttpClient cl global::System.Threading.Tasks.Task global::RefitGeneratorTest.IBaseInterface.Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IDerivedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs index c76f6da31..406e2142f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs @@ -59,7 +59,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs index b8a6f89ec..2bfc193b4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs index 09a085e6d..0dda4795b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIapi(global::System.Net.Http.HttpClient client, global: public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.Iapi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs index b8a6f89ec..2bfc193b4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs index c53f2461f..138a9b190 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs @@ -50,7 +50,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs index e5cd24413..d8737afa6 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public NestedRefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpC public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Nested.RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs index 129b8e6ba..25b6a83ab 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs index 0cee7da74..5e5bdaaf2 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index 9134f1dd6..a2cd49078 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien public global::System.Threading.Tasks.Task GetPosts() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/posts", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs index ea3cd4b33..1e5488c80 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -68,7 +73,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient global::System.Threading.Tasks.Task global::RefitGeneratorTest.IBaseInterface.GetPosts() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/posts", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs index 150e842e1..183236b8e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs @@ -54,7 +54,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli where T5 : class, global::System.IDisposable, new() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs index e5f1b7b20..0ac397ee9 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs @@ -50,7 +50,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs index b1c9620c5..d09da9c21 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -50,7 +50,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs index 7c12731da..62a646fa0 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs @@ -50,7 +50,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs index 19a599fd8..e42e54f6d 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -50,7 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, (refitUseDefaultFormatting ? global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, (7, 13), @user) : global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + (refitUseDefaultFormatting ? global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, (7, 13), @user) : global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs index e5335e8df..db045a050 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs @@ -53,7 +53,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/todos?q={q}", refitSettings.AllowUnmatchedRouteParameters, [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters + , [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs index ed771e86a..2b3c56ee7 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs @@ -50,7 +50,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/todos?q={q}", refitSettings.AllowUnmatchedRouteParameters, [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters + , [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs index d418cd635..19c792cf3 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs @@ -53,7 +53,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/todos/{id}", refitSettings.AllowUnmatchedRouteParameters, [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos/{id}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos/{id}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs index bd877cadc..058984b63 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -50,7 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli where T : class, global::System.IDisposable, new() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs index a06867e1a..823c0a66e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -50,7 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli where T : struct { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs index 6f0be4fca..77c5f38ed 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs index eaa49f16b..b00fb6db5 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -50,7 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli where T : unmanaged { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs index a0185c1fe..a17b4f99d 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.ValueTask Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs index 38bf018d8..b5804a934 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs @@ -52,7 +52,13 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters + , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs index 6f0be4fca..77c5f38ed 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs index 21bc371b7..796772886 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs index 832998220..d7142252e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.ValueTask> Get() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs index f18f42301..374c92060 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs @@ -49,7 +49,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli public global::System.Threading.Tasks.Task Post() { var refitSettings = _settings; - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri(this.Client, "/users", refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Post"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); From f74fd051078a7a8ab683b47f9a234a929252c886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Thu, 30 Jul 2026 00:55:26 +0200 Subject: [PATCH 2/9] Fix other issues on Generated code --- .../Emitter.Inline.Method.cs | 10 +- .../Emitter.Inline.ParameterInfo.cs | 2 +- .../Emitter.Inline.Path.cs | 85 ++++++++---- .../Emitter.Inline.cs | 27 ++-- ...mitAllFiles#IGeneratedClient.g.verified.cs | 6 +- ...terfacesSmokeTest#IGitHubApi.g.verified.cs | 126 +++++++++--------- ...okeTest#IGitHubApiDisposable.g.verified.cs | 6 +- ...esSmokeTest#INestedGitHubApi.g.verified.cs | 72 +++++----- ...est#IServiceWithoutNamespace.g.verified.cs | 12 +- ...faceTest#IContainedInterface.g.verified.cs | 6 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 6 +- ...terfaceMethod#IBaseInterface.g.verified.cs | 6 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 12 +- ...ableTest#IGeneratedInterface.g.verified.cs | 6 +- ...paceTest#IGeneratedInterface.g.verified.cs | 6 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 6 +- ...itBaseTest#IDerivedInterface.g.verified.cs | 6 +- ...nstraint#IGeneratedInterface.g.verified.cs | 6 +- ...acesWithDifferentCasing#IApi.g.verified.cs | 6 +- ...cesWithDifferentCasing#Iapi1.g.verified.cs | 6 +- ...sWithDifferentSignature#IApi.g.verified.cs | 6 +- ...WithDifferentSignature#IApi1.g.verified.cs | 6 +- ...paceTest#IGeneratedInterface.g.verified.cs | 6 +- ...eDiagnostic#IGeneratedClient.g.verified.cs | 6 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 6 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 6 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 12 +- ...Constraints#IGeneratedClient.g.verified.cs | 6 +- ...teParameter#IGeneratedClient.g.verified.cs | 12 +- ...teParameter#IGeneratedClient.g.verified.cs | 12 +- ...teParameter#IGeneratedClient.g.verified.cs | 12 +- ...teParameter#IGeneratedClient.g.verified.cs | 15 ++- ...thAttribute#IGeneratedClient.g.verified.cs | 12 +- ...utAttribute#IGeneratedClient.g.verified.cs | 12 +- ...thAttribute#IGeneratedClient.g.verified.cs | 12 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 6 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 6 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 6 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 6 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 6 +- ...IObservable#IGeneratedClient.g.verified.cs | 12 +- ...lableObject#IGeneratedClient.g.verified.cs | 6 +- ...leValueType#IGeneratedClient.g.verified.cs | 6 +- ...eShouldWork#IGeneratedClient.g.verified.cs | 6 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 6 +- 45 files changed, 331 insertions(+), 294 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs index b35b904e2..ff9e05a0d 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs @@ -34,7 +34,7 @@ internal static InlineMethodFragments BuildInlineMethodFragments( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, bodyIndent); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -110,7 +110,7 @@ internal static void AppendInlineStandardRefitMethod( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, bodyIndent); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -149,9 +149,9 @@ internal static void AppendInlineStandardRefitMethod( .Append(bodyIndent).Append("var ").Append(settingsLocal).Append(" = ").Append(settingsFieldName).AppendLine(";") .Append(prologue) .Append(bodyIndent).Append("var ").Append(requestLocal) - .Append(" = new global::System.Net.Http.HttpRequestMessage(") - .AppendLine().Append(bodyIndent).Append(httpMethodExpression) - .Append(",").AppendLine().Append(bodyIndent).Append(requestUriExpression).AppendLine(");") + .Append(" = new global::System.Net.Http.HttpRequestMessage(").AppendLine() + .Append(bodyIndent).Append(httpMethodExpression).Append(",").AppendLine() + .Append(bodyIndent).Append(requestUriExpression).AppendLine(");") .Append(contentSource) .Append(headerSource); AppendInlineRequestProperties(builder, request, interfaceModel, methodModel, requestLocal, settingsLocal); diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs index d9955fac0..9c6393749 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs @@ -207,7 +207,7 @@ internal static string GetParametersArg( replacements.Sort(static (left, right) => left.Start.CompareTo(right.Start)); var parametersSb = new PooledStringBuilder(); - var indent = Indent(MethodBodyIndentation + MethodBodyIndentation); + var indent = Indent(MethodBodyIndentation + 1 + 1); var first = true; foreach (var replacement in replacements) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs index a4cd100af..bfef545f1 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs @@ -16,7 +16,7 @@ internal static partial class Emitter /// ReadOnlySpan overload accepts via the array-to-span conversion. The array element type is inferred from the /// tuple values rather than stated, so no nullable reference annotation is emitted into a pre-C# 8 consumer. internal static string WrapPathReplacements(string tuples, bool supportsCollectionExpressions) => - supportsCollectionExpressions ? $", [{tuples}]" : $", new[] {{ {tuples} }}"; + supportsCollectionExpressions ? $"[{tuples}]" : $"new[] {{ {tuples} }}"; /// Determines whether any path parameter passes its value through pre-encoded. /// The parsed request model. @@ -74,22 +74,32 @@ internal static string BuildInlinePathExpression( { // A template with placeholders but no bound path parameters still runs the unmatched-placeholder // check so AllowUnmatchedRouteParameters keeps its reflection-path semantics. - var indent = Indent(MethodBodyIndentation + MethodBodyIndentation); - return TryBuildInlinePathFastExpression(request, parameterInfoNames, emission) - ?? (parameters.Length > 0 || request.Path.IndexOf('{') >= 0 - ? new PooledStringBuilder() - .AppendLine("global::Refit.GeneratedRequestRunner.BuildRequestPath(") - .Append(indent) - .Append(ToCSharpStringLiteral(request.Path)) + var indent = Indent(MethodBodyIndentation + 1 + 1); + var expression = TryBuildInlinePathFastExpression(request, parameterInfoNames, emission); + if (expression is not null) + { + return expression; + } + + if (parameters.Length > 0 || request.Path.IndexOf('{') >= 0) + { + var stringBuilder = new PooledStringBuilder() + .AppendLine("global::Refit.GeneratedRequestRunner.BuildRequestPath(") + .Append(indent).Append(ToCSharpStringLiteral(request.Path)).AppendLine(",") + .Append(indent).Append(settingsLocal).Append(".AllowUnmatchedRouteParameters"); + + if (parameters.Length > 0) + { + _ = stringBuilder .AppendLine(",") .Append(indent) - .Append(settingsLocal) - .AppendLine(".AllowUnmatchedRouteParameters") - .Append(indent) - .Append(parameters) - .Append(")") - .ToString() - : ToCSharpStringLiteral(request.Path)); + .Append(parameters); + } + + return stringBuilder.Append(')').ToString(); + } + + return ToCSharpStringLiteral(request.Path); } /// Builds the allocation-free path expression for a single span-formattable path parameter, or null. @@ -134,20 +144,47 @@ internal static string BuildInlinePathExpression( var start = location.Start.GetOffset(pathLength); var end = location.End.GetOffset(pathLength); var template = ToCSharpStringLiteral(request.Path); - var settingsLocal = emission.SettingsLocal; - var allowUnmatched = $"{settingsLocal}.AllowUnmatchedRouteParameters"; + + var allowUnmatched = $"{emission.SettingsLocal}.AllowUnmatchedRouteParameters"; var valueExpression = $"@{pathParameter.Value.Name}"; _ = parameterInfoNames.TryGetValue(pathParameter.Value.Name, out var providerField); - const string runner = "global::Refit.GeneratedRequestRunner.BuildRequestPath"; - var fastExpression = valueFormat.IsUrlSafeSpanFormattable - ? $"{runner}({template}, {allowUnmatched}, ({start}, {end}), {valueExpression})" - : $"{runner}({template}, {allowUnmatched}, ({start}, {end}), {valueExpression}, {ToNullableCSharpStringLiteral(valueFormat.Format)})"; + var indentBuildRelativeUriParameter = Indent(MethodBodyIndentation + 1); + var indentBuilderBuildRequestPath = Indent(MethodBodyIndentation + 1 + 1); + var stringBuilder = new PooledStringBuilder().Append('(').AppendLine(emission.UseDefaultFormattingLocal) + .Append(indentBuildRelativeUriParameter).Append("? "); + _ = BuildCommonInlinePathFastExpression(stringBuilder, indentBuilderBuildRequestPath, template, allowUnmatched) + .Append('(').Append(start).Append(", ").Append(end).AppendLine("),") + .Append(indentBuilderBuildRequestPath).Append(valueExpression); + if (!valueFormat.IsUrlSafeSpanFormattable) + { + _ = stringBuilder + .AppendLine(",") + .Append(indentBuilderBuildRequestPath).Append(ToNullableCSharpStringLiteral(valueFormat.Format)); + } + var customTuple = $"(({start}, {end}), {EmitFormatUrlParameter(valueExpression, providerField, $"typeof({pathParameter.Value.Type})", emission)})"; - var customReplacements = WrapPathReplacements(customTuple, emission.SupportsCollectionExpressions); - var customExpression = $"{runner}({template}, {allowUnmatched}{customReplacements})"; + _ = stringBuilder + .AppendLine(")") + .Append(indentBuildRelativeUriParameter).Append(": "); + return BuildCommonInlinePathFastExpression(stringBuilder, indentBuilderBuildRequestPath, template, allowUnmatched) + .Append(WrapPathReplacements(customTuple, emission.SupportsCollectionExpressions)).Append("))").ToString(); + } - return $"({emission.UseDefaultFormattingLocal} ? {fastExpression} : {customExpression})"; + /// Writes the shared inline path-building helper call for generated request path emission. + /// The pooled string builder receiving the generated source. + /// The indentation prefix used for the helper call arguments. + /// The escaped path template literal emitted into the generated code. + /// The expression that controls whether unmatched route parameters are allowed. + /// The same pooled string builder, allowing chained emission. + internal static PooledStringBuilder BuildCommonInlinePathFastExpression(PooledStringBuilder builder, string indentBuilderBuildRequestPath, string template, string allowUnmatched) + { + const string runner = "global::Refit.GeneratedRequestRunner.BuildRequestPath"; + return builder + .Append(runner).AppendLine("(") + .Append(indentBuilderBuildRequestPath).Append(template).AppendLine(",") + .Append(indentBuilderBuildRequestPath).Append(allowUnmatched).AppendLine(",") + .Append(indentBuilderBuildRequestPath); } } diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs index add5563ba..cce2e9f93 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs @@ -586,34 +586,25 @@ internal static bool HasUrlParameter(in RequestModel request) => /// The parsed request model. /// The built path-and-query expression. /// The generated settings local name. - /// The indentation for the body. /// The generated BuildRelativeUri call. /// A [QueryUriFormat] method re-encodes the whole path and query with the attribute's UriFormat, /// matching the reflection builder's final GetComponents pass; every other method uses the direct relative URI. - internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal, string bodyIndent) + internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal) { - var buffer = new PooledStringBuilder() + var bodyAndExtraIndent = Indent(MethodBodyIndentation + 1); + var stringBuilder = new PooledStringBuilder() .AppendLine("global::Refit.GeneratedRequestRunner.BuildRelativeUri(") - .Append(bodyIndent) - .AppendLine("this.Client,") - .Append(bodyIndent) - .Append(requestPathExpression) - .AppendLine(",") - .Append(bodyIndent) - .Append(settingsLocal) - .Append(".UrlResolution"); + .Append(bodyAndExtraIndent).AppendLine("this.Client,") + .Append(bodyAndExtraIndent).Append(requestPathExpression).AppendLine(",") + .Append(bodyAndExtraIndent).Append(settingsLocal).Append(".UrlResolution"); if (request.QueryUriFormat is { } queryUriFormat) { - _ = buffer + _ = stringBuilder .AppendLine(",") - .Append(bodyIndent) - .Append("(global::System.UriFormat)") - .Append(queryUriFormat); + .Append(bodyAndExtraIndent).Append("(global::System.UriFormat)").Append(queryUriFormat); } - return buffer - .Append(')') - .ToString(); + return stringBuilder.Append(')').ToString(); } /// Finds the first request parameter of the given kind. diff --git a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs index 77c5f38ed..5e9f458a5 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs index 04d136449..8fe2e53a5 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs @@ -53,12 +53,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -82,12 +82,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); @@ -113,12 +113,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{userName}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); @@ -144,12 +144,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/orgs/{orgname}/members", - refitSettings.AllowUnmatchedRouteParameters - , [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters, + [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -178,9 +178,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - refitQueryBuilder.Build(), - refitSettings.UrlResolution)); + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -203,9 +203,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -228,9 +228,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); @@ -255,9 +255,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); @@ -280,9 +280,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHereWithMetadata"); @@ -306,12 +306,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserWithMetadata"); @@ -335,12 +335,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservableWithMetadata"); @@ -366,12 +366,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserIApiResponseObservableWithMetadata"); @@ -396,9 +396,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, @@ -426,9 +426,9 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs index 25c96f764..4374a746b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs @@ -52,9 +52,9 @@ public RefitTestsIGitHubApiDisposable(global::System.Net.Http.HttpClient client, var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "whatever", - refitSettings.UrlResolution)); + this.Client, + "whatever", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApiDisposable)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "RefitMethod"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "whatever"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs index c3f234cb6..ee8fcd817 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs @@ -53,12 +53,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -82,12 +82,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); @@ -113,12 +113,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{userName}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); @@ -144,12 +144,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/orgs/{orgname}/members", - refitSettings.AllowUnmatchedRouteParameters - , [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters, + [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -178,9 +178,9 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - refitQueryBuilder.Build(), - refitSettings.UrlResolution)); + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -203,9 +203,9 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -228,9 +228,9 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); @@ -255,9 +255,9 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs index c2fab7738..943dd0dc9 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs @@ -52,9 +52,9 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); @@ -74,9 +74,9 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + this.Client, + "/", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "PostRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs index 3f8433f52..7866355b9 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestContainerTypeIContainedInterface(global::System.Net.Htt var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.ContainerType.IContainedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index f09b4cc19..95f7a0fde 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs index a2cd49078..eaa6e2bbb 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index 1e5488c80..24dea4a57 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -76,9 +76,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs index 3705a1d4b..f32ad1c2f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs index 2a4c1186a..7e6185988 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index 4106fdff1..8f747a201 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs index 95e19da41..dd608f96b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIDerivedInterface(global::System.Net.Http.HttpClient cl var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IDerivedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs index 406e2142f..7e9fab036 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs @@ -62,9 +62,9 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs index 2bfc193b4..b855a4072 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs index 0dda4795b..60fe9217b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIapi(global::System.Net.Http.HttpClient client, global: var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.Iapi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs index 2bfc193b4..b855a4072 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs index 138a9b190..ef749c62e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs @@ -53,9 +53,9 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs index d8737afa6..03042f180 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public NestedRefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpC var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Nested.RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs index 25b6a83ab..19b40dd6d 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs index 5e5bdaaf2..222cefec2 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index a2cd49078..eaa6e2bbb 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs index 1e5488c80..24dea4a57 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -76,9 +76,9 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + this.Client, + "/posts", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs index 183236b8e..b46fd8833 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs @@ -57,9 +57,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs index 0ac397ee9..770b9b8a4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs @@ -53,12 +53,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs index d09da9c21..b763adfcc 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -53,12 +53,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs index 62a646fa0..f892dbc2f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs @@ -53,12 +53,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs index e42e54f6d..6f3be29d4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -53,9 +53,18 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - (refitUseDefaultFormatting ? global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, (7, 13), @user) : global::Refit.GeneratedRequestRunner.BuildRequestPath("/users/{user}", refitSettings.AllowUnmatchedRouteParameters, [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), - refitSettings.UrlResolution)); + this.Client, + (refitUseDefaultFormatting + ? global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + (7, 13), + @user) + : global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs index db045a050..9f7e1fd5e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs @@ -56,12 +56,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos?q={q}", - refitSettings.AllowUnmatchedRouteParameters - , [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters, + [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs index 2b3c56ee7..e3d54119f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs @@ -53,12 +53,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos?q={q}", - refitSettings.AllowUnmatchedRouteParameters - , [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters, + [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs index 19c792cf3..ecf5c4ce7 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs @@ -56,12 +56,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos/{id}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos/{id}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos/{id}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs index 058984b63..241c26134 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -53,9 +53,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs index 823c0a66e..b2a3991de 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -53,9 +53,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs index 77c5f38ed..5e9f458a5 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs index b00fb6db5..d11a83983 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -53,9 +53,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs index a17b4f99d..a3c5d1dc4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs index b5804a934..cf03b502f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs @@ -53,12 +53,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters - , [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs index 77c5f38ed..5e9f458a5 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs index 796772886..2436d599b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs index d7142252e..48a1a81ec 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs index 374c92060..61793497c 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs @@ -52,9 +52,9 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitRequest = new global::System.Net.Http.HttpRequestMessage( global::System.Net.Http.HttpMethod.Post, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + this.Client, + "/users", + refitSettings.UrlResolution)); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Post"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); From 9d5fd6b641a17f9cff8444a155acc3246d3539e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Thu, 30 Jul 2026 08:00:57 +0200 Subject: [PATCH 3/9] fix failing test --- ...eratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs index 1ebfb27e0..5e6d55252 100644 --- a/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs +++ b/src/tests/Refit.GeneratorTests/GeneratedRequestBuildingTests.PropertiesFormBodiesAndPaths.cs @@ -304,7 +304,9 @@ public interface IGeneratedClient var generated = result.GeneratedSources[GeneratedClientHintName]; await Assert.That(result.CompilesWithoutErrors).IsTrue(); - await Assert.That(generated).Contains("""GeneratedRequestRunner.BuildRequestPath("/a/{aVal}", refitSettings.AllowUnmatchedRouteParameters, [((3, 9), """); + await Assert.That(generated).Contains(""" "/a/{aVal}","""); + await Assert.That(generated).Contains("refitSettings.AllowUnmatchedRouteParameters,"); + await Assert.That(generated).Contains("[((3, 9), "); } /// Verifies that path parameters are supported by the source generator. From fd744caa29d6d4367b20175e3610e7b3651b0051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Thu, 30 Jul 2026 08:15:55 +0200 Subject: [PATCH 4/9] Avoid extra call --- src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs index ff9e05a0d..0bfaa63ad 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs @@ -149,8 +149,8 @@ internal static void AppendInlineStandardRefitMethod( .Append(bodyIndent).Append("var ").Append(settingsLocal).Append(" = ").Append(settingsFieldName).AppendLine(";") .Append(prologue) .Append(bodyIndent).Append("var ").Append(requestLocal) - .Append(" = new global::System.Net.Http.HttpRequestMessage(").AppendLine() - .Append(bodyIndent).Append(httpMethodExpression).Append(",").AppendLine() + .AppendLine(" = new global::System.Net.Http.HttpRequestMessage(") + .Append(bodyIndent).Append(httpMethodExpression).AppendLine(",") .Append(bodyIndent).Append(requestUriExpression).AppendLine(");") .Append(contentSource) .Append(headerSource); From a38b0dc60fd7c60deddbd76897918e7a80f148b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Fri, 31 Jul 2026 12:18:30 +0200 Subject: [PATCH 5/9] Fix PR Comments --- .../Emitter.Inline.Content.cs | 19 +- .../Emitter.Inline.Method.cs | 38 +-- .../Emitter.Inline.Multipart.cs | 98 +++---- .../Emitter.Inline.ParameterInfo.cs | 6 +- .../Emitter.Inline.Path.cs | 16 +- .../Emitter.Inline.RequestProperties.cs | 14 +- .../Emitter.Inline.cs | 15 +- src/InterfaceStubGenerator.Shared/Emitter.cs | 6 + ...mitAllFiles#IGeneratedClient.g.verified.cs | 11 +- ...terfacesSmokeTest#IGitHubApi.g.verified.cs | 254 ++++++++++-------- ...okeTest#IGitHubApiDisposable.g.verified.cs | 11 +- ...esSmokeTest#INestedGitHubApi.g.verified.cs | 146 +++++----- ...est#IServiceWithoutNamespace.g.verified.cs | 22 +- ...faceTest#IContainedInterface.g.verified.cs | 11 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 11 +- ...terfaceMethod#IBaseInterface.g.verified.cs | 11 +- ...ceMethod#IGeneratedInterface.g.verified.cs | 22 +- ...ableTest#IGeneratedInterface.g.verified.cs | 11 +- ...paceTest#IGeneratedInterface.g.verified.cs | 11 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 11 +- ...itBaseTest#IDerivedInterface.g.verified.cs | 11 +- ...nstraint#IGeneratedInterface.g.verified.cs | 11 +- ...acesWithDifferentCasing#IApi.g.verified.cs | 11 +- ...cesWithDifferentCasing#Iapi1.g.verified.cs | 11 +- ...sWithDifferentSignature#IApi.g.verified.cs | 11 +- ...WithDifferentSignature#IApi1.g.verified.cs | 11 +- ...paceTest#IGeneratedInterface.g.verified.cs | 11 +- ...eDiagnostic#IGeneratedClient.g.verified.cs | 11 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 11 +- ...RefitBaseTest#IBaseInterface.g.verified.cs | 11 +- ...BaseTest#IGeneratedInterface.g.verified.cs | 22 +- ...Constraints#IGeneratedClient.g.verified.cs | 11 +- ...teParameter#IGeneratedClient.g.verified.cs | 17 +- ...teParameter#IGeneratedClient.g.verified.cs | 17 +- ...teParameter#IGeneratedClient.g.verified.cs | 17 +- ...teParameter#IGeneratedClient.g.verified.cs | 29 +- ...thAttribute#IGeneratedClient.g.verified.cs | 17 +- ...utAttribute#IGeneratedClient.g.verified.cs | 17 +- ...thAttribute#IGeneratedClient.g.verified.cs | 17 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 11 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 11 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 11 +- ...tReturnTask#IGeneratedClient.g.verified.cs | 11 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 11 +- ...IObservable#IGeneratedClient.g.verified.cs | 17 +- ...e.DotNet8_0#IGeneratedClient.g.received.cs | 82 ++++++ ...lableObject#IGeneratedClient.g.verified.cs | 11 +- ...leValueType#IGeneratedClient.g.verified.cs | 11 +- ...eShouldWork#IGeneratedClient.g.verified.cs | 11 +- ...kShouldWork#IGeneratedClient.g.verified.cs | 11 +- 50 files changed, 704 insertions(+), 512 deletions(-) create mode 100644 src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Content.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Content.cs index fa4552f63..8d71a284d 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Content.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Content.cs @@ -8,29 +8,28 @@ namespace Refit.Generator; internal static partial class Emitter { /// Builds request content assignment for an inline generated method. - /// The body parameter model. - /// The generated request message local name. - /// The generated settings local name. + /// The method-scope locals and pre-built request fragments. /// The cached form field descriptor array name, or null to use the reflection path. /// Whether the consumer compilation supports nullable reference type syntax. /// The shared emission locals and helper state. - /// The method-scope unique local name builder. + /// The additional indentation for the method body. /// The generated content assignment. internal static string BuildInlineContent( - in RequestParameterModel bodyParameter, - string requestLocal, - string settingsLocal, + in InlineMethodPlan plan, string? formFieldsFieldName, bool supportsNullable, in InlineValueEmission emission, - UniqueNameBuilder locals) + int methodAdditionalIndent) { - var bodyIndent = Indent(MethodBodyIndentation); + var bodyIndent = Indent(MethodBodyIndentation + methodAdditionalIndent); + var requestLocal = plan.RequestLocal; + var settingsLocal = plan.SettingsLocal; + var bodyParameter = plan.BodyParameter!.Value; if (bodyParameter.BodySerializationMethod == "UrlEncoded") { if (IsUnrollableFormBody(bodyParameter)) { - return BuildInlineFormUnroll(bodyParameter, requestLocal, supportsNullable, emission, locals); + return BuildInlineFormUnroll(bodyParameter, requestLocal, supportsNullable, emission, plan.Locals); } return formFieldsFieldName is not null diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs index 0bfaa63ad..721fef240 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs @@ -25,16 +25,16 @@ internal static InlineMethodFragments BuildInlineMethodFragments( var settingsLocal = plan.SettingsLocal; var requestLocal = plan.RequestLocal; var emission = plan.Emission; - var bodyIndent = Indent(MethodBodyIndentation); + var innerBodyIndent = Indent(MethodBodyIndentation + 1); - var requestPrologueSource = BuildInlineRequestPrologue(request, plan, bodyIndent, out var requestPathExpression); + var requestPrologueSource = BuildInlineRequestPrologue(request, plan, innerBodyIndent, out var requestPathExpression); var (httpMethodFieldSource, httpMethodExpression) = BuildHttpMethodField(request, uniqueNames); // A [Url] method dispatches to an absolute URI (the validated [Url] value with any query appended), bypassing // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, MethodBodyIndentation + 1); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -45,19 +45,19 @@ internal static InlineMethodFragments BuildInlineMethodFragments( // parameter (a multipart method never carries one), so the two paths never both apply. var contentSource = plan.BodyParameter is null ? string.Empty - : BuildInlineContent(plan.BodyParameter.Value, requestLocal, settingsLocal, formFieldsFieldName, interfaceModel.SupportsNullable, emission, plan.Locals); + : BuildInlineContent(plan, formFieldsFieldName, interfaceModel.SupportsNullable, emission, 1); if (request.IsMultipart) { - contentSource = BuildInlineMultipartContent(request, requestLocal, settingsLocal, plan.Locals); + contentSource = BuildInlineMultipartContent(request, requestLocal, settingsLocal, plan.Locals, 1); } - var headerSource = BuildInlineHeaders(request, requestLocal, settingsLocal); - var requestPropertySource = BuildInlineRequestProperties(request, interfaceModel, methodModel, requestLocal, settingsLocal); + var headerSource = BuildInlineHeaders(request, requestLocal, settingsLocal, 1); + var requestPropertySource = BuildInlineRequestProperties(request, interfaceModel, methodModel, requestLocal, settingsLocal, 1); // A method that declares a positive [Timeout] stashes it on the request so the send helpers apply it; every // other method emits nothing here and pays no per-call timeout cost. var timeoutSource = request.TimeoutMilliseconds > 0 - ? $"{bodyIndent}global::Refit.GeneratedRequestRunner.SetRequestTimeout({requestLocal}, {request.TimeoutMilliseconds});\n" + ? $"{innerBodyIndent}global::Refit.GeneratedRequestRunner.SetRequestTimeout({requestLocal}, {request.TimeoutMilliseconds});\n" : string.Empty; var opening = BuildMethodOpening(methodModel, isExplicit, isExplicit, interfaceModel.SupportsNullable); @@ -101,6 +101,7 @@ internal static void AppendInlineStandardRefitMethod( var requestLocal = plan.RequestLocal; var bodyIndent = Indent(MethodBodyIndentation); var methodIndent = Indent(MethodMemberIndentation); + var httpRequestMessageIndent = Indent(MethodBodyIndentation + 1); var prologue = new PooledStringBuilder(); var requestPathExpression = AppendInlineRequestPrologue(prologue, request, plan, bodyIndent); @@ -110,7 +111,7 @@ internal static void AppendInlineStandardRefitMethod( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, MethodBodyIndentation); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -121,13 +122,13 @@ internal static void AppendInlineStandardRefitMethod( // parameter (a multipart method never carries one), so the two paths never both apply. var contentSource = plan.BodyParameter is null ? string.Empty - : BuildInlineContent(plan.BodyParameter.Value, requestLocal, settingsLocal, formFieldsFieldName, interfaceModel.SupportsNullable, plan.Emission, plan.Locals); + : BuildInlineContent(plan, formFieldsFieldName, interfaceModel.SupportsNullable, plan.Emission, 0); if (request.IsMultipart) { - contentSource = BuildInlineMultipartContent(request, requestLocal, settingsLocal, plan.Locals); + contentSource = BuildInlineMultipartContent(request, requestLocal, settingsLocal, plan.Locals, 0); } - var headerSource = BuildInlineHeaders(request, requestLocal, settingsLocal); + var headerSource = BuildInlineHeaders(request, requestLocal, settingsLocal, 0); // A method that declares a positive [Timeout] stashes it on the request so the send helpers apply it; every // other method emits nothing here and pays no per-call timeout cost. @@ -150,11 +151,12 @@ internal static void AppendInlineStandardRefitMethod( .Append(prologue) .Append(bodyIndent).Append("var ").Append(requestLocal) .AppendLine(" = new global::System.Net.Http.HttpRequestMessage(") - .Append(bodyIndent).Append(httpMethodExpression).AppendLine(",") - .Append(bodyIndent).Append(requestUriExpression).AppendLine(");") + .Append(httpRequestMessageIndent).Append(httpMethodExpression).AppendLine(",") + .Append(httpRequestMessageIndent).Append(requestUriExpression).AppendLine() + .Append(bodyIndent).AppendLine(");") .Append(contentSource) .Append(headerSource); - AppendInlineRequestProperties(builder, request, interfaceModel, methodModel, requestLocal, settingsLocal); + AppendInlineRequestProperties(builder, request, interfaceModel, methodModel, requestLocal, settingsLocal, 0); // The optional per-call timeout, then the send-and-deserialize statement (appended straight into the buffer, // dispatching on the return shape), then the method's closing brace. @@ -180,6 +182,7 @@ internal static void AppendInlineObservableRefitMethod( var settingsLocal = plan.SettingsLocal; var requestLocal = plan.RequestLocal; var bodyIndent = Indent(MethodBodyIndentation); + var innerBodyIndent = Indent(MethodBodyIndentation + 1); var methodIndent = Indent(MethodMemberIndentation); var prologue = fragments.RequestPrologueSource; var httpMethod = fragments.HttpMethodExpression; @@ -187,7 +190,10 @@ internal static void AppendInlineObservableRefitMethod( var methodPrefix = $"{plan.ParamInfoBuilder}{fragments.FormFieldsSource}{fragments.HttpMethodFieldSource}{fragments.Opening}{bodyIndent}var {settingsLocal} = {settingsFieldName};\n"; var requestConstruction = $$""" - {{prologue}}{{bodyIndent}}var {{requestLocal}} = new global::System.Net.Http.HttpRequestMessage({{httpMethod}}, {{uri}}); + {{prologue}}{{innerBodyIndent}}var {{requestLocal}} = new global::System.Net.Http.HttpRequestMessage( + {{innerBodyIndent}} {{httpMethod}}, + {{innerBodyIndent}} {{uri}} + {{innerBodyIndent}}); {{fragments.ContentSource}}{{fragments.HeaderSource}}{{fragments.RequestPropertySource}}{{fragments.TimeoutSource}} """; var buildRequestLocal = plan.Locals.New("BuildRefitRequest"); diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs index 25877cc08..45683a130 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs @@ -35,13 +35,15 @@ internal static partial class Emitter /// The generated settings local name. /// The method-scope unique local name builder. /// The generated multipart content statements, ending with the request-content assignment. + /// The additional indentation for the method body. internal static string BuildInlineMultipartContent( in RequestModel request, string requestLocal, string settingsLocal, - UniqueNameBuilder locals) + UniqueNameBuilder locals, + int methodAdditionalIndent) { - var bodyIndent = Indent(MethodBodyIndentation); + var bodyIndent = Indent(MethodBodyIndentation + methodAdditionalIndent); var contentLocal = locals.New("refitMultipart"); var sb = new PooledStringBuilder(); @@ -52,7 +54,7 @@ internal static string BuildInlineMultipartContent( { if (parameter is { Kind: RequestParameterKind.MultipartPart, MultipartPart: { } part }) { - AppendMultipartPart(sb, parameter, part, settingsLocal, contentLocal, locals); + AppendMultipartPart(sb, parameter, part, settingsLocal, contentLocal, locals, methodAdditionalIndent); } } @@ -69,15 +71,17 @@ internal static string BuildInlineMultipartContent( /// The generated settings local name. /// The generated multipart content local name. /// The method-scope unique local name builder. + /// The additional indentation for the method body. internal static void AppendMultipartPart( PooledStringBuilder sb, in RequestParameterModel parameter, MultipartPartModel part, string settingsLocal, string contentLocal, - UniqueNameBuilder locals) + UniqueNameBuilder locals, + int methodAdditionalIndent) { - var bodyIndent = Indent(MethodBodyIndentation); + var bodyIndent = Indent(MethodBodyIndentation + methodAdditionalIndent); var valueExpression = $"@{parameter.Name}"; // A reference-typed enumerable adds one part per element; a null collection contributes no parts, matching the @@ -150,62 +154,62 @@ internal static void AppendMultipartAddArguments( switch (part.Kind) { case MultipartPartKind.HttpContent: - { - _ = sb.Append(value).AppendLine(");"); - break; - } + { + _ = sb.Append(value).AppendLine(");"); + break; + } case MultipartPartKind.MultipartItem: - { - _ = sb.Append(value).Append(".ToContent(), ").Append(value).Append(".Name ?? ").Append(fieldName) - .Append(", string.IsNullOrEmpty(").Append(value).Append(".FileName) ? ").Append(fileName) - .Append(" : ").Append(value).AppendLine(".FileName);"); - break; - } + { + _ = sb.Append(value).Append(".ToContent(), ").Append(value).Append(".Name ?? ").Append(fieldName) + .Append(", string.IsNullOrEmpty(").Append(value).Append(".FileName) ? ").Append(fileName) + .Append(" : ").Append(value).AppendLine(".FileName);"); + break; + } case MultipartPartKind.Stream: - { - // Caller-owned stream: wrapped in non-disposing content so disposing the request never closes it. - _ = sb.Append(CreateStreamContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") - .Append(fileName).AppendLine(");"); - break; - } + { + // Caller-owned stream: wrapped in non-disposing content so disposing the request never closes it. + _ = sb.Append(CreateStreamContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") + .Append(fileName).AppendLine(");"); + break; + } case MultipartPartKind.String: - { - _ = sb.Append(StringContentNew).Append(value).Append("), ").Append(fieldName).AppendLine(");"); - break; - } + { + _ = sb.Append(StringContentNew).Append(value).Append("), ").Append(fieldName).AppendLine(");"); + break; + } case MultipartPartKind.FileInfo: - { - _ = sb.Append(StreamContentNew).Append(value).Append(".OpenRead()), ").Append(fieldName).Append(", ") - .Append(value).AppendLine(".Name);"); - break; - } + { + _ = sb.Append(StreamContentNew).Append(value).Append(".OpenRead()), ").Append(fieldName).Append(", ") + .Append(value).AppendLine(".Name);"); + break; + } case MultipartPartKind.ByteArray: - { - _ = sb.Append(ByteArrayContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") - .Append(fileName).AppendLine(");"); - break; - } + { + _ = sb.Append(ByteArrayContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") + .Append(fileName).AppendLine(");"); + break; + } case MultipartPartKind.Serialized: - { - AppendSerializedMultipartArgument(sb, settingsLocal, value, fieldName); - break; - } + { + AppendSerializedMultipartArgument(sb, settingsLocal, value, fieldName); + break; + } default: - { - // Formattable: Guid/DateTime/etc. render through the form URL-encoded formatter, exactly as the - // reflection builder's AddSerializedMultipartItem special case does. - _ = sb.Append(StringContentNew).Append(settingsLocal) - .Append(".FormUrlEncodedParameterFormatter.Format(").Append(value).Append(", null) ?? string.Empty), ") - .Append(fieldName).AppendLine(");"); - break; - } + { + // Formattable: Guid/DateTime/etc. render through the form URL-encoded formatter, exactly as the + // reflection builder's AddSerializedMultipartItem special case does. + _ = sb.Append(StringContentNew).Append(settingsLocal) + .Append(".FormUrlEncodedParameterFormatter.Format(").Append(value).Append(", null) ?? string.Empty), ") + .Append(fieldName).AppendLine(");"); + break; + } } } diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs index 9c6393749..299b951c0 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs @@ -185,11 +185,13 @@ internal static Dictionary BuildParameterInfoFields( /// The parsed request model. /// The map of parameter name to cached attribute-provider field name. /// The shared emission locals and helper state. + /// The indentation level for the method. /// The generated argument list fragment. internal static string GetParametersArg( in RequestModel request, Dictionary uniqueNameLookup, - in InlineValueEmission emission) + in InlineValueEmission emission, + int methodIndent) { // A single pre-encoded path parameter switches every replacement to the overload carrying the // per-value encoding flag, because a params call cannot mix tuple arities. @@ -207,7 +209,7 @@ internal static string GetParametersArg( replacements.Sort(static (left, right) => left.Start.CompareTo(right.Start)); var parametersSb = new PooledStringBuilder(); - var indent = Indent(MethodBodyIndentation + 1 + 1); + var indent = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); var first = true; foreach (var replacement in replacements) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs index bfef545f1..469bf1f16 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs @@ -64,18 +64,19 @@ internal static void AppendPathTuple( /// The shared emission locals and helper state. /// The generated settings local name. /// The default path builder argument fragment. + /// The indentation level for the method. /// The generated path expression. internal static string BuildInlinePathExpression( in RequestModel request, Dictionary parameterInfoNames, in InlineValueEmission emission, string settingsLocal, - string parameters) + string parameters, + int methodIndent) { // A template with placeholders but no bound path parameters still runs the unmatched-placeholder // check so AllowUnmatchedRouteParameters keeps its reflection-path semantics. - var indent = Indent(MethodBodyIndentation + 1 + 1); - var expression = TryBuildInlinePathFastExpression(request, parameterInfoNames, emission); + var expression = TryBuildInlinePathFastExpression(request, parameterInfoNames, emission, methodIndent); if (expression is not null) { return expression; @@ -83,6 +84,7 @@ internal static string BuildInlinePathExpression( if (parameters.Length > 0 || request.Path.IndexOf('{') >= 0) { + var indent = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); var stringBuilder = new PooledStringBuilder() .AppendLine("global::Refit.GeneratedRequestRunner.BuildRequestPath(") .Append(indent).Append(ToCSharpStringLiteral(request.Path)).AppendLine(",") @@ -106,13 +108,15 @@ internal static string BuildInlinePathExpression( /// The parsed request model. /// The map of parameter name to cached attribute-provider field name. /// The shared emission locals and helper state. + /// The indentation level for the method. /// The path expression using the span-formattable fast overload, or null to use the default path building. /// The default-formatting branch formats the value straight into the path buffer (net6+ integers with no /// escaping, net10+ span-escaped values); a customized IUrlParameterFormatter falls back to the string overload. internal static string? TryBuildInlinePathFastExpression( in RequestModel request, Dictionary parameterInfoNames, - in InlineValueEmission emission) + in InlineValueEmission emission, + int methodIndent) { RequestParameterModel? pathParameter = null; foreach (var parameter in request.Parameters) @@ -149,8 +153,8 @@ internal static string BuildInlinePathExpression( var valueExpression = $"@{pathParameter.Value.Name}"; _ = parameterInfoNames.TryGetValue(pathParameter.Value.Name, out var providerField); - var indentBuildRelativeUriParameter = Indent(MethodBodyIndentation + 1); - var indentBuilderBuildRequestPath = Indent(MethodBodyIndentation + 1 + 1); + var indentBuildRelativeUriParameter = Indent(HttpAdditionalBuildRelativeUriIndentation + methodIndent); + var indentBuilderBuildRequestPath = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); var stringBuilder = new PooledStringBuilder().Append('(').AppendLine(emission.UseDefaultFormattingLocal) .Append(indentBuildRelativeUriParameter).Append("? "); _ = BuildCommonInlinePathFastExpression(stringBuilder, indentBuilderBuildRequestPath, template, allowUnmatched) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs index 2c2e2dcfb..65083bd15 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs @@ -25,7 +25,8 @@ internal static partial class Emitter /// The interface model being emitted. /// The method model being emitted. /// The generated request message local name. - /// The generated settings local name. + /// The generated settings local name.The additional indentation for the method body. /// The generated request option/property statements. /// The cold-observable shape reuses this block inside a string-interpolated construction block, so it /// materializes it here; the standard shape appends it straight into the interface buffer. @@ -34,10 +35,11 @@ internal static string BuildInlineRequestProperties( InterfaceModel interfaceModel, in MethodModel methodModel, string requestLocal, - string settingsLocal) + string settingsLocal, + int methodAdditionalIndent) { var sb = new PooledStringBuilder(); - AppendInlineRequestProperties(sb, request, interfaceModel, methodModel, requestLocal, settingsLocal); + AppendInlineRequestProperties(sb, request, interfaceModel, methodModel, requestLocal, settingsLocal, methodAdditionalIndent); return sb.ToString(); } @@ -48,15 +50,17 @@ internal static string BuildInlineRequestProperties( /// The method model being emitted. /// The generated request message local name. /// The generated settings local name. + /// The additional indentation for the method body. internal static void AppendInlineRequestProperties( PooledStringBuilder sb, in RequestModel request, InterfaceModel interfaceModel, in MethodModel methodModel, string requestLocal, - string settingsLocal) + string settingsLocal, + int methodAdditionalIndent) { - var bodyIndent = Indent(MethodBodyIndentation); + var bodyIndent = Indent(MethodBodyIndentation + methodAdditionalIndent); _ = sb.Append(bodyIndent) .Append("global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(") .Append(requestLocal).Append(ArgumentSeparator).Append(settingsLocal) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs index cce2e9f93..d14f6c66a 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs @@ -141,8 +141,9 @@ internal static void BuildInlineRefitMethod( enumFormatterScope, paramInfoSb, interfaceModel.SupportsCollectionExpressions); - var parameters = GetParametersArg(request, parameterInfoNames, emission); - var pathExpression = BuildInlinePathExpression(request, parameterInfoNames, emission, settingsLocal, parameters); + var methodIntent = MethodBodyIndentation + (methodModel.ReturnTypeMetadata == ReturnTypeInfo.Observable ? 1 : 0); + var parameters = GetParametersArg(request, parameterInfoNames, emission, methodIntent); + var pathExpression = BuildInlinePathExpression(request, parameterInfoNames, emission, settingsLocal, parameters, methodIntent); var plan = new InlineMethodPlan( bodyParameter, @@ -474,13 +475,14 @@ internal static void AppendInlineSendAsyncReturn( /// The parsed request model. /// The generated request message local name. /// The generated settings local name, read for the header validation flag. + /// The additional indentation for the method body. /// The generated header statements. - internal static string BuildInlineHeaders(in RequestModel request, string requestLocal, string settingsLocal) + internal static string BuildInlineHeaders(in RequestModel request, string requestLocal, string settingsLocal, int methodAdditionalIndent) { // Append directly into a pooled buffer allocated only once a header is actually emitted; the previous // string[] + interpolated-fragment + ConcatParts shape allocated the array (and a validate-flag string) even // for the common header-less method. The emitted text is identical. - var bodyIndent = Indent(MethodBodyIndentation); + var bodyIndent = Indent(MethodBodyIndentation + methodAdditionalIndent); PooledStringBuilder? sb = null; foreach (var header in request.StaticHeaders) { @@ -586,12 +588,13 @@ internal static bool HasUrlParameter(in RequestModel request) => /// The parsed request model. /// The built path-and-query expression. /// The generated settings local name. + /// The indentation level for the method. /// The generated BuildRelativeUri call. /// A [QueryUriFormat] method re-encodes the whole path and query with the attribute's UriFormat, /// matching the reflection builder's final GetComponents pass; every other method uses the direct relative URI. - internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal) + internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal, int methodIndent) { - var bodyAndExtraIndent = Indent(MethodBodyIndentation + 1); + var bodyAndExtraIndent = Indent(HttpAdditionalBuildRelativeUriIndentation + methodIndent); var stringBuilder = new PooledStringBuilder() .AppendLine("global::Refit.GeneratedRequestRunner.BuildRelativeUri(") .Append(bodyAndExtraIndent).AppendLine("this.Client,") diff --git a/src/InterfaceStubGenerator.Shared/Emitter.cs b/src/InterfaceStubGenerator.Shared/Emitter.cs index 5e1e09b5a..01ed108c4 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.cs @@ -58,6 +58,12 @@ internal static partial class Emitter /// Indentation level for generated method constraints and statements. private const int MethodBodyIndentation = 4; + /// Indentation level for generated BuildRelativeUri relative to . + private const int HttpAdditionalBuildRelativeUriIndentation = 2; + + /// Indentation level for generated BuildRequestPath relative to . + private const int HttpAdditionalBuildRequestPathIndentation = 3; + /// The generated attribute that identifies source produced by this generator. private static readonly string GeneratedCodeAttribute = BuildGeneratedCodeAttribute(); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs index 5e9f458a5..68998032e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/GeneratedTest.ShouldEmitAllFiles#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs index 8fe2e53a5..bc5f9d71f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApi.g.verified.cs @@ -51,14 +51,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -80,19 +81,22 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -111,19 +115,22 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{userName}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{userName}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{userName}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -142,14 +149,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/orgs/{orgname}/members", - refitSettings.AllowUnmatchedRouteParameters, - [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters, + [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -176,11 +184,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R refitQueryBuilder.AddPreEscapedKey("q", refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)), false); } var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - refitQueryBuilder.Build(), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -201,11 +210,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -227,15 +237,18 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { }); } + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -253,11 +266,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); @@ -278,11 +292,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHereWithMetadata"); @@ -304,14 +319,15 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserWithMetadata"); @@ -333,19 +349,22 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservableWithMetadata"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservableWithMetadata"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable, global::Refit.Tests.User>( @@ -364,19 +383,22 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserIApiResponseObservableWithMetadata"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserIApiResponseObservableWithMetadata"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable, global::Refit.Tests.User>( @@ -394,11 +416,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Post, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, @@ -424,11 +447,12 @@ public RefitTestsIGitHubApi(global::System.Net.Http.HttpClient client, global::R { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Post, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); refitRequest.Content = global::Refit.GeneratedRequestRunner.CreateBodyContent( refitSettings, @user, diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs index 4374a746b..48587a0e3 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#IGitHubApiDisposable.g.verified.cs @@ -50,11 +50,12 @@ public RefitTestsIGitHubApiDisposable(global::System.Net.Http.HttpClient client, { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "whatever", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "whatever", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.IGitHubApiDisposable)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "RefitMethod"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "whatever"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs index ee8fcd817..de81b4a41 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.FindInterfacesSmokeTest#INestedGitHubApi.g.verified.cs @@ -51,14 +51,15 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); @@ -80,19 +81,22 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{username}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{username}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserObservable"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{username}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -111,19 +115,22 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{userName}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{userName}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{userName}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 17), refitUseDefaultFormatting ? (@userName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @userName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUserCamelCase"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{userName}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @userName }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -142,14 +149,15 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/orgs/{orgname}/members", - refitSettings.AllowUnmatchedRouteParameters, - [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/orgs/{orgname}/members", + refitSettings.AllowUnmatchedRouteParameters, + [((6, 15), refitUseDefaultFormatting ? (@orgName) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @orgName, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetOrgMembers"); @@ -176,11 +184,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c refitQueryBuilder.AddPreEscapedKey("q", refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)), false); } var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - refitQueryBuilder.Build(), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + refitQueryBuilder.Build(), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "FindUsers"); @@ -201,11 +210,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndex"); @@ -227,15 +237,18 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); - global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { }); } + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetIndexObservable"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( @@ -253,11 +266,12 @@ public RefitTestsTestNestedINestedGitHubApi(global::System.Net.Http.HttpClient c { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/give-me-some-404-action", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/give-me-some-404-action", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.SetHeader(refitRequest, "User-Agent", "Refit Integration Tests", refitSettings.ValidateHeaders); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Refit.Tests.TestNested.INestedGitHubApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "NothingToSeeHere"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs index 943dd0dc9..1bb244a7e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceStubGeneratorTests.GenerateInterfaceStubsWithoutNamespaceSmokeTest#IServiceWithoutNamespace.g.verified.cs @@ -50,11 +50,12 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); @@ -72,11 +73,12 @@ public IServiceWithoutNamespace(global::System.Net.Http.HttpClient client, globa { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Post, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IServiceWithoutNamespace)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "PostRoot"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs index 7866355b9..f4019d17f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.ContainedInterfaceTest#IContainedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestContainerTypeIContainedInterface(global::System.Net.Htt { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.ContainerType.IContainedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index 95f7a0fde..bcf755c7a 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs index eaa6e2bbb..fb1212b33 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs index 24dea4a57..f7b8bd8d9 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -74,11 +75,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs index f32ad1c2f..bba764663 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.DisposableTest#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs index 7e6185988..8cd65f93e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.GlobalNamespaceTest#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index 8f747a201..6a45b5aa4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs index dd608f96b..a81e8f1a4 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceDerivedFromRefitBaseTest#IDerivedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIDerivedInterface(global::System.Net.Http.HttpClient cl { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IDerivedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs index 7e9fab036..1e84ebe00 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfaceWithGenericConstraint#IGeneratedInterface.g.verified.cs @@ -60,11 +60,12 @@ public IGeneratedInterface(global::System.Net.Http.HttpClient client, global::Re { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs index b855a4072..dea515a66 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#IApi.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs index 60fe9217b..eff69fd41 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentCasing#Iapi1.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIapi(global::System.Net.Http.HttpClient client, global: { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.Iapi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs index b855a4072..dea515a66 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs index ef749c62e..cef02d908 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.InterfacesWithDifferentSignature#IApi1.g.verified.cs @@ -51,11 +51,12 @@ public RefitGeneratorTestIApi(global::System.Net.Http.HttpClient client, global: { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IApi)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs index 03042f180..56f43b819 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NestedNamespaceTest#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public NestedRefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpC { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::Nested.RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs index 19b40dd6d..3e446ef82 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.NonRefitMethodShouldRaiseDiagnostic#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs index 222cefec2..202528f13 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromBaseTest#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs index eaa6e2bbb..fb1212b33 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IBaseInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient clien { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IBaseInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs index 24dea4a57..f7b8bd8d9 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/InterfaceTests.RefitInterfaceDerivedFromRefitBaseTest#IGeneratedInterface.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); @@ -74,11 +75,12 @@ public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/posts", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/posts", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedInterface)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetPosts"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/posts"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs index b46fd8833..89ed0373d 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/MethodTests.MethodsWithGenericConstraints#IGeneratedClient.g.verified.cs @@ -55,11 +55,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs index 770b9b8a4..d598114f8 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableRouteParameter#IGeneratedClient.g.verified.cs @@ -51,14 +51,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs index b763adfcc..611e910f0 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.NullableValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -51,14 +51,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@user.Value, null)) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int?)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs index f892dbc2f..26ebea135 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.RouteParameter#IGeneratedClient.g.verified.cs @@ -51,14 +51,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs index 6f3be29d4..b3754e3d7 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameter#IGeneratedClient.g.verified.cs @@ -51,20 +51,21 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - (refitUseDefaultFormatting - ? global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - (7, 13), - @user) - : global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + (refitUseDefaultFormatting + ? global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + (7, 13), + @user) + : global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(int)))])), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs index 9f7e1fd5e..23679e22f 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithAttribute#IGeneratedClient.g.verified.cs @@ -54,14 +54,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos?q={q}", - refitSettings.AllowUnmatchedRouteParameters, - [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters, + [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, ______qAttributeProvider, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs index e3d54119f..88f0a18a8 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterInQueryWithoutAttribute#IGeneratedClient.g.verified.cs @@ -51,14 +51,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos?q={q}", - refitSettings.AllowUnmatchedRouteParameters, - [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos?q={q}", + refitSettings.AllowUnmatchedRouteParameters, + [((9, 12), refitUseDefaultFormatting ? (@q) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @q, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Find"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos?q={q}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs index ecf5c4ce7..ccd19365b 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ParameterTests.ValueTypeRouteParameterWithAttribute#IGeneratedClient.g.verified.cs @@ -54,14 +54,15 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/todos/{id}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/todos/{id}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 11), refitUseDefaultFormatting ? (@id == null ? null : global::Refit.GeneratedRequestRunner.FormatInvariant(@id.Value, "00")) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @id, ______idAttributeProvider, typeof(int?)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/todos/{id}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs index 241c26134..cdefc1e08 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -51,11 +51,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs index b2a3991de..49e9656f1 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericStructConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -51,11 +51,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs index 5e9f458a5..68998032e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericTaskShouldWork#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs index d11a83983..eaf7b4ef6 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericUnmanagedConstraintReturnTask#IGeneratedClient.g.verified.cs @@ -51,11 +51,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs index a3c5d1dc4..116c27890 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.GenericValueTaskShouldWork#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs index cf03b502f..67265c33e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs @@ -52,13 +52,16 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage(global::System.Net.Http.HttpMethod.Get, global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution)); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs new file mode 100644 index 000000000..5748eb66d --- /dev/null +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs @@ -0,0 +1,82 @@ +//HintName: IGeneratedClient.g.cs +// + +#nullable enable annotations +#nullable disable warnings + +namespace Refit.Implementation +{ + /// Contains generated Refit implementation types. + internal partial class GeneratedCompilation + { + /// Generated Refit implementation for global::RefitGeneratorTest.IGeneratedClient. + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::RefitInternalGenerated.Compilation.PreserveAttribute] + [global::System.Reflection.Obfuscation(Exclude=true)] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + private sealed class RefitGeneratorTestIGeneratedClient + : global::RefitGeneratorTest.IGeneratedClient + { + /// The request builder used to create Refit method delegates. + private readonly global::Refit.IRequestBuilder? _requestBuilder; + + /// The settings used by this generated Refit implementation. + private readonly global::Refit.RefitSettings _settings; + + /// Gets the HTTP client used by this generated Refit implementation. + public global::System.Net.Http.HttpClient Client { get; } + + /// Initializes a new instance of the RefitGeneratorTestIGeneratedClient class. + /// The HTTP client used by the generated implementation. + /// The request builder used to create Refit method delegates. + public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) + { + Client = client; + _requestBuilder = requestBuilder; + _settings = requestBuilder.Settings; + } + + /// Initializes a new instance of the RefitGeneratorTestIGeneratedClient class for generated-only execution. + /// The HTTP client used by the generated implementation. + /// The settings used by the generated implementation. + public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.RefitSettings settings) + { + Client = client; + _settings = settings; + } + /// + public global::System.IObservable GetUser(string @user) + { + var refitSettings = _settings; + global::System.Net.Http.HttpRequestMessage BuildRefitRequest() + { + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @user }); } + return refitRequest; + } + return global::Refit.GeneratedRequestRunner.SendObservable( + this.Client, + BuildRefitRequest, + refitSettings, + false, + false, + false, + global::System.Threading.CancellationToken.None); + } + } + } +} diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs index 5e9f458a5..68998032e 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableObject#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs index 2436d599b..7ee635223 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnNullableValueType#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs index 48a1a81ec..2a5c291f1 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ValueTaskApiResponseShouldWork#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Get"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs index 61793497c..6ae3543f6 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.VoidTaskShouldWork#IGeneratedClient.g.verified.cs @@ -50,11 +50,12 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli { var refitSettings = _settings; var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Post, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - "/users", - refitSettings.UrlResolution)); + global::System.Net.Http.HttpMethod.Post, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + "/users", + refitSettings.UrlResolution) + ); global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "Post"); global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users"); From f5ac8da5fd38beaa34479504a163a44e723c2d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Fri, 31 Jul 2026 12:25:37 +0200 Subject: [PATCH 6/9] Have the same parameter in BuildRelativeUriExpression --- src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs | 4 ++-- src/InterfaceStubGenerator.Shared/Emitter.Inline.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs index 721fef240..8acc1a780 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Method.cs @@ -34,7 +34,7 @@ internal static InlineMethodFragments BuildInlineMethodFragments( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, MethodBodyIndentation + 1); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, 1); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, @@ -111,7 +111,7 @@ internal static void AppendInlineStandardRefitMethod( // the base-address merge; every other method builds a relative URI merged onto the base address. var requestUriExpression = HasUrlParameter(request) ? $"new global::System.Uri({requestPathExpression}, global::System.UriKind.Absolute)" - : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, MethodBodyIndentation); + : BuildRelativeUriExpression(request, requestPathExpression, settingsLocal, 0); var (formFieldsSource, formFieldsFieldName) = BuildFormFieldsField( plan.BodyParameter, uniqueNames, diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs index d14f6c66a..77a835906 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs @@ -588,13 +588,13 @@ internal static bool HasUrlParameter(in RequestModel request) => /// The parsed request model. /// The built path-and-query expression. /// The generated settings local name. - /// The indentation level for the method. + /// The additional indentation for the method body. /// The generated BuildRelativeUri call. /// A [QueryUriFormat] method re-encodes the whole path and query with the attribute's UriFormat, /// matching the reflection builder's final GetComponents pass; every other method uses the direct relative URI. - internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal, int methodIndent) + internal static string BuildRelativeUriExpression(in RequestModel request, string requestPathExpression, string settingsLocal, int methodAdditionalIndent) { - var bodyAndExtraIndent = Indent(HttpAdditionalBuildRelativeUriIndentation + methodIndent); + var bodyAndExtraIndent = Indent(HttpAdditionalBuildRelativeUriIndentation + MethodBodyIndentation + methodAdditionalIndent); var stringBuilder = new PooledStringBuilder() .AppendLine("global::Refit.GeneratedRequestRunner.BuildRelativeUri(") .Append(bodyAndExtraIndent).AppendLine("this.Client,") From d7a4c103dcd04a8fc6255393d304ac3d23ad8d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Fri, 31 Jul 2026 12:30:39 +0200 Subject: [PATCH 7/9] Rest of methods with the same parameter --- .../Emitter.Inline.ParameterInfo.cs | 6 +++--- .../Emitter.Inline.Path.cs | 16 ++++++++-------- .../Emitter.Inline.cs | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs index 34b41d5a4..d3c715064 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.ParameterInfo.cs @@ -212,13 +212,13 @@ internal static Dictionary BuildParameterInfoFields( /// The parsed request model. /// The map of parameter name to cached attribute-provider field name. /// The shared emission locals and helper state. - /// The indentation level for the method. + /// The additional indentation for the method body. /// The generated argument list fragment. internal static string GetParametersArg( in RequestModel request, Dictionary uniqueNameLookup, in InlineValueEmission emission, - int methodIndent) + int methodAdditionalIndent) { // A single pre-encoded path parameter switches every replacement to the overload carrying the // per-value encoding flag, because a params call cannot mix tuple arities. @@ -236,7 +236,7 @@ internal static string GetParametersArg( replacements.Sort(static (left, right) => left.Start.CompareTo(right.Start)); var parametersSb = new PooledStringBuilder(); - var indent = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); + var indent = Indent(HttpAdditionalBuildRequestPathIndentation + MethodBodyIndentation + methodAdditionalIndent); var first = true; foreach (var replacement in replacements) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs index 469bf1f16..5fbe22155 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs @@ -64,7 +64,7 @@ internal static void AppendPathTuple( /// The shared emission locals and helper state. /// The generated settings local name. /// The default path builder argument fragment. - /// The indentation level for the method. + /// The additional indentation for the method body. /// The generated path expression. internal static string BuildInlinePathExpression( in RequestModel request, @@ -72,11 +72,11 @@ internal static string BuildInlinePathExpression( in InlineValueEmission emission, string settingsLocal, string parameters, - int methodIndent) + int methodAdditionalIndent) { // A template with placeholders but no bound path parameters still runs the unmatched-placeholder // check so AllowUnmatchedRouteParameters keeps its reflection-path semantics. - var expression = TryBuildInlinePathFastExpression(request, parameterInfoNames, emission, methodIndent); + var expression = TryBuildInlinePathFastExpression(request, parameterInfoNames, emission, methodAdditionalIndent); if (expression is not null) { return expression; @@ -84,7 +84,7 @@ internal static string BuildInlinePathExpression( if (parameters.Length > 0 || request.Path.IndexOf('{') >= 0) { - var indent = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); + var indent = Indent(HttpAdditionalBuildRequestPathIndentation + MethodBodyIndentation + methodAdditionalIndent); var stringBuilder = new PooledStringBuilder() .AppendLine("global::Refit.GeneratedRequestRunner.BuildRequestPath(") .Append(indent).Append(ToCSharpStringLiteral(request.Path)).AppendLine(",") @@ -108,7 +108,7 @@ internal static string BuildInlinePathExpression( /// The parsed request model. /// The map of parameter name to cached attribute-provider field name. /// The shared emission locals and helper state. - /// The indentation level for the method. + /// The additional indentation for the method body. /// The path expression using the span-formattable fast overload, or null to use the default path building. /// The default-formatting branch formats the value straight into the path buffer (net6+ integers with no /// escaping, net10+ span-escaped values); a customized IUrlParameterFormatter falls back to the string overload. @@ -116,7 +116,7 @@ internal static string BuildInlinePathExpression( in RequestModel request, Dictionary parameterInfoNames, in InlineValueEmission emission, - int methodIndent) + int methodAdditionalIndent) { RequestParameterModel? pathParameter = null; foreach (var parameter in request.Parameters) @@ -153,8 +153,8 @@ internal static string BuildInlinePathExpression( var valueExpression = $"@{pathParameter.Value.Name}"; _ = parameterInfoNames.TryGetValue(pathParameter.Value.Name, out var providerField); - var indentBuildRelativeUriParameter = Indent(HttpAdditionalBuildRelativeUriIndentation + methodIndent); - var indentBuilderBuildRequestPath = Indent(HttpAdditionalBuildRequestPathIndentation + methodIndent); + var indentBuildRelativeUriParameter = Indent(HttpAdditionalBuildRelativeUriIndentation + MethodBodyIndentation + methodAdditionalIndent); + var indentBuilderBuildRequestPath = Indent(HttpAdditionalBuildRequestPathIndentation + MethodBodyIndentation + methodAdditionalIndent); var stringBuilder = new PooledStringBuilder().Append('(').AppendLine(emission.UseDefaultFormattingLocal) .Append(indentBuildRelativeUriParameter).Append("? "); _ = BuildCommonInlinePathFastExpression(stringBuilder, indentBuilderBuildRequestPath, template, allowUnmatched) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs index 77a835906..2a749c1e2 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.cs @@ -141,9 +141,9 @@ internal static void BuildInlineRefitMethod( enumFormatterScope, paramInfoSb, interfaceModel.SupportsCollectionExpressions); - var methodIntent = MethodBodyIndentation + (methodModel.ReturnTypeMetadata == ReturnTypeInfo.Observable ? 1 : 0); - var parameters = GetParametersArg(request, parameterInfoNames, emission, methodIntent); - var pathExpression = BuildInlinePathExpression(request, parameterInfoNames, emission, settingsLocal, parameters, methodIntent); + var methodAdditionalIntent = methodModel.ReturnTypeMetadata == ReturnTypeInfo.Observable ? 1 : 0; + var parameters = GetParametersArg(request, parameterInfoNames, emission, methodAdditionalIntent); + var pathExpression = BuildInlinePathExpression(request, parameterInfoNames, emission, settingsLocal, parameters, methodAdditionalIntent); var plan = new InlineMethodPlan( bodyParameter, From 8085f7c6d53c1601dd55265ced39f0b2846a781b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Fri, 31 Jul 2026 12:32:08 +0200 Subject: [PATCH 8/9] Fix failing test --- ...IObservable#IGeneratedClient.g.verified.cs | 30 +++---- ...e.DotNet8_0#IGeneratedClient.g.received.cs | 82 ------------------- 2 files changed, 15 insertions(+), 97 deletions(-) delete mode 100644 src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs index 67265c33e..5298c9600 100644 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs +++ b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable#IGeneratedClient.g.verified.cs @@ -51,21 +51,21 @@ public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient cli var refitSettings = _settings; global::System.Net.Http.HttpRequestMessage BuildRefitRequest() { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution) - ); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @user }); } + var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); + var refitRequest = new global::System.Net.Http.HttpRequestMessage( + global::System.Net.Http.HttpMethod.Get, + global::Refit.GeneratedRequestRunner.BuildRelativeUri( + this.Client, + global::Refit.GeneratedRequestRunner.BuildRequestPath( + "/users/{user}", + refitSettings.AllowUnmatchedRouteParameters, + [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), + refitSettings.UrlResolution) + ); + global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); + global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); + if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @user }); } return refitRequest; } return global::Refit.GeneratedRequestRunner.SendObservable( diff --git a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs b/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs deleted file mode 100644 index 5748eb66d..000000000 --- a/src/tests/Refit.GeneratorTests/_snapshots/ReturnTypeTests.ReturnIObservable.DotNet8_0#IGeneratedClient.g.received.cs +++ /dev/null @@ -1,82 +0,0 @@ -//HintName: IGeneratedClient.g.cs -// - -#nullable enable annotations -#nullable disable warnings - -namespace Refit.Implementation -{ - /// Contains generated Refit implementation types. - internal partial class GeneratedCompilation - { - /// Generated Refit implementation for global::RefitGeneratorTest.IGeneratedClient. - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::RefitInternalGenerated.Compilation.PreserveAttribute] - [global::System.Reflection.Obfuscation(Exclude=true)] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - private sealed class RefitGeneratorTestIGeneratedClient - : global::RefitGeneratorTest.IGeneratedClient - { - /// The request builder used to create Refit method delegates. - private readonly global::Refit.IRequestBuilder? _requestBuilder; - - /// The settings used by this generated Refit implementation. - private readonly global::Refit.RefitSettings _settings; - - /// Gets the HTTP client used by this generated Refit implementation. - public global::System.Net.Http.HttpClient Client { get; } - - /// Initializes a new instance of the RefitGeneratorTestIGeneratedClient class. - /// The HTTP client used by the generated implementation. - /// The request builder used to create Refit method delegates. - public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) - { - Client = client; - _requestBuilder = requestBuilder; - _settings = requestBuilder.Settings; - } - - /// Initializes a new instance of the RefitGeneratorTestIGeneratedClient class for generated-only execution. - /// The HTTP client used by the generated implementation. - /// The settings used by the generated implementation. - public RefitGeneratorTestIGeneratedClient(global::System.Net.Http.HttpClient client, global::Refit.RefitSettings settings) - { - Client = client; - _settings = settings; - } - /// - public global::System.IObservable GetUser(string @user) - { - var refitSettings = _settings; - global::System.Net.Http.HttpRequestMessage BuildRefitRequest() - { - var refitUseDefaultFormatting = global::Refit.GeneratedRequestRunner.UsesDefaultUrlParameterFormatting(refitSettings); - var refitRequest = new global::System.Net.Http.HttpRequestMessage( - global::System.Net.Http.HttpMethod.Get, - global::Refit.GeneratedRequestRunner.BuildRelativeUri( - this.Client, - global::Refit.GeneratedRequestRunner.BuildRequestPath( - "/users/{user}", - refitSettings.AllowUnmatchedRouteParameters, - [((7, 13), refitUseDefaultFormatting ? (@user) : global::Refit.GeneratedRequestRunner.FormatUrlParameter(refitSettings, @user, global::Refit.GeneratedParameterAttributeProvider.Empty, typeof(string)))]), - refitSettings.UrlResolution) - ); - global::Refit.GeneratedRequestRunner.AddConfiguredRequestOptions(refitRequest, refitSettings, typeof(global::RefitGeneratorTest.IGeneratedClient)); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodName, "GetUser"); - global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.RelativePathTemplate, "/users/{user}"); - if (refitSettings.CaptureMethodArguments) { global::Refit.GeneratedRequestRunner.AddRequestProperty(refitRequest, global::Refit.HttpRequestMessageOptions.MethodArguments, new object?[] { @user }); } - return refitRequest; - } - return global::Refit.GeneratedRequestRunner.SendObservable( - this.Client, - BuildRefitRequest, - refitSettings, - false, - false, - false, - global::System.Threading.CancellationToken.None); - } - } - } -} From edb6c8d8fec75873cd0919084e1fecbb25138a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Garc=C3=ADa=20de=20la=20Noceda=20Arg=C3=BCelles?= Date: Fri, 31 Jul 2026 12:40:56 +0200 Subject: [PATCH 9/9] Redo indentation of methods that I did not changed and fix a XML Comment --- .../Emitter.Inline.Multipart.cs | 84 +++++++++---------- .../Emitter.Inline.RequestProperties.cs | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs index 45683a130..c11850be4 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.Multipart.cs @@ -154,62 +154,62 @@ internal static void AppendMultipartAddArguments( switch (part.Kind) { case MultipartPartKind.HttpContent: - { - _ = sb.Append(value).AppendLine(");"); - break; - } + { + _ = sb.Append(value).AppendLine(");"); + break; + } case MultipartPartKind.MultipartItem: - { - _ = sb.Append(value).Append(".ToContent(), ").Append(value).Append(".Name ?? ").Append(fieldName) - .Append(", string.IsNullOrEmpty(").Append(value).Append(".FileName) ? ").Append(fileName) - .Append(" : ").Append(value).AppendLine(".FileName);"); - break; - } + { + _ = sb.Append(value).Append(".ToContent(), ").Append(value).Append(".Name ?? ").Append(fieldName) + .Append(", string.IsNullOrEmpty(").Append(value).Append(".FileName) ? ").Append(fileName) + .Append(" : ").Append(value).AppendLine(".FileName);"); + break; + } case MultipartPartKind.Stream: - { - // Caller-owned stream: wrapped in non-disposing content so disposing the request never closes it. - _ = sb.Append(CreateStreamContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") - .Append(fileName).AppendLine(");"); - break; - } + { + // Caller-owned stream: wrapped in non-disposing content so disposing the request never closes it. + _ = sb.Append(CreateStreamContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") + .Append(fileName).AppendLine(");"); + break; + } case MultipartPartKind.String: - { - _ = sb.Append(StringContentNew).Append(value).Append("), ").Append(fieldName).AppendLine(");"); - break; - } + { + _ = sb.Append(StringContentNew).Append(value).Append("), ").Append(fieldName).AppendLine(");"); + break; + } case MultipartPartKind.FileInfo: - { - _ = sb.Append(StreamContentNew).Append(value).Append(".OpenRead()), ").Append(fieldName).Append(", ") - .Append(value).AppendLine(".Name);"); - break; - } + { + _ = sb.Append(StreamContentNew).Append(value).Append(".OpenRead()), ").Append(fieldName).Append(", ") + .Append(value).AppendLine(".Name);"); + break; + } case MultipartPartKind.ByteArray: - { - _ = sb.Append(ByteArrayContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") - .Append(fileName).AppendLine(");"); - break; - } + { + _ = sb.Append(ByteArrayContentNew).Append(value).Append("), ").Append(fieldName).Append(", ") + .Append(fileName).AppendLine(");"); + break; + } case MultipartPartKind.Serialized: - { - AppendSerializedMultipartArgument(sb, settingsLocal, value, fieldName); - break; - } + { + AppendSerializedMultipartArgument(sb, settingsLocal, value, fieldName); + break; + } default: - { - // Formattable: Guid/DateTime/etc. render through the form URL-encoded formatter, exactly as the - // reflection builder's AddSerializedMultipartItem special case does. - _ = sb.Append(StringContentNew).Append(settingsLocal) - .Append(".FormUrlEncodedParameterFormatter.Format(").Append(value).Append(", null) ?? string.Empty), ") - .Append(fieldName).AppendLine(");"); - break; - } + { + // Formattable: Guid/DateTime/etc. render through the form URL-encoded formatter, exactly as the + // reflection builder's AddSerializedMultipartItem special case does. + _ = sb.Append(StringContentNew).Append(settingsLocal) + .Append(".FormUrlEncodedParameterFormatter.Format(").Append(value).Append(", null) ?? string.Empty), ") + .Append(fieldName).AppendLine(");"); + break; + } } } diff --git a/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs b/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs index 65083bd15..dbd4fab04 100644 --- a/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs +++ b/src/InterfaceStubGenerator.Shared/Emitter.Inline.RequestProperties.cs @@ -25,7 +25,7 @@ internal static partial class Emitter /// The interface model being emitted. /// The method model being emitted. /// The generated request message local name. - /// The generated settings local name.The generated settings local name. /// The additional indentation for the method body. /// The generated request option/property statements. /// The cold-observable shape reuses this block inside a string-interpolated construction block, so it