Skip to content

Commit 37054bf

Browse files
committed
fix OpenApiWriterBase default param addition
1 parent 84af7ad commit 37054bf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Microsoft.OpenApi/Writers/OpenApiWriterBase.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,27 @@ public abstract class OpenApiWriterBase : IOpenApiWriter
3939
/// Initializes a new instance of the <see cref="OpenApiWriterBase"/> class.
4040
/// </summary>
4141
/// <param name="textWriter">The text writer.</param>
42-
public OpenApiWriterBase(TextWriter textWriter)
42+
public OpenApiWriterBase(TextWriter textWriter) : this(textWriter, null)
4343
{
44-
Writer = textWriter;
45-
Writer.NewLine = "\n";
46-
47-
Scopes = new Stack<Scope>();
4844
}
4945

5046
/// <summary>
5147
/// Initializes a new instance of the <see cref="OpenApiWriterBase"/> class.
5248
/// </summary>
5349
/// <param name="textWriter"></param>
5450
/// <param name="settings"></param>
55-
public OpenApiWriterBase(TextWriter textWriter, OpenApiWriterSettings settings = null) : this(textWriter)
51+
public OpenApiWriterBase(TextWriter textWriter, OpenApiWriterSettings settings = null)
5652
{
53+
Writer = textWriter;
54+
Writer.NewLine = "\n";
55+
56+
Scopes = new Stack<Scope>();
57+
5758
if (settings == null)
5859
{
5960
settings = new OpenApiWriterSettings();
6061
}
62+
6163
Settings = settings;
6264
}
6365

0 commit comments

Comments
 (0)