From a612def5db00b42ad0ab2397ffebc88366f34973 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Wed, 11 Sep 2024 14:49:08 +0200 Subject: [PATCH] fix(Runner): Fixed the way both the HttpCallProcessor and OpenApiCallProcessor evaluate endpoint URIs, by retrieving the contextual expression evaluation arguments instead of the task's Signed-off-by: Charles d'Avernas --- .../Synapse.Runner/Services/Executors/HttpCallExecutor.cs | 2 +- .../Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runner/Synapse.Runner/Services/Executors/HttpCallExecutor.cs b/src/runner/Synapse.Runner/Services/Executors/HttpCallExecutor.cs index 1a1d9ffac..9c3426adb 100644 --- a/src/runner/Synapse.Runner/Services/Executors/HttpCallExecutor.cs +++ b/src/runner/Synapse.Runner/Services/Executors/HttpCallExecutor.cs @@ -131,7 +131,7 @@ protected override async Task DoExecuteAsync(CancellationToken cancellationToken } } var uri = StringFormatter.NamedFormat(this.Http.EndpointUri.OriginalString, this.Task.Input.ToDictionary()); - if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync(uri, this.Task.Input, this.Task.Arguments, cancellationToken).ConfigureAwait(false); + if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync(uri, this.Task.Input, this.GetExpressionEvaluationArguments(), cancellationToken).ConfigureAwait(false); using var request = new HttpRequestMessage(new HttpMethod(this.Http.Method), uri) { Content = requestContent }; using var response = await this.HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); if (!response.IsSuccessStatusCode) //todo: could be configurable on HTTP call? diff --git a/src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs b/src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs index 5558a938d..e734f5d06 100644 --- a/src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs +++ b/src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs @@ -110,7 +110,7 @@ protected override async Task DoInitializeAsync(CancellationToken cancellationTo using var httpClient = this.HttpClientFactory.CreateClient(); await httpClient.ConfigureAuthenticationAsync(this.Task.Workflow.Definition, this.OpenApi.Document.Endpoint.Authentication, this.ServiceProvider, cancellationToken).ConfigureAwait(false); var uri = StringFormatter.NamedFormat(this.OpenApi.Document.EndpointUri.OriginalString, this.Task.Input.ToDictionary()); - if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync(uri, this.Task.Input, this.Task.Arguments, cancellationToken).ConfigureAwait(false); + if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync(uri, this.Task.Input, this.GetExpressionEvaluationArguments(), cancellationToken).ConfigureAwait(false); using var request = new HttpRequestMessage(HttpMethod.Get, uri); using var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); if (!response.IsSuccessStatusCode)