Skip to content

Commit 0cceb23

Browse files
authored
chore: Apply code formatting rules (IDE0028, and IDE0300-IDE0304) (#10458)
chore: apply code formatter for IDE0028, and IDE0300-IDE0304
1 parent 16e2a3f commit 0cceb23

File tree

157 files changed

+516
-516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+516
-516
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ csharp_prefer_static_local_function = true:suggestion
7878
dotnet_diagnostic.IDE0010.severity = suggestion # IDE0010: Add missing cases to switch statement
7979
dotnet_style_object_initializer = true:suggestion # IDE0017: Use object initializers
8080
csharp_style_inlined_variable_declaration = true:suggestion # IDE0018: Inline variable declaration
81-
dotnet_style_collection_initializer = true:suggestion # IDE0028: Use collection initializers
81+
dotnet_style_collection_initializer = true:suggestion # IDE0028: Use collection initializers or expressions
82+
dotnet_style_prefer_collection_expression = true:suggestion # IDE0028: Use collection initializers or expressions
8283
dotnet_style_prefer_auto_properties = true:suggestion # IDE0032: Use auto-implemented property
8384
dotnet_style_explicit_tuple_names = true:suggestion # IDE0033: Use explicitly provided tuple name
8485
csharp_prefer_simple_default_expression = true:suggestion # IDE0034: Simplify default expression

src/Docfx.App/Config/BuildJsonConfig.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ internal class BuildJsonConfig
7272
/// </summary>
7373
[JsonProperty("globalMetadataFiles")]
7474
[JsonPropertyName("globalMetadataFiles")]
75-
public ListWithStringFallback GlobalMetadataFiles { get; set; } = new();
75+
public ListWithStringFallback GlobalMetadataFiles { get; set; } = [];
7676

7777
/// <summary>
7878
/// Metadata that applies to some specific files.
@@ -99,7 +99,7 @@ internal class BuildJsonConfig
9999
/// </summary>
100100
[JsonProperty("template")]
101101
[JsonPropertyName("template")]
102-
public ListWithStringFallback Template { get; set; } = new();
102+
public ListWithStringFallback Template { get; set; } = [];
103103

104104
/// <summary>
105105
/// The themes applied to the documentation.
@@ -123,7 +123,7 @@ internal class BuildJsonConfig
123123
/// </example>
124124
[JsonProperty("postProcessors")]
125125
[JsonPropertyName("postProcessors")]
126-
public ListWithStringFallback PostProcessors { get; set; } = new();
126+
public ListWithStringFallback PostProcessors { get; set; } = [];
127127

128128
/// <summary>
129129
/// Run in debug mode. With debug mode, raw model and view model will be exported

src/Docfx.App/Config/FileMetadataPairs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public FileMetadataPairs(IEnumerable<FileMetadataPairsItem> items)
3939
/// </summary>
4040
public FileMetadataPairs(FileMetadataPairsItem item)
4141
{
42-
_items = new List<FileMetadataPairsItem> { item };
42+
_items = [item];
4343
}
4444

4545
/// <summary>

src/Docfx.App/Config/GroupConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ internal class GroupConfig
2323
/// </summary>
2424
[Newtonsoft.Json.JsonExtensionData]
2525
[System.Text.Json.Serialization.JsonExtensionData]
26-
public Dictionary<string, object> Metadata { get; set; } = new();
26+
public Dictionary<string, object> Metadata { get; set; } = [];
2727
}

