Skip to content

Commit e8ecc1a

Browse files
committed
Return previously deleted method
1 parent 076009c commit e8ecc1a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Microsoft.OpenApi/Writers/OpenApiWriterExtensions.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,25 @@ public static void WriteRequiredObject<T>(
180180
}
181181
}
182182

183+
/// <summary>
184+
/// Write the optional of collection string.
185+
/// </summary>
186+
/// <param name="writer">The Open API writer.</param>
187+
/// <param name="name">The property name.</param>
188+
/// <param name="elements">The collection values.</param>
189+
/// <param name="action">The collection string writer action.</param>
190+
public static void WriteOptionalCollection(
191+
this IOpenApiWriter writer,
192+
string name,
193+
IEnumerable<string> elements,
194+
Action<IOpenApiWriter, string> action)
195+
{
196+
if (elements != null && elements.Any())
197+
{
198+
writer.WriteCollectionInternal(name, elements, action);
199+
}
200+
}
201+
183202
/// <summary>
184203
/// Write the optional Open API object/element collection.
185204
/// </summary>

0 commit comments

Comments
 (0)