Skip to content

Commit df8e956

Browse files
authored
Merge pull request #404 from serverlessworkflow/fix-operator-options
Fixed the `OpenApiCallProcessor`to interpolate and evaluate the document endpoint URI
2 parents 1bb34a5 + bf5f885 commit df8e956

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/core/Synapse.Core/Synapse.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Copyright>Copyright © 2024-Present The Synapse Authors. All Rights Reserved.</Copyright>
1616
<RepositoryUrl>https://github.com/serverlessworkflow/synapse</RepositoryUrl>
1717
<RepositoryType>git</RepositoryType>
18-
<PackageId>Synapse</PackageId>
18+
<PackageId>Synapse.Sdk</PackageId>
1919
<PackageProjectUrl>https://github.com/serverlessworkflow/synapse</PackageProjectUrl>
2020
<PackageTags>synapse core</PackageTags>
2121
<IsPackable>true</IsPackable>

src/runner/Synapse.Runner/Services/Executors/OpenApiCallExecutor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using Microsoft.OpenApi.Readers;
1717
using Neuroglia;
1818
using Neuroglia.Data.Expressions;
19-
using Neuroglia.Data.Infrastructure.ResourceOriented;
2019
using System.Net.Mime;
2120
using System.Text;
2221

@@ -110,7 +109,9 @@ protected override async Task DoInitializeAsync(CancellationToken cancellationTo
110109
this.OpenApi = (OpenApiCallDefinition)this.JsonSerializer.Convert(this.Task.Definition.With, typeof(OpenApiCallDefinition))!;
111110
using var httpClient = this.HttpClientFactory.CreateClient();
112111
await httpClient.ConfigureAuthenticationAsync(this.Task.Workflow.Definition, this.OpenApi.Document.Endpoint.Authentication, this.ServiceProvider, cancellationToken).ConfigureAwait(false);
113-
using var request = new HttpRequestMessage(HttpMethod.Get, this.OpenApi.Document.EndpointUri);
112+
var uri = StringFormatter.NamedFormat(this.OpenApi.Document.EndpointUri.OriginalString, this.Task.Input.ToDictionary());
113+
if (uri.IsRuntimeExpression()) uri = await this.Task.Workflow.Expressions.EvaluateAsync<string>(uri, this.Task.Input, this.Task.Arguments, cancellationToken).ConfigureAwait(false);
114+
using var request = new HttpRequestMessage(HttpMethod.Get, uri);
114115
using var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
115116
if (!response.IsSuccessStatusCode)
116117
{

0 commit comments

Comments
 (0)