src/Docfx.App/Helpers/DocumentBuilderWrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private static FileMetadata GetFileMetadata(string baseDirectory, BuildJsonConfi
263263
{
264264
foreach (var (key, value) in config.FileMetadata)
265265
{
266-
var list = result.TryGetValue(key, out var items) ? items : result[key] = new();
266+
var list = result.TryGetValue(key, out var items) ? items : result[key] = [];
267267
foreach (var pair in value.Items)
268268
{
269269
list.Add(new FileMetadataItem(pair.Glob, key, pair.Value));
@@ -277,7 +277,7 @@ private static FileMetadata GetFileMetadata(string baseDirectory, BuildJsonConfi
277277
{
278278
foreach (var (key, value) in JsonUtility.Deserialize<Dictionary<string, FileMetadataPairs>>(path))
279279
{
280-
var list = result.TryGetValue(key, out var items) ? items : result[key] = new();
280+
var list = result.TryGetValue(key, out var items) ? items : result[key] = [];
281281
foreach (var pair in value.Items)
282282
{
283283
list.Add(new FileMetadataItem(pair.Glob, key, pair.Value));

src/Docfx.App/Helpers/MetadataMerger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace Docfx;
1414

1515
internal class MetadataMerger
1616
{
17-
private readonly Dictionary<string, Dictionary<string, object>> _metaTable = new();
18-
private readonly Dictionary<string, Dictionary<string, object>> _propTable = new();
17+
private readonly Dictionary<string, Dictionary<string, object>> _metaTable = [];
18+
private readonly Dictionary<string, Dictionary<string, object>> _propTable = [];
1919

2020
public void Merge(MetadataMergeParameters parameters)
2121
{

src/Docfx.App/PdfBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ await Parallel.ForEachAsync(pages, async (item, _) =>
311311

312312
var key = CleanUrl(url);
313313
if (!pagesByUrl.TryGetValue(key, out var dests))
314-
pagesByUrl[key] = dests = new();
314+
pagesByUrl[key] = dests = [];
315315
dests.Add((node, document.Structure.Catalog.GetNamedDestinations()));
316316

317317
pageBytes[node] = bytes;

src/Docfx.App/RunBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static string Exec(BuildJsonConfig config, BuildOptions options, string c
2121
var stopwatch = Stopwatch.StartNew();
2222
if (config.Template == null || config.Template.Count == 0)
2323
{
24-
config.Template = new ListWithStringFallback { "default" };
24+
config.Template = ["default"];
2525
}
2626

2727
var baseDirectory = Path.GetFullPath(string.IsNullOrEmpty(configDirectory) ? Directory.GetCurrentDirectory() : configDirectory);

src/Docfx.App/RunMerge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private static MetadataMergeParameters ConfigToParameter(MergeJsonItemConfig con
5656
OutputBaseDir = outputDirectory,
5757
Metadata = config.GlobalMetadata?.ToImmutableDictionary() ?? ImmutableDictionary<string, object>.Empty,
5858
FileMetadata = ConvertToFileMetadataItem(baseDirectory, config.FileMetadata),
59-
TocMetadata = config.TocMetadata?.ToImmutableList() ?? ImmutableList<string>.Empty,
59+
TocMetadata = config.TocMetadata?.ToImmutableList() ?? [],
6060
Files = GetFileCollectionFromFileMapping(
6161
baseDirectory,
6262
DocumentType.Article,

src/Docfx.Build.Common/MarkdownReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Docfx.Build.Common;
1313

1414
public class MarkdownReader
1515
{
16-
private static readonly ImmutableList<string> RequiredProperties = ImmutableList.Create(Constants.PropertyName.Uid);
16+
private static readonly ImmutableList<string> RequiredProperties = [Constants.PropertyName.Uid];
1717

1818
public static IEnumerable<OverwriteDocumentModel> ReadMarkdownAsOverwrite(IHostService host, FileAndType ft)
1919
{

src/Docfx.Build.Common/ModelAttributeHandlers/HandleModelAttributesContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public class HandleModelAttributesContext
1414
public bool EnableContentPlaceholder { get; set; }
1515
public string PlaceholderContent { get; set; }
1616
public bool ContainsPlaceholder { get; set; }
17-
public HashSet<string> Dependency { get; set; } = new();
17+
public HashSet<string> Dependency { get; set; } = [];
1818
public FileAndType FileAndType { get; set; }
1919
public HashSet<string> LinkToFiles { get; set; } = new(FilePathComparer.OSPlatformSensitiveStringComparer);
20-
public HashSet<string> LinkToUids { get; set; } = new();
21-
public List<UidDefinition> Uids { get; set; } = new();
22-
public Dictionary<string, List<LinkSourceInfo>> UidLinkSources { get; set; } = new();
23-
public Dictionary<string, List<LinkSourceInfo>> FileLinkSources { get; set; } = new();
20+
public HashSet<string> LinkToUids { get; set; } = [];
21+
public List<UidDefinition> Uids { get; set; } = [];
22+
public Dictionary<string, List<LinkSourceInfo>> UidLinkSources { get; set; } = [];
23+
public Dictionary<string, List<LinkSourceInfo>> FileLinkSources { get; set; } = [];
2424
}

src/Docfx.Build.Common/ModelAttributeHandlers/Handlers/UrlContentHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private static string GetHrefFromRoot(string originalHref, HandleModelAttributes
9898

9999
if (!context.FileLinkSources.TryGetValue(file, out List<LinkSourceInfo> sources))
100100
{
101-
sources = new List<LinkSourceInfo>();
101+
sources = [];
102102
context.FileLinkSources[file] = sources;
103103
}
104104
sources.Add(new LinkSourceInfo

src/Docfx.Build.Common/Reference/OverwriteDocumentModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class OverwriteDocumentModel
1717
[ExtensibleMember]
1818
[Newtonsoft.Json.JsonExtensionData]
1919
[System.Text.Json.Serialization.JsonExtensionData]
20-
public Dictionary<string, object> Metadata { get; set; } = new();
20+
public Dictionary<string, object> Metadata { get; set; } = [];
2121

2222
/// <summary>
2323
/// The uid for this overwrite document, as defined in YAML header
@@ -49,31 +49,31 @@ public class OverwriteDocumentModel
4949
[YamlIgnore]
5050
[Newtonsoft.Json.JsonIgnore]
5151
[System.Text.Json.Serialization.JsonIgnore]
52-
public HashSet<string> LinkToFiles { get; set; } = new();
52+
public HashSet<string> LinkToFiles { get; set; } = [];
5353

5454
/// <summary>
5555
/// Links to other Uids
5656
/// </summary>
5757
[YamlIgnore]
5858
[Newtonsoft.Json.JsonIgnore]
5959
[System.Text.Json.Serialization.JsonIgnore]
60-
public HashSet<string> LinkToUids { get; set; } = new();
60+
public HashSet<string> LinkToUids { get; set; } = [];
6161

6262
/// <summary>
6363
/// Link sources information for file
6464
/// </summary>
6565
[YamlIgnore]
6666
[Newtonsoft.Json.JsonIgnore]
6767
[System.Text.Json.Serialization.JsonIgnore]
68-
public Dictionary<string, List<LinkSourceInfo>> FileLinkSources { get; set; } = new();
68+
public Dictionary<string, List<LinkSourceInfo>> FileLinkSources { get; set; } = [];
6969

7070
/// <summary>
7171
/// Link sources information for Uid
7272
/// </summary>
7373
[YamlIgnore]
7474
[Newtonsoft.Json.JsonIgnore]
7575
[System.Text.Json.Serialization.JsonIgnore]
76-
public Dictionary<string, List<LinkSourceInfo>> UidLinkSources { get; set; } = new();
76+
public Dictionary<string, List<LinkSourceInfo>> UidLinkSources { get; set; } = [];
7777

7878
/// <summary>
7979
/// Dependencies extracted from the markdown content

src/Docfx.Build.ManagedReference/ApplyPlatformVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static List<string> GetPlatformVersionFromMetadata(object value)
6060
{
6161
if (value is string text)
6262
{
63-
return new List<string> { text };
63+
return [text];
6464
}
6565

6666
if (value is IEnumerable<object> collection)

src/Docfx.Build.ManagedReference/BuildOutputs/ApiBuildOutput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public class ApiBuildOutput
184184
[ExtensibleMember]
185185
[Newtonsoft.Json.JsonExtensionData]
186186
[System.Text.Json.Serialization.JsonExtensionData]
187-
public Dictionary<string, object> Metadata { get; set; } = new();
187+
public Dictionary<string, object> Metadata { get; set; } = [];
188188

189189
public static ApiBuildOutput FromModel(PageViewModel model)
190190
{

src/Docfx.Build.ManagedReference/BuildOutputs/ApiReferenceBuildOutput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public class ApiReferenceBuildOutput
174174
[Newtonsoft.Json.JsonIgnore]
175175
[System.Text.Json.Serialization.JsonIgnore]
176176
[System.Text.Json.Serialization.JsonPropertyName("__metadata__")]
177-
public Dictionary<string, object> Metadata { get; set; } = new();
177+
public Dictionary<string, object> Metadata { get; set; } = [];
178178

179179
[EditorBrowsable(EditorBrowsableState.Never)]
180180
[YamlIgnore]

src/Docfx.Build.ManagedReference/FillReferenceInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Docfx.Build.ManagedReference;
1414
[Export(nameof(ManagedReferenceDocumentProcessor), typeof(IDocumentBuildStep))]
1515
public class FillReferenceInformation : BaseDocumentBuildStep
1616
{
17-
private readonly Dictionary<string, SourceInfo> _items = new();
17+
private readonly Dictionary<string, SourceInfo> _items = [];
1818

1919
public override string Name => nameof(FillReferenceInformation);
2020

src/Docfx.Build.ManagedReference/MergeManagedReferenceDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static PageViewModel ConvertToVM(MergeItem mergeItem)
176176
{
177177
var vm = new PageViewModel
178178
{
179-
Items = new List<ItemViewModel>(),
179+
Items = [],
180180
References = mergeItem.References?.Values.ToList(),
181181
Metadata = mergeItem.Metadata,
182182
};

src/Docfx.Build.ManagedReference/SplitClassPageToMemberLevel.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class SplitClassPageToMemberLevel : BaseDocumentBuildStep
2121
private const string SplitFromPropertyName = "_splitFrom";
2222
private const string IsOverloadPropertyName = "_isOverload";
2323
private const int MaximumFileNameLength = 180;
24-
private static readonly List<string> EmptyList = new();
25-
private static readonly string[] EmptyArray = Array.Empty<string>();
24+
private static readonly List<string> EmptyList = [];
25+
private static readonly string[] EmptyArray = [];
2626

2727
public override string Name => nameof(SplitClassPageToMemberLevel);
2828

@@ -95,7 +95,7 @@ private static void RenewDupeFileModels(FileModel dupeModel, Dictionary<string,
9595
}
9696

9797
var newFilePath = GetUniqueFilePath(dupeModel.File, newFileName, newFilePaths, modelsDict);
98-
var newModel = GenerateNewFileModel(dupeModel, page, Path.GetFileNameWithoutExtension(newFilePath), new Dictionary<string, int> { });
98+
var newModel = GenerateNewFileModel(dupeModel, page, Path.GetFileNameWithoutExtension(newFilePath), []);
9999
modelsDict[newFilePath] = newModel;
100100
}
101101

@@ -180,7 +180,7 @@ private SplittedResult SplitModelToOverloadLevel(FileModel model, Dictionary<str
180180
// Convert children to references
181181
page.References = itemsToSplit.Select(ConvertToReference).Concat(page.References).ToList();
182182

183-
page.Items = new List<ItemViewModel> { primaryItem };
183+
page.Items = [primaryItem];
184184
page.Metadata[SplitReferencePropertyName] = true;
185185
page.Metadata[SplitFromPropertyName] = true;
186186

@@ -210,7 +210,7 @@ private static IEnumerable<PageViewModel> GetNewPages(PageViewModel page)
210210
{
211211
foreach (var item in overload)
212212
{
213-
yield return ExtractPageViewModel(page, new List<ItemViewModel> { item });
213+
yield return ExtractPageViewModel(page, [item]);
214214
}
215215
}
216216
else
@@ -296,7 +296,7 @@ private static List<string> GetVersionFromMetadata(object value)
296296
{
297297
if (value is string text)
298298
{
299-
return new List<string> { text };
299+
return [text];
300300
}
301301

302302
return GetListFromObject(value);

src/Docfx.Build.OperationLevelRestApi/SplitRestApiToOperationLevel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ private static Tuple<List<FileModel>, List<TreeItemRestructure>> SplitModelToOpe
7777
}
7878

7979
// Reset children
80-
content.Children = new List<RestApiChildItemViewModel>();
80+
content.Children = [];
8181
content.Metadata["_isSplittedByOperation"] = true;
82-
content.Tags = new List<RestApiTagViewModel>();
82+
content.Tags = [];
8383
model.Content = content;
8484

8585
// Reset uid definition
@@ -123,8 +123,8 @@ private static IEnumerable<RestApiRootItemViewModel> GenerateOperationModels(Res
123123
Summary = child.Summary,
124124
Remarks = child.Remarks,
125125
Documentation = child.Documentation,
126-
Children = new List<RestApiChildItemViewModel> { child },
127-
Tags = new List<RestApiTagViewModel>(),
126+
Children = [child],
127+
Tags = [],
128128
Metadata = MergeChildMetadata(root, child)
129129
};
130130

@@ -139,7 +139,7 @@ private static IEnumerable<RestApiRootItemViewModel> GenerateOperationModels(Res
139139
child.Description = null;
140140
child.Summary = null;
141141
child.Remarks = null;
142-
child.Tags = new List<string>();
142+
child.Tags = [];
143143

144144
yield return model;
145145
}

src/Docfx.Build.OverwriteDocuments/MarkdownFragmentsCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private List<MarkdownPropertyModel> PropertySection()
6969
{
7070
PropertyName = key,
7171
PropertyNameSource = Next(),
72-
PropertyValue = new List<Block>(),
72+
PropertyValue = [],
7373
};
7474
Block block;
7575
while ((block = Peek()) != null && !_inlineCodeHeadingRule.Parse(block, out var _))

src/Docfx.Build.OverwriteDocuments/OverwriteDocumentModelCreator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal static Dictionary<object, object> ConvertYamlCodeBlock(string yamlCodeB
3737
{
3838
if (string.IsNullOrEmpty(yamlCodeBlock) || yamlCodeBlockSource == null)
3939
{
40-
return new Dictionary<object, object>();
40+
return [];
4141
}
4242

4343
using var reader = new StringReader(yamlCodeBlock);
@@ -202,7 +202,7 @@ private MarkdownDocument CreateDocument(MarkdownPropertyModel model)
202202

203203
private static Dictionary<object, object> CreateDictionaryObject()
204204
{
205-
return new Dictionary<object, object>();
205+
return [];
206206
}
207207

208208
private static List<object> CreateDictionaryArrayObject(OPathSegment segment)

src/Docfx.Build.OverwriteDocuments/OverwriteUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static void AddOrUpdateFragmentEntity(this Dictionary<string, MarkdownFra
7979
value = new MarkdownFragment
8080
{
8181
Uid = uid,
82-
Properties = new Dictionary<string, MarkdownProperty>(),
82+
Properties = [],
8383
Metadata = metadata
8484
};
8585
fragments.Add(uid, value);

src/Docfx.Build.OverwriteDocuments/Rules/YamlCodeBlockRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed class YamlCodeBlockRule : IOverwriteBlockRule
1010
{
1111
public string TokenName => "YamlCodeBlock";
1212

13-
private static readonly List<string> _allowedLanguages = new() { "yaml", "yml" };
13+
private static readonly List<string> _allowedLanguages = ["yaml", "yml"];
1414

1515
public bool Parse(Block block, out string value)
1616
{

src/Docfx.Build.RestApi/BuildRestApiDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Docfx.Build.RestApi;
1515
[Export(nameof(RestApiDocumentProcessor), typeof(IDocumentBuildStep))]
1616
public class BuildRestApiDocument : BuildReferenceDocumentBase
1717
{
18-
private static readonly HashSet<string> MarkupKeys = new() { "description" };
18+
private static readonly HashSet<string> MarkupKeys = ["description"];
1919

2020
public override string Name => nameof(BuildRestApiDocument);
2121

src/Docfx.Build.RestApi/Swagger/InfoObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ public class InfoObject
3232
[ExtensibleMember]
3333
[Newtonsoft.Json.JsonExtensionData]
3434
[System.Text.Json.Serialization.JsonExtensionData]
35-
public Dictionary<string, object> PatternedObjects { get; set; } = new();
35+
public Dictionary<string, object> PatternedObjects { get; set; } = [];
3636
}

src/Docfx.Build.RestApi/Swagger/Internals/SwaggerArray.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class SwaggerArray : SwaggerObjectBase
77
{
88
public override SwaggerObjectType ObjectType => SwaggerObjectType.Array;
99

10-
public List<SwaggerObjectBase> Array { get; set; } = new();
10+
public List<SwaggerObjectBase> Array { get; set; } = [];
1111

1212
public override SwaggerObjectBase Clone()
1313
{

src/Docfx.Build.RestApi/Swagger/Internals/SwaggerObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class SwaggerObject : SwaggerObjectBase
77
{
88
public override SwaggerObjectType ObjectType => SwaggerObjectType.Object;
99

10-
public Dictionary<string, SwaggerObjectBase> Dictionary { get; set; } = new();
10+
public Dictionary<string, SwaggerObjectBase> Dictionary { get; set; } = [];
1111

1212
public override SwaggerObjectBase Clone()
1313
{

src/Docfx.Build.RestApi/Swagger/OperationObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ public class OperationObject
4949
[ExtensibleMember]
5050
[Newtonsoft.Json.JsonExtensionData]
5151
[System.Text.Json.Serialization.JsonExtensionData]
52-
public Dictionary<string, object> Metadata { get; set; } = new();
52+
public Dictionary<string, object> Metadata { get; set; } = [];
5353
}

0 commit comments

Comments
 (0)