From 0091f1cbf5f430fe9f54cfb5e2b66279663de632 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Jul 2025 09:13:17 -0400 Subject: [PATCH] fix: switches to a getter for API consistency --- src/Microsoft.OpenApi/Expressions/CompositeExpression.cs | 4 ++-- test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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