Skip to content

Commit 20a0c04

Browse files
committed
Add constructor to the abstract class
1 parent 984d9b0 commit 20a0c04

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/Microsoft.OpenApi/Models/OpenApiExtensibleDictionary.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license.
33

44
using System.Collections.Generic;
5-
using Microsoft.OpenApi.Any;
65
using Microsoft.OpenApi.Interfaces;
76
using Microsoft.OpenApi.Writers;
87

@@ -17,6 +16,23 @@ public abstract class OpenApiExtensibleDictionary<T> : Dictionary<string, T>,
1716
IOpenApiExtensible
1817
where T : IOpenApiSerializable
1918
{
19+
/// <summary>
20+
/// Parameterless constructor
21+
/// </summary>
22+
protected OpenApiExtensibleDictionary() { }
23+
24+
/// <summary>
25+
/// Initializes a copy of <see cref="OpenApiExtensibleDictionary{T}"/> class.
26+
/// </summary>
27+
/// <param name="dictionary">The generic dictionary.</param>
28+
/// <param name="extensions">The dictionary of <see cref="IOpenApiExtension"/>.</param>
29+
protected OpenApiExtensibleDictionary(
30+
Dictionary<string, T> dictionary = null,
31+
IDictionary<string, IOpenApiExtension> extensions = null) : base (dictionary)
32+
{
33+
Extensions = extensions != null ? new Dictionary<string, IOpenApiExtension>(extensions) : null;
34+
}
35+
2036
/// <summary>
2137
/// This object MAY be extended with Specification Extensions.
2238
/// </summary>

0 commit comments

Comments
 (0)