Skip to content

Commit bb59c5f

Browse files
committed
Scaffolded the CompositeRuntime key
1 parent ce04d42 commit bb59c5f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.OpenApi.Expressions
8+
{
9+
public class CompositeExpression : RuntimeExpression
10+
{
11+
private string template;
12+
13+
public CompositeExpression(string expression)
14+
{
15+
template = expression;
16+
17+
// Extract subexpressions and convert to RuntimeExpressions
18+
19+
}
20+
21+
public override string Expression => template;
22+
}
23+
}

src/Microsoft.OpenApi/Expressions/RuntimeExpression.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public static RuntimeExpression Build(string expression)
3434
throw Error.ArgumentNullOrWhiteSpace(nameof(expression));
3535
}
3636

37+
if (expression.Contains("{$"))
38+
{
39+
return new CompositeExpression(expression);
40+
}
41+
3742
if (!expression.StartsWith(Prefix))
3843
{
3944
throw new OpenApiException(string.Format(SRResource.RuntimeExpressionMustBeginWithDollar, expression));

0 commit comments

Comments
 (0)