1- // Copyright (c) Microsoft Corporation. All rights reserved.
1+ // Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
44using System . Globalization ;
@@ -21,9 +21,7 @@ public static class OpenApiSerializableExtensions
2121 /// <param name="stream">The output stream.</param>
2222 /// <param name="specVersion">The Open API specification version.</param>
2323 /// <param name="cancellationToken">The cancellation token.</param>
24- #pragma warning disable RS0027 // The settings overload below has the same parameter count but different types; no ambiguity exists.
2524 public static Task SerializeAsJsonAsync < T > ( this T element , Stream stream , OpenApiSpecVersion specVersion , CancellationToken cancellationToken = default )
26- #pragma warning restore RS0027
2725 where T : IOpenApiSerializable
2826 {
2927 return element . SerializeAsync ( stream , specVersion , OpenApiConstants . Json , cancellationToken ) ;
@@ -70,14 +68,12 @@ public static Task SerializeAsYamlAsync<T>(this T element, Stream stream, OpenAp
7068 /// <param name="specVersion">The Open API specification version.</param>
7169 /// <param name="format">The output format (JSON or YAML).</param>
7270 /// <param name="cancellationToken">The cancellation token.</param>
73- #pragma warning disable RS0027 // The settings overload below has the same parameter count but different types; no ambiguity exists.
7471 public static Task SerializeAsync < T > (
7572 this T element ,
7673 Stream stream ,
7774 OpenApiSpecVersion specVersion ,
7875 string format ,
7976 CancellationToken cancellationToken = default )
80- #pragma warning restore RS0027
8177 where T : IOpenApiSerializable
8278 {
8379 return element . SerializeAsync ( stream , specVersion , format , null , cancellationToken ) ;
@@ -125,9 +121,7 @@ public static Task SerializeAsync<T>(
125121 /// <param name="writer">The output writer.</param>
126122 /// <param name="specVersion">Version of the specification the output should conform to</param>
127123 /// <param name="cancellationToken">The cancellation token.</param>
128- #pragma warning disable RS0027 // The settings-bearing SerializeAsync overloads below have the same parameter count but different types; no ambiguity exists.
129124 public static Task SerializeAsync < T > ( this T element , IOpenApiWriter writer , OpenApiSpecVersion specVersion , CancellationToken cancellationToken = default )
130- #pragma warning restore RS0027
131125 where T : IOpenApiSerializable
132126 {
133127 Utils . CheckArgumentNull ( element ) ;
@@ -165,12 +159,10 @@ public static Task SerializeAsync<T>(this T element, IOpenApiWriter writer, Open
165159 /// <param name="element">The Open API element.</param>
166160 /// <param name="specVersion">The Open API specification version.</param>
167161 /// <param name="cancellationToken">The cancellation token.</param>
168- #pragma warning disable RS0027 // The settings overload below has the same parameter count but different types; no ambiguity exists.
169162 public static Task < string > SerializeAsJsonAsync < T > (
170163 this T element ,
171164 OpenApiSpecVersion specVersion ,
172165 CancellationToken cancellationToken = default )
173- #pragma warning restore RS0027
174166 where T : IOpenApiSerializable
175167 {
176168 return element . SerializeAsync ( specVersion , OpenApiConstants . Json , cancellationToken ) ;
@@ -220,13 +212,11 @@ public static Task<string> SerializeAsYamlAsync<T>(
220212 /// <param name="specVersion">The Open API specification version.</param>
221213 /// <param name="format">Open API document format.</param>
222214 /// <param name="cancellationToken">The cancellation token.</param>
223- #pragma warning disable RS0027 // The settings overload below has the same parameter count but different types; no ambiguity exists.
224215 public static async Task < string > SerializeAsync < T > (
225216 this T element ,
226217 OpenApiSpecVersion specVersion ,
227218 string format ,
228219 CancellationToken cancellationToken = default )
229- #pragma warning restore RS0027
230220 where T : IOpenApiSerializable
231221 {
232222 Utils . CheckArgumentNull ( element ) ;
0 commit comments