diff --git a/src/Microsoft.OpenApi/Expressions/CompositeExpression.cs b/src/Microsoft.OpenApi/Expressions/CompositeExpression.cs index 0bbd1ff65..cac554318 100644 --- a/src/Microsoft.OpenApi/Expressions/CompositeExpression.cs +++ b/src/Microsoft.OpenApi/Expressions/CompositeExpression.cs @@ -13,12 +13,12 @@ namespace Microsoft.OpenApi public class CompositeExpression : RuntimeExpression { private readonly string template; - private Regex expressionPattern = new(@"{(?\$[^}]*)"); + private readonly Regex expressionPattern = new(@"{(?\$[^}]*)"); /// /// Expressions embedded into string literal /// - public List ContainedExpressions = new(); + public List ContainedExpressions { get; } = new(); /// /// Create a composite expression from a string literal with an embedded expression diff --git a/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt b/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt index 40e9d307f..b1425d29e 100644 --- a/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt +++ b/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt @@ -53,8 +53,8 @@ namespace Microsoft.OpenApi } public class CompositeExpression : Microsoft.OpenApi.RuntimeExpression { - public System.Collections.Generic.List ContainedExpressions; public CompositeExpression(string expression) { } + public System.Collections.Generic.List ContainedExpressions { get; } public override string Expression { get; } } public class CurrentKeys